47 int node, e_gid, catch_error;
50 double det,
theta, pressure, dpressure, coeff_kp;
60 Epetra_SerialDenseMatrix deformation_gradient(3,3);
61 Epetra_SerialDenseMatrix tangent_matrix_isc(6,6);
62 Epetra_SerialDenseMatrix tangent_matrix_vol(6,6);
63 Epetra_SerialDenseVector scd_piola_stress_isc(6);
64 Epetra_SerialDenseVector scd_piola_stress_vol(6);
65 Epetra_SerialDenseVector piola_vol(6);
66 Epetra_SerialDenseVector inverse_cauchy(6);
67 Epetra_SerialDenseMatrix block_scd_piola_stress_isc(9,9);
68 Epetra_SerialDenseMatrix block_scd_piola_stress_vol(9,9);
71 Epetra_SerialDenseMatrix dx_shape_functions(
Mesh->
el_type,3);
72 Epetra_SerialDenseMatrix matrix_B(6,3*
Mesh->
el_type);
73 Epetra_SerialDenseMatrix B_times_TM(3*
Mesh->
el_type,6);
74 Epetra_SerialDenseMatrix matrix_BG(9,3*
Mesh->
el_type);
75 Epetra_SerialDenseMatrix BG_times_BSPS(3*
Mesh->
el_type,9);
80 for (
unsigned int inode=0; inode<
Mesh->
el_type; ++inode){
86 for (
int iddl=0; iddl<3; ++iddl){
87 Re(3*inode+iddl) = 0.0;
88 Re_vol(3*inode+iddl) = 0.0;
89 Re_vol2(3*inode+iddl) = 0.0;
90 Indexes[3*inode+iddl] = 3*node+iddl;
91 for (
unsigned int jnode=0; jnode<
Mesh->
el_type; ++jnode){
92 for (
int jddl=0; jddl<3; ++jddl){
93 Ke(3*inode+iddl,3*jnode+jddl) = 0.0;
94 Ke_vol(3*inode+iddl,3*jnode+jddl) = 0.0;
95 Kg(3*inode+iddl,3*jnode+jddl) = 0.0;
96 Kg_vol(3*inode+iddl,3*jnode+jddl) = 0.0;
103 for (
unsigned int gp=0; gp<n_gauss_points; ++gp){
105 for (
unsigned int inode=0; inode<
Mesh->
el_type; ++inode){
106 dx_shape_functions(inode,0) =
Mesh->
DX_N_cells(gp+n_gauss_points*inode,e_lid);
107 dx_shape_functions(inode,1) =
Mesh->
DY_N_cells(gp+n_gauss_points*inode,e_lid);
108 dx_shape_functions(inode,2) =
Mesh->
DZ_N_cells(gp+n_gauss_points*inode,e_lid);
111 deformation_gradient.Multiply(
'N',
'N',1.0,matrix_x,dx_shape_functions,0.0);
117 for (
unsigned int i=0;
i<3; ++
i){
118 block_scd_piola_stress_isc(3*
i+0,3*
i+0) = scd_piola_stress_isc(0);
119 block_scd_piola_stress_isc(3*
i+0,3*
i+1) = scd_piola_stress_isc(5);
120 block_scd_piola_stress_isc(3*
i+0,3*
i+2) = scd_piola_stress_isc(4);
121 block_scd_piola_stress_isc(3*
i+1,3*
i+0) = scd_piola_stress_isc(5);
122 block_scd_piola_stress_isc(3*
i+1,3*
i+1) = scd_piola_stress_isc(1);
123 block_scd_piola_stress_isc(3*
i+1,3*
i+2) = scd_piola_stress_isc(3);
124 block_scd_piola_stress_isc(3*
i+2,3*
i+0) = scd_piola_stress_isc(4);
125 block_scd_piola_stress_isc(3*
i+2,3*
i+1) = scd_piola_stress_isc(3);
126 block_scd_piola_stress_isc(3*
i+2,3*
i+2) = scd_piola_stress_isc(2);
128 block_scd_piola_stress_vol(3*
i+0,3*
i+0) = scd_piola_stress_vol(0);
129 block_scd_piola_stress_vol(3*
i+0,3*
i+1) = scd_piola_stress_vol(5);
130 block_scd_piola_stress_vol(3*
i+0,3*
i+2) = scd_piola_stress_vol(4);
131 block_scd_piola_stress_vol(3*
i+1,3*
i+0) = scd_piola_stress_vol(5);
132 block_scd_piola_stress_vol(3*
i+1,3*
i+1) = scd_piola_stress_vol(1);
133 block_scd_piola_stress_vol(3*
i+1,3*
i+2) = scd_piola_stress_vol(3);
134 block_scd_piola_stress_vol(3*
i+2,3*
i+0) = scd_piola_stress_vol(4);
135 block_scd_piola_stress_vol(3*
i+2,3*
i+1) = scd_piola_stress_vol(3);
136 block_scd_piola_stress_vol(3*
i+2,3*
i+2) = scd_piola_stress_vol(2);
139 for (
unsigned int j=0;
j<6; ++
j){
140 piola_vol(
j) = det*inverse_cauchy(
j);
145 Re.Multiply(
'T',
'N',-gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,scd_piola_stress_isc,1.0);
146 Re_vol.Multiply(
'T',
'N',-gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,scd_piola_stress_vol,1.0);
147 Re_vol2.Multiply(
'T',
'N',-gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,piola_vol,1.0);
149 B_times_TM.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,tangent_matrix_isc,0.0);
150 Ke.Multiply(
'N',
'N',1.0,B_times_TM,matrix_B,1.0);
151 B_times_TM.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,tangent_matrix_vol,0.0);
152 Ke_vol.Multiply(
'N',
'N',1.0,B_times_TM,matrix_B,1.0);
154 BG_times_BSPS.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_BG,block_scd_piola_stress_isc,0.0);
155 Kg.Multiply(
'N',
'N',1.0,BG_times_BSPS,matrix_BG,1.0);
156 BG_times_BSPS.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_BG,block_scd_piola_stress_vol,0.0);
157 Kg_vol.Multiply(
'N',
'N',1.0,BG_times_BSPS,matrix_BG,1.0);
164 Kp.Multiply(
'N',
'T',coeff_kp,Re_vol,Re_vol2,0.0);
165 Re_vol.Scale(pressure);
166 Ke_vol.Scale(pressure);
167 Kg_vol.Scale(pressure);
176 F.SumIntoGlobalValues(1, &Indexes[
i], &Re(i));
178 catch_error = K.SumIntoGlobalValues(1, &Indexes[i], 1, &Indexes[
j], &Ke(i,j));
198 Epetra_SerialDenseMatrix dxi_matrix_x(3,2);
206 Indexes[3*inode+0] = 3*node+0;
207 Indexes[3*inode+1] = 3*node+1;
208 Indexes[3*inode+2] = 3*node+2;
212 force(3*inode+0) = 0.0;
213 force(3*inode+1) = 0.0;
214 force(3*inode+2) = 0.0;
216 k1(inode,jnode) = 0.0;
217 k2(inode,jnode) = 0.0;
218 k3(inode,jnode) = 0.0;
222 for (
unsigned int gp=0; gp<n_gauss_points; ++gp){
228 dxi_matrix_x.Multiply(
'N',
'N',1.0,matrix_x,d_shape_functions,0.0);
231 force(3*inode+0) += gauss_weight*
pressure_load*
Mesh->
N_faces(gp,inode)*(dxi_matrix_x(1,0)*dxi_matrix_x(2,1) - dxi_matrix_x(2,0)*dxi_matrix_x(1,1));
232 force(3*inode+1) += gauss_weight*
pressure_load*
Mesh->
N_faces(gp,inode)*(dxi_matrix_x(2,0)*dxi_matrix_x(0,1) - dxi_matrix_x(0,0)*dxi_matrix_x(2,1));
233 force(3*inode+2) += gauss_weight*
pressure_load*
Mesh->
N_faces(gp,inode)*(dxi_matrix_x(0,0)*dxi_matrix_x(1,1) - dxi_matrix_x(1,0)*dxi_matrix_x(0,1));
236 k1(inode,jnode) += 0.5*gauss_weight*
pressure_load*( dxi_matrix_x(0,0)*(
d_shape_functions(inode,1)*
Mesh->
N_faces(gp,jnode) -
d_shape_functions(jnode,1)*
Mesh->
N_faces(gp,inode)) - dxi_matrix_x(0,1)*(
d_shape_functions(inode,0)*
Mesh->
N_faces(gp,jnode) -
d_shape_functions(jnode,0)*
Mesh->
N_faces(gp,inode)) );
237 k2(inode,jnode) += 0.5*gauss_weight*pressure_load*( dxi_matrix_x(1,0)*(
d_shape_functions(inode,1)*
Mesh->
N_faces(gp,jnode) -
d_shape_functions(jnode,1)*
Mesh->
N_faces(gp,inode)) - dxi_matrix_x(1,1)*(
d_shape_functions(inode,0)*
Mesh->
N_faces(gp,jnode) -
d_shape_functions(jnode,0)*
Mesh->
N_faces(gp,inode)) );
238 k3(inode,jnode) += 0.5*gauss_weight*pressure_load*( dxi_matrix_x(2,0)*(
d_shape_functions(inode,1)*
Mesh->
N_faces(gp,jnode) -
d_shape_functions(jnode,1)*
Mesh->
N_faces(gp,inode)) - dxi_matrix_x(2,1)*(
d_shape_functions(inode,0)*
Mesh->
N_faces(gp,jnode) -
d_shape_functions(jnode,0)*
Mesh->
N_faces(gp,inode)) );
248 F.SumIntoGlobalValues(1, &Indexes[
i], &force(i));
253 kf = k1(inode,jnode);
254 K.SumIntoGlobalValues(1, &Indexes[3*inode+2], 1, &Indexes[3*jnode+1], &kf);
256 K.SumIntoGlobalValues(1, &Indexes[3*inode+1], 1, &Indexes[3*jnode+2], &kf);
258 kf = k2(inode,jnode);
259 K.SumIntoGlobalValues(1, &Indexes[3*inode+0], 1, &Indexes[3*jnode+2], &kf);
261 K.SumIntoGlobalValues(1, &Indexes[3*inode+2], 1, &Indexes[3*jnode+0], &kf);
263 kf = k3(inode,jnode);
264 K.SumIntoGlobalValues(1, &Indexes[3*inode+1], 1, &Indexes[3*jnode+0], &kf);
266 K.SumIntoGlobalValues(1, &Indexes[3*inode+0], 1, &Indexes[3*jnode+1], &kf);
~nearlyIncompressibleHyperelasticity()
std::vector< int > local_faces
Epetra_SerialDenseVector DZ_N_cells
std::vector< double > nodes_coord
Epetra_SerialDenseMatrix D2_N_faces
void stiffnessRhsPressureContribution(Epetra_Vector &u, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
Epetra_SerialDenseMatrix N_faces
Epetra_SerialDenseVector vol_cells
unsigned int n_gauss_faces
Epetra_SerialDenseVector DX_N_cells
Epetra_SerialDenseVector detJac_cells
std::vector< int > local_cells
void stiffnessRhsMaterialContribution(Epetra_Vector &u, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
std::vector< int > faces_nodes
Epetra_SerialDenseVector DY_N_cells
std::vector< int > cells_nodes
Epetra_Import * ImportToOverlapMap
Epetra_SerialDenseMatrix D1_N_faces
unsigned int n_gauss_cells
Epetra_SerialDenseVector gauss_weight_faces
void compute_B_matrices(Epetra_SerialDenseMatrix &F, Epetra_SerialDenseMatrix &dx_shape_functions, Epetra_SerialDenseMatrix &B, Epetra_SerialDenseMatrix &BG)
virtual void get_material_parameters(unsigned int &e_lid, unsigned int &gp)=0
nearlyIncompressibleHyperelasticity()
void d_shape_functions(Epetra_SerialDenseMatrix &D, double &xi, double &eta)
void assembleMixedDirichletDeformationDependentNeumann_homogeneousForcing(Epetra_Vector &x, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
void assemblePureDirichlet_homogeneousForcing(Epetra_Vector &x, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
virtual void get_constitutive_tensors_static_condensation(Epetra_SerialDenseMatrix &deformation_gradient, double &det, Epetra_SerialDenseVector &inverse_cauchy, Epetra_SerialDenseVector &piola_isc, Epetra_SerialDenseVector &piola_vol, Epetra_SerialDenseMatrix &tangent_piola_isc, Epetra_SerialDenseMatrix &tangent_piola_vol)=0
Epetra_SerialDenseVector gauss_weight_cells
virtual void get_internal_pressure(double &theta, double &pressure, double &dpressure)=0