24 error = K.GlobalAssemble();
25 error = K.FillComplete();
26 error = F.GlobalAssemble();
39 error = K.GlobalAssemble();
40 error = K.FillComplete();
41 error = F.GlobalAssemble();
55 error = K.GlobalAssemble();
56 error = K.FillComplete();
57 error = F.GlobalAssemble();
71 error = K.GlobalAssemble();
72 error = K.FillComplete();
73 error = F.GlobalAssemble();
77 int node, e_gid, error;
87 Epetra_SerialDenseMatrix deformation_gradient(3,3);
88 Epetra_SerialDenseMatrix tangent_matrix(6,6);
89 Epetra_SerialDenseVector scd_piola_stress(6);
90 Epetra_SerialDenseMatrix block_scd_piola_stress(9,9);
93 Epetra_SerialDenseMatrix dx_shape_functions(
Mesh->
el_type,3);
94 Epetra_SerialDenseMatrix matrix_B(6,3*
Mesh->
el_type);
95 Epetra_SerialDenseMatrix B_times_TM(3*
Mesh->
el_type,6);
96 Epetra_SerialDenseMatrix matrix_BG(9,3*
Mesh->
el_type);
97 Epetra_SerialDenseMatrix BG_times_BSPS(3*
Mesh->
el_type,9);
102 for (
unsigned int inode=0; inode<
Mesh->
el_type; ++inode){
107 for (
int iddl=0; iddl<3; ++iddl){
108 Re(3*inode+iddl) = 0.0;
109 Indexes[3*inode+iddl] = 3*node+iddl;
110 for (
unsigned int jnode=0; jnode<
Mesh->
el_type; ++jnode){
111 for (
int jddl=0; jddl<3; ++jddl){
112 Ke(3*inode+iddl,3*jnode+jddl) = 0.0;
118 for (
unsigned int gp=0; gp<n_gauss_points; ++gp){
120 for (
unsigned int inode=0; inode<
Mesh->
el_type; ++inode){
121 dx_shape_functions(inode,0) =
Mesh->
DX_N_cells(gp+n_gauss_points*inode,e_lid);
122 dx_shape_functions(inode,1) =
Mesh->
DY_N_cells(gp+n_gauss_points*inode,e_lid);
123 dx_shape_functions(inode,2) =
Mesh->
DZ_N_cells(gp+n_gauss_points*inode,e_lid);
126 error=deformation_gradient.Multiply(
'N',
'N',1.0,matrix_x,dx_shape_functions,0.0);
132 for (
unsigned int i=0;
i<3; ++
i){
133 block_scd_piola_stress(3*
i+0,3*
i+0) = scd_piola_stress(0);
134 block_scd_piola_stress(3*
i+0,3*
i+1) = scd_piola_stress(5);
135 block_scd_piola_stress(3*
i+0,3*
i+2) = scd_piola_stress(4);
136 block_scd_piola_stress(3*
i+1,3*
i+0) = scd_piola_stress(5);
137 block_scd_piola_stress(3*
i+1,3*
i+1) = scd_piola_stress(1);
138 block_scd_piola_stress(3*
i+1,3*
i+2) = scd_piola_stress(3);
139 block_scd_piola_stress(3*
i+2,3*
i+0) = scd_piola_stress(4);
140 block_scd_piola_stress(3*
i+2,3*
i+1) = scd_piola_stress(3);
141 block_scd_piola_stress(3*
i+2,3*
i+2) = scd_piola_stress(2);
144 error = Re.Multiply(
'T',
'N',-gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,scd_piola_stress,1.0);
146 error = B_times_TM.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,tangent_matrix,0.0);
147 error = Ke.Multiply(
'N',
'N',1.0,B_times_TM,matrix_B,1.0);
149 error = BG_times_BSPS.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_BG,block_scd_piola_stress,0.0);
150 error = Ke.Multiply(
'N',
'N',1.0,BG_times_BSPS,matrix_BG,1.0);
154 error = F.SumIntoGlobalValues(1, &Indexes[
i], &Re(i));
156 error = K.SumIntoGlobalValues(1, &Indexes[i], 1, &Indexes[
j], &Ke(i,j));
164 int node, e_gid, error;
174 Epetra_SerialDenseMatrix deformation_gradient(3,3);
175 Epetra_SerialDenseMatrix tangent_matrix(6,6);
176 Epetra_SerialDenseVector scd_piola_stress(6);
177 Epetra_SerialDenseMatrix block_scd_piola_stress(9,9);
178 Epetra_SerialDenseMatrix matrix_x(3,
Mesh->
el_type);
179 Epetra_SerialDenseMatrix matrix_X(3,
Mesh->
el_type);
180 Epetra_SerialDenseMatrix xg(3,n_gauss_points);
182 Epetra_SerialDenseMatrix dx_shape_functions(
Mesh->
el_type,3);
183 Epetra_SerialDenseMatrix matrix_B(6,3*
Mesh->
el_type);
184 Epetra_SerialDenseMatrix B_times_TM(3*
Mesh->
el_type,6);
185 Epetra_SerialDenseMatrix matrix_BG(9,3*
Mesh->
el_type);
186 Epetra_SerialDenseMatrix BG_times_BSPS(3*
Mesh->
el_type,9);
189 Epetra_SerialDenseVector fvol(3);
194 for (
unsigned int inode=0; inode<
Mesh->
el_type; ++inode){
202 for (
int iddl=0; iddl<3; ++iddl){
203 Re(3*inode+iddl) = 0.0;
204 fevol(3*inode+iddl) = 0.0;
205 Indexes[3*inode+iddl] = 3*node+iddl;
206 for (
unsigned int jnode=0; jnode<
Mesh->
el_type; ++jnode){
207 for (
int jddl=0; jddl<3; ++jddl){
208 Ke(3*inode+iddl,3*jnode+jddl) = 0.0;
213 xg.Multiply(
'N',
'N',1.0,matrix_X,
Mesh->
N_cells,0.0);
214 for (
unsigned int gp=0; gp<n_gauss_points; ++gp){
216 fvol =
get_forcing(xg(0,gp),xg(1,gp),xg(2,gp),e_lid,gp);
217 for (
unsigned int inode=0; inode<
Mesh->
el_type; ++inode){
218 dx_shape_functions(inode,0) =
Mesh->
DX_N_cells(gp+n_gauss_points*inode,e_lid);
219 dx_shape_functions(inode,1) =
Mesh->
DY_N_cells(gp+n_gauss_points*inode,e_lid);
220 dx_shape_functions(inode,2) =
Mesh->
DZ_N_cells(gp+n_gauss_points*inode,e_lid);
221 for (
unsigned int iddl=0; iddl<3; ++iddl){
226 error = deformation_gradient.Multiply(
'N',
'N',1.0,matrix_x,dx_shape_functions,0.0);
232 for (
unsigned int i=0;
i<3; ++
i){
233 block_scd_piola_stress(3*
i+0,3*
i+0) = scd_piola_stress(0);
234 block_scd_piola_stress(3*
i+0,3*
i+1) = scd_piola_stress(5);
235 block_scd_piola_stress(3*
i+0,3*
i+2) = scd_piola_stress(4);
236 block_scd_piola_stress(3*
i+1,3*
i+0) = scd_piola_stress(5);
237 block_scd_piola_stress(3*
i+1,3*
i+1) = scd_piola_stress(1);
238 block_scd_piola_stress(3*
i+1,3*
i+2) = scd_piola_stress(3);
239 block_scd_piola_stress(3*
i+2,3*
i+0) = scd_piola_stress(4);
240 block_scd_piola_stress(3*
i+2,3*
i+1) = scd_piola_stress(3);
241 block_scd_piola_stress(3*
i+2,3*
i+2) = scd_piola_stress(2);
244 error = Re.Multiply(
'T',
'N',-gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,scd_piola_stress,1.0);
246 error = B_times_TM.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_B,tangent_matrix,0.0);
247 error = Ke.Multiply(
'N',
'N',1.0,B_times_TM,matrix_B,1.0);
249 error = BG_times_BSPS.Multiply(
'T',
'N',gauss_weight*
Mesh->
detJac_cells(e_lid,gp),matrix_BG,block_scd_piola_stress,0.0);
250 error = Ke.Multiply(
'N',
'N',1.0,BG_times_BSPS,matrix_BG,1.0);
254 error = F.SumIntoGlobalValues(1, &Indexes[
i], &Re(i));
255 error = F.SumIntoGlobalValues(1, &Indexes[i], &fevol(i));
257 error = K.SumIntoGlobalValues(1, &Indexes[i], 1, &Indexes[
j], &Ke(i,j));
274 Epetra_SerialDenseMatrix xg(3,n_gauss_points), matrix_X(3,
Mesh->
face_type);
276 Epetra_SerialDenseVector dead_pressure(3);
282 Indexes[3*inode+0] = 3*node+0;
283 Indexes[3*inode+1] = 3*node+1;
284 Indexes[3*inode+2] = 3*node+2;
288 for (
unsigned int iddl=0; iddl<3; ++iddl){
289 force(3*inode+iddl) = 0.0;
292 xg.Multiply(
'N',
'T',1.0,matrix_X,
Mesh->
N_faces,0.0);
293 for (
unsigned int gp=0; gp<n_gauss_points; ++gp){
297 for (
unsigned int iddl=0; iddl<3; ++iddl){
303 for (
unsigned int iddl=0; iddl<3; ++iddl){
304 F.SumIntoGlobalValues(1, &Indexes[3*inode+iddl], &force(3*inode+iddl));
void assembleMixedDirichletNeumann_homogeneousForcing(Epetra_Vector &x, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
std::vector< int > local_faces
Epetra_SerialDenseVector DZ_N_cells
std::vector< double > nodes_coord
virtual void get_constitutive_tensors(Epetra_SerialDenseMatrix &deformation_gradient, Epetra_SerialDenseVector &piola_stress, Epetra_SerialDenseMatrix &tangent_piola)=0
Epetra_SerialDenseVector N_cells
~compressibleHyperelasticity()
void stiffnessRhs_inhomogeneousForcing(Epetra_Vector &u, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
void assembleMixedDirichletNeumann_inhomogeneousForcing(Epetra_Vector &x, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
void rhs_NeumannBoundaryCondition(Epetra_FEVector &F)
Epetra_SerialDenseMatrix N_faces
unsigned int n_gauss_faces
Epetra_SerialDenseVector DX_N_cells
virtual Epetra_SerialDenseVector get_forcing(double &x1, double &x2, double &x3, unsigned int &e_lid, unsigned int &gp)=0
Epetra_SerialDenseVector detJac_cells
void assemblePureDirichlet_inhomogeneousForcing(Epetra_Vector &x, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
virtual Epetra_SerialDenseVector get_neumannBc(Epetra_SerialDenseMatrix &matrix_X, Epetra_SerialDenseMatrix &xg, unsigned int &gp)=0
std::vector< int > local_cells
void assemblePureDirichlet_homogeneousForcing(Epetra_Vector &x, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
std::vector< int > faces_nodes
Epetra_SerialDenseVector DY_N_cells
std::vector< int > cells_nodes
Epetra_Import * ImportToOverlapMap
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)
compressibleHyperelasticity()
void stiffnessRhs_homogeneousForcing(Epetra_Vector &u, Epetra_FECrsMatrix &K, Epetra_FEVector &F)
virtual void get_material_parameters(unsigned int &e_lid, unsigned int &gp)=0
Epetra_SerialDenseVector gauss_weight_cells