openCARP
Doxygen code documentation for the open cardiac electrophysiology simulator openCARP
mechanic_integrators.cc
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // openCARP is an open cardiac electrophysiology simulator.
3 //
4 // Copyright (C) 2020 openCARP project
5 //
6 // This program is licensed under the openCARP Academic Public License (APL)
7 // v1.0: You can use and redistribute it and/or modify it in non-commercial
8 // academic environments under the terms of APL as published by the openCARP
9 // project v1.0, or (at your option) any later version. Commercial use requires
10 // a commercial license (info@opencarp.org).
11 //
12 // This program is distributed without any warranty; see the openCARP APL for
13 // more details.
14 //
15 // You should have received a copy of the openCARP APL along with this program
16 // and can find it online: http://www.opencarp.org/license
17 // ----------------------------------------------------------------------------
18 
27 #include "mechanic_integrators.h"
28 #include <string.h>
29 
30 namespace opencarp {
31 
36 {
37  // for testing purposes we might want to select the integration order per element type,
38  // but in general we want second order integration for linear Ansatzfunctions
39 #if 0
40  switch(type) {
41  case SF::Tetra:
42  case SF::Tri:
43  case SF::Quad:
44  case SF::Hexa:
45  return 2;
46 
47  default:
48  case SF::Prism:
49  case SF::Pyramid:
50  return 1;
51  }
52 #else
53  return 2;
54 #endif
55 }
56 
57 
58 
59 
60 inline void print_points(SF::Point* pts, int npts)
61 {
62  for(int i=0; i<npts; i++)
63  printf(" ( %g %g %g ) \n", pts[i].x, pts[i].y, pts[i].z);
64 
65  printf("\n");
66 }
67 
79 inline void calc_deformation_gradient(const SF::element_view<mesh_int_t,mesh_real_t> & elem, int ipt, double * F, double * iF, double & detF, int index, double eps)
80 {
81  SF::elem_t type = elem.type();
82  mesh_int_t nnodes = elem.num_nodes();
83  int nint;
85  SF::Point updated_pts[EP_MAX_LPOINTS];
86  SF::Point fib = elem.fiber();
88  double w[EP_MAX_LPOINTS];
89  SF::dmat<double> shape;
90  SF::dmat<double> gshape;
91  double J[9];
92  double detJ;
93  const int int_order = get_preferred_int_order(type) - 1;
94 
95  SF::get_transformed_pts(elem, lpts, fib);
96  SF::get_transformed_upd_pts(elem, updated_pts, fib);
97  mesh_int_t ndof = nnodes;
98  shape.set_size(4, ndof);
99  gshape.set_size(4, ndof);
100 
101 // Change one variable with epsilon for the calculation of finite differences
102  if(index > -1)
103  {
104  int pid = index/3;
105  int direction = index%3;
106  if(direction == 0)
107  {
108  updated_pts[pid].x += eps;
109  }
110  else if(direction == 1)
111  {
112  updated_pts[pid].y += eps;
113  }
114  else if(direction == 2)
115  {
116  updated_pts[pid].z += eps;
117  }
118  else
119  {
120  log_msg(0, 0, 0, "Point Update doesn't work");
121  }
122  }
123 
124  elem.integration_points(int_order, ipts, w, nint);
125  SF::reference_shape(type, ipts[ipt], shape);
126  SF::jacobian_matrix(shape, nnodes, lpts, J);
127 
128  SF::invert_jacobian_matrix(type, J, detJ);
129 
130  SF::shape_deriv(J, shape, ndof, gshape);
131 
132  SF::jacobian_matrix(gshape, nnodes, updated_pts, F); //calculate the deformation gradient at the integration point
133 
134  if (type == SF::Tri || type == SF::Line || type == SF::Quad) {
135  F[8] = 1; //deformation gradient needs to be 3X3 and is Identity for no deformation
136  }
137  // copy deformation gradient for calculation of inverse
138  for(size_t k = 0; k < 9; k++){
139  iF[k] = F[k];
140  }
141 
142  SF::invert_3x3(iF, detF);
143 }
144 
145 
153 inline void apply_active_tension(double * deformation_gradient, double * Piola_Kirchhoff_1_stress)
154 {
156  double time = tm.time + param_globals::dt; //Test
157 // double S_act_ff = 60.0 * time / param_globals::tend;
158  double S_act_ff;
159  switch (param_globals::Ta.type) {
160  case 0:
161  S_act_ff = param_globals::Ta.strength * time / param_globals::tend;
162  break;
163  case 1:
164  printf("Tanh model not yet implemented");
165  break;
166  case 2:
167  printf("double hill model not yet implemented");
168  break;
169  case 3:
170  printf("External active tension model input not yet implemented");
171  break;
172  default:
173  printf("Please choose an existing active tension model");
174  break;
175  }
176  double K_ff = 1.0;
177 
178  Piola_Kirchhoff_1_stress[0] += deformation_gradient[0] * S_act_ff * K_ff;
179  Piola_Kirchhoff_1_stress[1] += deformation_gradient[1] * S_act_ff * K_ff;
180  Piola_Kirchhoff_1_stress[2] += deformation_gradient[2] * S_act_ff * K_ff;
181 }
182 
183 
184 
193 {
194  mesh_int_t dpn_ele;
195  dpn(dpn_ele);
196  zero_buff(buff, SF_MAX_ELEM_NODES*dpn_ele);
197  const size_t eidx = elem.element_index();
198  SF::elem_t type = elem.type();
199  mesh_int_t nnodes = elem.num_nodes();
200  const int int_order = get_preferred_int_order(type) - 1;
201 
202  const int reg = material.regionIDs.size() ? material.regionIDs[eidx] : 0;
203  const RegionSpecs & reg_spec = material.regions[reg];
204 
205  assert(reg_spec.material->material_type == MechMat);
206  mechMaterial & mat = *static_cast<mechMaterial*>(reg_spec.material);
207  Basic_constitutive_model * constitutive_model;
208  constitutive_model = constitutive_model_setup(mat.mat_t, param_globals::mech_mat_region[reg].model_params);
209 
210  SF::Point fib = elem.fiber(), she = elem.sheet();
211  bool has_sheet = elem.has_sheet();
212  if (!has_sheet)
213  {
214  SF::Point helper_dir;
215  if(fib.x * fib.x < 0.9)
216  {
217  helper_dir = {1, 0, 0};
218  }
219  else
220  {
221  helper_dir = {0, 1, 0};
222  }
223  she = cross(fib, helper_dir);
224 
225  }
226  SF::Point nor = cross(fib, she);
227  normalize(fib);
228  normalize(she);
229  normalize(nor);
230  SF::get_transformed_pts(elem, lpts, fib); //get point coordinates in reference shape
231  #ifdef DEBUG_INT
232  print_points(lpts, nnodes);
233  #endif
234 
235 
236  int ndof = nnodes;
237  shape.set_size(4, ndof), gshape.set_size(4, ndof);
238 
239  int nint = 0;
240  elem.integration_points(int_order, ipts, w, nint);
241 
242  double vol = 0.0;
243  // Integration loop
244  for(int iidx=0; iidx < nint; iidx++)
245  {
246  double detJ;
247  double detF;
248  SF::reference_shape(type, ipts[iidx], shape);
249  SF::jacobian_matrix(shape, nnodes, lpts, J);
250  SF::invert_jacobian_matrix(type, J, detJ);
251  SF::shape_deriv(J, shape, ndof, gshape);
252 
253  calc_deformation_gradient(elem, iidx, F, iF, detF);
254 
255  // rotate deformation gradient into f, s, n coordinate system ///Write function to do that later
256  double QFQT[9], QiFQT[9]; //rotated deformation gradient and the inverse
257  QFQT[0] = fib.x * (fib.x * F[0] + fib.y * F[3] + fib.z * F[6]) + fib.y * (fib.x * F[1] + fib.y * F[4] + fib.z * F[7]) + fib.z * (fib.x * F[2] + fib.y * F[5] + fib.z * F[8]); //F_ff
258  QFQT[1] = she.x * (fib.x * F[0] + fib.y * F[3] + fib.z * F[6]) + she.y * (fib.x * F[1] + fib.y * F[4] + fib.z * F[7]) + she.z * (fib.x * F[2] + fib.y * F[5] + fib.z * F[8]); //F_sf
259  QFQT[2] = nor.x * (fib.x * F[0] + fib.y * F[3] + fib.z * F[6]) + nor.y * (fib.x * F[1] + fib.y * F[4] + fib.z * F[7]) + nor.z * (fib.x * F[2] + fib.y * F[5] + fib.z * F[8]); //F_nf
260  QFQT[3] = fib.x * (she.x * F[0] + she.y * F[3] + she.z * F[6]) + fib.y * (she.x * F[1] + she.y * F[4] + she.z * F[7]) + fib.z * (she.x * F[2] + she.y * F[5] + she.z * F[8]); //F_fs
261  QFQT[4] = she.x * (she.x * F[0] + she.y * F[3] + she.z * F[6]) + she.y * (she.x * F[1] + she.y * F[4] + she.z * F[7]) + she.z * (she.x * F[2] + she.y * F[5] + she.z * F[8]); //F_ss
262  QFQT[5] = nor.x * (she.x * F[0] + she.y * F[3] + she.z * F[6]) + nor.y * (she.x * F[1] + she.y * F[4] + she.z * F[7]) + nor.z * (she.x * F[2] + she.y * F[5] + she.z * F[8]); //F_ns
263  QFQT[6] = fib.x * (nor.x * F[0] + nor.y * F[3] + nor.z * F[6]) + fib.y * (nor.x * F[1] + nor.y * F[4] + nor.z * F[7]) + fib.z * (nor.x * F[2] + nor.y * F[5] + nor.z * F[8]); //F_fn
264  QFQT[7] = she.x * (nor.x * F[0] + nor.y * F[3] + nor.z * F[6]) + she.y * (nor.x * F[1] + nor.y * F[4] + nor.z * F[7]) + she.z * (nor.x * F[2] + nor.y * F[5] + nor.z * F[8]); //F_sn
265  QFQT[8] = nor.x * (nor.x * F[0] + nor.y * F[3] + nor.z * F[6]) + nor.y * (nor.x * F[1] + nor.y * F[4] + nor.z * F[7]) + nor.z * (nor.x * F[2] + nor.y * F[5] + nor.z * F[8]); //F_nn
266 
267  QiFQT[0] = fib.x * (fib.x * iF[0] + fib.y * iF[3] + fib.z * iF[6]) + fib.y * (fib.x * iF[1] + fib.y * iF[4] + fib.z * iF[7]) + fib.z * (fib.x * iF[2] + fib.y * iF[5] + fib.z * iF[8]); //iF_ff
268  QiFQT[1] = she.x * (fib.x * iF[0] + fib.y * iF[3] + fib.z * iF[6]) + she.y * (fib.x * iF[1] + fib.y * iF[4] + fib.z * iF[7]) + she.z * (fib.x * iF[2] + fib.y * iF[5] + fib.z * iF[8]); //iF_sf
269  QiFQT[2] = nor.x * (fib.x * iF[0] + fib.y * iF[3] + fib.z * iF[6]) + nor.y * (fib.x * iF[1] + fib.y * iF[4] + fib.z * iF[7]) + nor.z * (fib.x * iF[2] + fib.y * iF[5] + fib.z * iF[8]); //iF_nf
270  QiFQT[3] = fib.x * (she.x * iF[0] + she.y * iF[3] + she.z * iF[6]) + fib.y * (she.x * iF[1] + she.y * iF[4] + she.z * iF[7]) + fib.z * (she.x * iF[2] + she.y * iF[5] + she.z * iF[8]); //iF_fs
271  QiFQT[4] = she.x * (she.x * iF[0] + she.y * iF[3] + she.z * iF[6]) + she.y * (she.x * iF[1] + she.y * iF[4] + she.z * iF[7]) + she.z * (she.x * iF[2] + she.y * iF[5] + she.z * iF[8]); //iF_ss
272  QiFQT[5] = nor.x * (she.x * iF[0] + she.y * iF[3] + she.z * iF[6]) + nor.y * (she.x * iF[1] + she.y * iF[4] + she.z * iF[7]) + nor.z * (she.x * iF[2] + she.y * iF[5] + she.z * iF[8]); //iF_ns
273  QiFQT[6] = fib.x * (nor.x * iF[0] + nor.y * iF[3] + nor.z * iF[6]) + fib.y * (nor.x * iF[1] + nor.y * iF[4] + nor.z * iF[7]) + fib.z * (nor.x * iF[2] + nor.y * iF[5] + nor.z * iF[8]); //iF_fn
274  QiFQT[7] = she.x * (nor.x * iF[0] + nor.y * iF[3] + nor.z * iF[6]) + she.y * (nor.x * iF[1] + nor.y * iF[4] + nor.z * iF[7]) + she.z * (nor.x * iF[2] + nor.y * iF[5] + nor.z * iF[8]); //iF_sn
275  QiFQT[8] = nor.x * (nor.x * iF[0] + nor.y * iF[3] + nor.z * iF[6]) + nor.y * (nor.x * iF[1] + nor.y * iF[4] + nor.z * iF[7]) + nor.z * (nor.x * iF[2] + nor.y * iF[5] + nor.z * iF[8]); //iF_nn
276 
277  constitutive_model->calc_PK1_stress(QiFQT, QFQT, detF, S_PK1);
278 
279  if(param_globals::Ta.strength != 0)
280  {
281  apply_active_tension(QFQT, S_PK1);
282  }
283  // rotate S_PK1 stress back to x,y,z coordinate system
284  S_PK1_xyz[0] = fib.x * (fib.x * S_PK1[0] + she.x * S_PK1[3] + nor.x * S_PK1[6]) + she.x * (fib.x * S_PK1[1] + she.x * S_PK1[4] + nor.x * S_PK1[7]) + nor.x * (fib.x * S_PK1[2] + she.x * S_PK1[5] + nor.x * S_PK1[8]); //SPK1_xx
285  S_PK1_xyz[1] = fib.y * (fib.x * S_PK1[0] + she.x * S_PK1[3] + nor.x * S_PK1[6]) + she.y * (fib.x * S_PK1[1] + she.x * S_PK1[4] + nor.x * S_PK1[7]) + nor.y * (fib.x * S_PK1[2] + she.x * S_PK1[5] + nor.x * S_PK1[8]); //SPK1_yx
286  S_PK1_xyz[2] = fib.z * (fib.x * S_PK1[0] + she.x * S_PK1[3] + nor.x * S_PK1[6]) + she.z * (fib.x * S_PK1[1] + she.x * S_PK1[4] + nor.x * S_PK1[7]) + nor.z * (fib.x * S_PK1[2] + she.x * S_PK1[5] + nor.x * S_PK1[8]); //SPK1_zx
287  S_PK1_xyz[3] = fib.x * (fib.y * S_PK1[0] + she.y * S_PK1[3] + nor.y * S_PK1[6]) + she.x * (fib.y * S_PK1[1] + she.y * S_PK1[4] + nor.y * S_PK1[7]) + nor.x * (fib.y * S_PK1[2] + she.y * S_PK1[5] + nor.y * S_PK1[8]); //SPK1_yx
288  S_PK1_xyz[4] = fib.y * (fib.y * S_PK1[0] + she.y * S_PK1[3] + nor.y * S_PK1[6]) + she.y * (fib.y * S_PK1[1] + she.y * S_PK1[4] + nor.y * S_PK1[7]) + nor.y * (fib.y * S_PK1[2] + she.y * S_PK1[5] + nor.y * S_PK1[8]); //SPK1_yy
289  S_PK1_xyz[5] = fib.z * (fib.y * S_PK1[0] + she.y * S_PK1[3] + nor.y * S_PK1[6]) + she.z * (fib.y * S_PK1[1] + she.y * S_PK1[4] + nor.y * S_PK1[7]) + nor.z * (fib.y * S_PK1[2] + she.y * S_PK1[5] + nor.y * S_PK1[8]); //SPK1_yz
290  S_PK1_xyz[6] = fib.x * (fib.z * S_PK1[0] + she.z * S_PK1[3] + nor.z * S_PK1[6]) + she.x * (fib.z * S_PK1[1] + she.z * S_PK1[4] + nor.z * S_PK1[7]) + nor.x * (fib.z * S_PK1[2] + she.z * S_PK1[5] + nor.z * S_PK1[8]); //SPK1_zx
291  S_PK1_xyz[7] = fib.y * (fib.z * S_PK1[0] + she.z * S_PK1[3] + nor.z * S_PK1[6]) + she.y * (fib.z * S_PK1[1] + she.z * S_PK1[4] + nor.z * S_PK1[7]) + nor.y * (fib.z * S_PK1[2] + she.z * S_PK1[5] + nor.z * S_PK1[8]); //SPK1_zy
292  S_PK1_xyz[8] = fib.z * (fib.z * S_PK1[0] + she.z * S_PK1[3] + nor.z * S_PK1[6]) + she.z * (fib.z * S_PK1[1] + she.z * S_PK1[4] + nor.z * S_PK1[7]) + nor.z * (fib.z * S_PK1[2] + she.z * S_PK1[5] + nor.z * S_PK1[8]); //SPK1_zz
293 
294 
295  double dv = w[iidx] * detJ; //weighted integral
296  vol += dv;
297 
298  for(std::size_t a=0; a < nnodes; a++) //a: node (e.g. {0, 1, 2, 3} for linear tet)
299  {
300  //derivatives of shape functions
301  double sax = gshape[1][a], say = gshape[2][a], saz = gshape[3][a];
302  for(std::size_t k=0; k < dpn_ele; k++)
303  {
304  buff[dpn_ele*a + k] += dv * (S_PK1_xyz[k] * sax
305  + S_PK1_xyz[k + 3] * say
306  + S_PK1_xyz[k + 6] * saz);
307  }
308  }
309  }
310 }
311 
313 {
314  dpn = 3;
315 }
316 
325 {
326  mesh_int_t row_dpn, col_dpn;
327  dpn(row_dpn, col_dpn);
328  const size_t eidx = elem.element_index();
329  SF::elem_t type = elem.type();
330  mesh_int_t nnodes = elem.num_nodes();
331  const int int_order = get_preferred_int_order(type) - 1;
332 
333  const int reg = material.regionIDs.size() ? material.regionIDs[eidx] : 0;
334  const RegionSpecs & reg_spec = material.regions[reg];
335 
336  assert(reg_spec.material->material_type == MechMat);
337  mechMaterial & mat = *static_cast<mechMaterial*>(reg_spec.material);
338  Basic_constitutive_model * constitutive_model;
339  constitutive_model = constitutive_model_setup(mat.mat_t, param_globals::mech_mat_region[reg].model_params);
340  SF::Point fib = elem.fiber(), she = elem.sheet();
341 
342  bool is_bath = SF::inner_prod(fib, fib) < 0.01; // bath elements have no fiber direction
343  if (is_bath)
344  {
345  fib = {1.0, 0.0, 0.0};
346  }
347  bool has_sheet = elem.has_sheet(); // do we have a sheet direction
348  bool is_perp = abs(SF::inner_prod(fib, she)) < 0.01;
349  if (!has_sheet && is_perp)
350  {
351  SF::Point helper_dir;
352  if(fib.x * fib.x < 0.9)
353  {
354  helper_dir = {1.0, 0.0, 0.0};
355  }
356  else
357  {
358  helper_dir = {0.0, 1.0, 0.0};
359  }
360  she = cross(fib, helper_dir);
361  }
362  // normalize fiber, sheet and sheet normal
363  normalize(fib);
364  normalize(she);
365  SF::Point nor = cross(fib, she); //create sheet normal
366  normalize(nor);
367  double epsilon = 1e-9;
368 
369  SF::get_transformed_pts(elem, lpts, fib);
370 
371 #ifdef DEBUG_INT
372  print_points(lpts, nnodes);
373 #endif
374 
375  int ndof = nnodes;
376  shape.set_size(4, ndof), gshape.set_size(4, ndof);
377  buff.assign(row_dpn * ndof, col_dpn * ndof, 0.0);
378 
379  int nint = 0;
380  elem.integration_points(int_order, ipts, w, nint);
381 
382  double vol = 0.0;
383 
384  // Approach: central finite differences
385  for (std::size_t i = 0; i < nnodes * row_dpn; i++) {
386  vol = 0.0;
387  for (std::size_t iidx = 0; iidx < nint; iidx++) {
388  //p for + epsilon, n for - epsilon
389  double detJ;
390  double detF_p;
391  double detF_n;
392  double F_p[9];
393  double iF_p[9];
394  double F_n[9];
395  double iF_n[9];
396  double S_PK1_p[9];
397  double S_PK1_n[9];
398 
399  SF::reference_shape(type, ipts[iidx], shape);
400  SF::jacobian_matrix(shape, nnodes, lpts, J);
401  SF::invert_jacobian_matrix(type, J, detJ);
402  SF::shape_deriv(J, shape, ndof, gshape);
403 
404  calc_deformation_gradient(elem, iidx, F_p, iF_p, detF_p, i, epsilon);
405  calc_deformation_gradient(elem, iidx, F_n, iF_n, detF_n, i, -epsilon);
406 
407  double QFpQT[9], QiFpQT[9], QFnQT[9], QiFnQT[9]; //rotated deformation gradient and the inverse
408  QFpQT[0] = fib.x * (fib.x * F_p[0] + fib.y * F_p[3] + fib.z * F_p[6]) + fib.y * (fib.x * F_p[1] + fib.y * F_p[4] + fib.z * F_p[7]) + fib.z * (fib.x * F_p[2] + fib.y * F_p[5] + fib.z * F_p[8]); //Fp_ff
409  QFpQT[1] = she.x * (fib.x * F_p[0] + fib.y * F_p[3] + fib.z * F_p[6]) + she.y * (fib.x * F_p[1] + fib.y * F_p[4] + fib.z * F_p[7]) + she.z * (fib.x * F_p[2] + fib.y * F_p[5] + fib.z * F_p[8]); //Fp_sf
410  QFpQT[2] = nor.x * (fib.x * F_p[0] + fib.y * F_p[3] + fib.z * F_p[6]) + nor.y * (fib.x * F_p[1] + fib.y * F_p[4] + fib.z * F_p[7]) + nor.z * (fib.x * F_p[2] + fib.y * F_p[5] + fib.z * F_p[8]); //Fp_nf
411  QFpQT[3] = fib.x * (she.x * F_p[0] + she.y * F_p[3] + she.z * F_p[6]) + fib.y * (she.x * F_p[1] + she.y * F_p[4] + she.z * F_p[7]) + fib.z * (she.x * F_p[2] + she.y * F_p[5] + she.z * F_p[8]); //Fp_fs
412  QFpQT[4] = she.x * (she.x * F_p[0] + she.y * F_p[3] + she.z * F_p[6]) + she.y * (she.x * F_p[1] + she.y * F_p[4] + she.z * F_p[7]) + she.z * (she.x * F_p[2] + she.y * F_p[5] + she.z * F_p[8]); //Fp_ss
413  QFpQT[5] = nor.x * (she.x * F_p[0] + she.y * F_p[3] + she.z * F_p[6]) + nor.y * (she.x * F_p[1] + she.y * F_p[4] + she.z * F_p[7]) + nor.z * (she.x * F_p[2] + she.y * F_p[5] + she.z * F_p[8]); //Fp_ns
414  QFpQT[6] = fib.x * (nor.x * F_p[0] + nor.y * F_p[3] + nor.z * F_p[6]) + fib.y * (nor.x * F_p[1] + nor.y * F_p[4] + nor.z * F_p[7]) + fib.z * (nor.x * F_p[2] + nor.y * F_p[5] + nor.z * F_p[8]); //Fp_fn
415  QFpQT[7] = she.x * (nor.x * F_p[0] + nor.y * F_p[3] + nor.z * F_p[6]) + she.y * (nor.x * F_p[1] + nor.y * F_p[4] + nor.z * F_p[7]) + she.z * (nor.x * F_p[2] + nor.y * F_p[5] + nor.z * F_p[8]); //Fp_sn
416  QFpQT[8] = nor.x * (nor.x * F_p[0] + nor.y * F_p[3] + nor.z * F_p[6]) + nor.y * (nor.x * F_p[1] + nor.y * F_p[4] + nor.z * F_p[7]) + nor.z * (nor.x * F_p[2] + nor.y * F_p[5] + nor.z * F_p[8]); //Fp_nn
417 
418  QiFpQT[0] = fib.x * (fib.x * iF_p[0] + fib.y * iF_p[3] + fib.z * iF_p[6]) + fib.y * (fib.x * iF_p[1] + fib.y * iF_p[4] + fib.z * iF_p[7]) + fib.z * (fib.x * iF_p[2] + fib.y * iF_p[5] + fib.z * iF_p[8]); //iFp_ff
419  QiFpQT[1] = she.x * (fib.x * iF_p[0] + fib.y * iF_p[3] + fib.z * iF_p[6]) + she.y * (fib.x * iF_p[1] + fib.y * iF_p[4] + fib.z * iF_p[7]) + she.z * (fib.x * iF_p[2] + fib.y * iF_p[5] + fib.z * iF_p[8]); //iFp_sf
420  QiFpQT[2] = nor.x * (fib.x * iF_p[0] + fib.y * iF_p[3] + fib.z * iF_p[6]) + nor.y * (fib.x * iF_p[1] + fib.y * iF_p[4] + fib.z * iF_p[7]) + nor.z * (fib.x * iF_p[2] + fib.y * iF_p[5] + fib.z * iF_p[8]); //iFp_nf
421  QiFpQT[3] = fib.x * (she.x * iF_p[0] + she.y * iF_p[3] + she.z * iF_p[6]) + fib.y * (she.x * iF_p[1] + she.y * iF_p[4] + she.z * iF_p[7]) + fib.z * (she.x * iF_p[2] + she.y * iF_p[5] + she.z * iF_p[8]); //iFp_fs
422  QiFpQT[4] = she.x * (she.x * iF_p[0] + she.y * iF_p[3] + she.z * iF_p[6]) + she.y * (she.x * iF_p[1] + she.y * iF_p[4] + she.z * iF_p[7]) + she.z * (she.x * iF_p[2] + she.y * iF_p[5] + she.z * iF_p[8]); //iFp_ss
423  QiFpQT[5] = nor.x * (she.x * iF_p[0] + she.y * iF_p[3] + she.z * iF_p[6]) + nor.y * (she.x * iF_p[1] + she.y * iF_p[4] + she.z * iF_p[7]) + nor.z * (she.x * iF_p[2] + she.y * iF_p[5] + she.z * iF_p[8]); //iFp_ns
424  QiFpQT[6] = fib.x * (nor.x * iF_p[0] + nor.y * iF_p[3] + nor.z * iF_p[6]) + fib.y * (nor.x * iF_p[1] + nor.y * iF_p[4] + nor.z * iF_p[7]) + fib.z * (nor.x * iF_p[2] + nor.y * iF_p[5] + nor.z * iF_p[8]); //iFp_fn
425  QiFpQT[7] = she.x * (nor.x * iF_p[0] + nor.y * iF_p[3] + nor.z * iF_p[6]) + she.y * (nor.x * iF_p[1] + nor.y * iF_p[4] + nor.z * iF_p[7]) + she.z * (nor.x * iF_p[2] + nor.y * iF_p[5] + nor.z * iF_p[8]); //iFp_sn
426  QiFpQT[8] = nor.x * (nor.x * iF_p[0] + nor.y * iF_p[3] + nor.z * iF_p[6]) + nor.y * (nor.x * iF_p[1] + nor.y * iF_p[4] + nor.z * iF_p[7]) + nor.z * (nor.x * iF_p[2] + nor.y * iF_p[5] + nor.z * iF_p[8]); //iFp_nn
427 
428  QFnQT[0] = fib.x * (fib.x * F_n[0] + fib.y * F_n[3] + fib.z * F_n[6]) + fib.y * (fib.x * F_n[1] + fib.y * F_n[4] + fib.z * F_n[7]) + fib.z * (fib.x * F_n[2] + fib.y * F_n[5] + fib.z * F_n[8]); //Fn_ff
429  QFnQT[1] = she.x * (fib.x * F_n[0] + fib.y * F_n[3] + fib.z * F_n[6]) + she.y * (fib.x * F_n[1] + fib.y * F_n[4] + fib.z * F_n[7]) + she.z * (fib.x * F_n[2] + fib.y * F_n[5] + fib.z * F_n[8]); //Fn_sf
430  QFnQT[2] = nor.x * (fib.x * F_n[0] + fib.y * F_n[3] + fib.z * F_n[6]) + nor.y * (fib.x * F_n[1] + fib.y * F_n[4] + fib.z * F_n[7]) + nor.z * (fib.x * F_n[2] + fib.y * F_n[5] + fib.z * F_n[8]); //Fn_nf
431  QFnQT[3] = fib.x * (she.x * F_n[0] + she.y * F_n[3] + she.z * F_n[6]) + fib.y * (she.x * F_n[1] + she.y * F_n[4] + she.z * F_n[7]) + fib.z * (she.x * F_n[2] + she.y * F_n[5] + she.z * F_n[8]); //Fn_fs
432  QFnQT[4] = she.x * (she.x * F_n[0] + she.y * F_n[3] + she.z * F_n[6]) + she.y * (she.x * F_n[1] + she.y * F_n[4] + she.z * F_n[7]) + she.z * (she.x * F_n[2] + she.y * F_n[5] + she.z * F_n[8]); //Fn_ss
433  QFnQT[5] = nor.x * (she.x * F_n[0] + she.y * F_n[3] + she.z * F_n[6]) + nor.y * (she.x * F_n[1] + she.y * F_n[4] + she.z * F_n[7]) + nor.z * (she.x * F_n[2] + she.y * F_n[5] + she.z * F_n[8]); //Fn_ns
434  QFnQT[6] = fib.x * (nor.x * F_n[0] + nor.y * F_n[3] + nor.z * F_n[6]) + fib.y * (nor.x * F_n[1] + nor.y * F_n[4] + nor.z * F_n[7]) + fib.z * (nor.x * F_n[2] + nor.y * F_n[5] + nor.z * F_n[8]); //Fn_fn
435  QFnQT[7] = she.x * (nor.x * F_n[0] + nor.y * F_n[3] + nor.z * F_n[6]) + she.y * (nor.x * F_n[1] + nor.y * F_n[4] + nor.z * F_n[7]) + she.z * (nor.x * F_n[2] + nor.y * F_n[5] + nor.z * F_n[8]); //Fn_sn
436  QFnQT[8] = nor.x * (nor.x * F_n[0] + nor.y * F_n[3] + nor.z * F_n[6]) + nor.y * (nor.x * F_n[1] + nor.y * F_n[4] + nor.z * F_n[7]) + nor.z * (nor.x * F_n[2] + nor.y * F_n[5] + nor.z * F_n[8]); //Fn_nn
437 
438  QiFnQT[0] = fib.x * (fib.x * iF_n[0] + fib.y * iF_n[3] + fib.z * iF_n[6]) + fib.y * (fib.x * iF_n[1] + fib.y * iF_n[4] + fib.z * iF_n[7]) + fib.z * (fib.x * iF_n[2] + fib.y * iF_n[5] + fib.z * iF_n[8]); //iFn_ff
439  QiFnQT[1] = she.x * (fib.x * iF_n[0] + fib.y * iF_n[3] + fib.z * iF_n[6]) + she.y * (fib.x * iF_n[1] + fib.y * iF_n[4] + fib.z * iF_n[7]) + she.z * (fib.x * iF_n[2] + fib.y * iF_n[5] + fib.z * iF_n[8]); //iFn_sf
440  QiFnQT[2] = nor.x * (fib.x * iF_n[0] + fib.y * iF_n[3] + fib.z * iF_n[6]) + nor.y * (fib.x * iF_n[1] + fib.y * iF_n[4] + fib.z * iF_n[7]) + nor.z * (fib.x * iF_n[2] + fib.y * iF_n[5] + fib.z * iF_n[8]); //iFn_nf
441  QiFnQT[3] = fib.x * (she.x * iF_n[0] + she.y * iF_n[3] + she.z * iF_n[6]) + fib.y * (she.x * iF_n[1] + she.y * iF_n[4] + she.z * iF_n[7]) + fib.z * (she.x * iF_n[2] + she.y * iF_n[5] + she.z * iF_n[8]); //iFn_fs
442  QiFnQT[4] = she.x * (she.x * iF_n[0] + she.y * iF_n[3] + she.z * iF_n[6]) + she.y * (she.x * iF_n[1] + she.y * iF_n[4] + she.z * iF_n[7]) + she.z * (she.x * iF_n[2] + she.y * iF_n[5] + she.z * iF_n[8]); //iFn_ss
443  QiFnQT[5] = nor.x * (she.x * iF_n[0] + she.y * iF_n[3] + she.z * iF_n[6]) + nor.y * (she.x * iF_n[1] + she.y * iF_n[4] + she.z * iF_n[7]) + nor.z * (she.x * iF_n[2] + she.y * iF_n[5] + she.z * iF_n[8]); //iFn_ns
444  QiFnQT[6] = fib.x * (nor.x * iF_n[0] + nor.y * iF_n[3] + nor.z * iF_n[6]) + fib.y * (nor.x * iF_n[1] + nor.y * iF_n[4] + nor.z * iF_n[7]) + fib.z * (nor.x * iF_n[2] + nor.y * iF_n[5] + nor.z * iF_n[8]); //iFn_fn
445  QiFnQT[7] = she.x * (nor.x * iF_n[0] + nor.y * iF_n[3] + nor.z * iF_n[6]) + she.y * (nor.x * iF_n[1] + nor.y * iF_n[4] + nor.z * iF_n[7]) + she.z * (nor.x * iF_n[2] + nor.y * iF_n[5] + nor.z * iF_n[8]); //iFn_sn
446  QiFnQT[8] = nor.x * (nor.x * iF_n[0] + nor.y * iF_n[3] + nor.z * iF_n[6]) + nor.y * (nor.x * iF_n[1] + nor.y * iF_n[4] + nor.z * iF_n[7]) + nor.z * (nor.x * iF_n[2] + nor.y * iF_n[5] + nor.z * iF_n[8]); //iFn_nn
447 
448  constitutive_model->calc_PK1_stress(QiFpQT, QFpQT, detF_p, S_PK1_p);
449  constitutive_model->calc_PK1_stress(QiFnQT, QFnQT, detF_n, S_PK1_n);
450 
451  if(param_globals::Ta.strength != 0)
452  {
453  apply_active_tension(QFpQT, S_PK1_p);
454  apply_active_tension(QFnQT, S_PK1_n);
455  }
456  // rotate the stress tensors back to x,y,z_p
457  double S_PK1_p_xyz[9], S_PK1_n_xyz[9];
458  S_PK1_p_xyz[0] = fib.x * (fib.x * S_PK1_p[0] + she.x * S_PK1_p[3] + nor.x * S_PK1_p[6]) + she.x * (fib.x * S_PK1_p[1] + she.x * S_PK1_p[4] + nor.x * S_PK1_p[7]) + nor.x * (fib.x * S_PK1_p[2] + she.x * S_PK1_p[5] + nor.x * S_PK1_p[8]); //SPK1p_xx
459  S_PK1_p_xyz[1] = fib.y * (fib.x * S_PK1_p[0] + she.x * S_PK1_p[3] + nor.x * S_PK1_p[6]) + she.y * (fib.x * S_PK1_p[1] + she.x * S_PK1_p[4] + nor.x * S_PK1_p[7]) + nor.y * (fib.x * S_PK1_p[2] + she.x * S_PK1_p[5] + nor.x * S_PK1_p[8]); //SPK1p_yx
460  S_PK1_p_xyz[2] = fib.z * (fib.x * S_PK1_p[0] + she.x * S_PK1_p[3] + nor.x * S_PK1_p[6]) + she.z * (fib.x * S_PK1_p[1] + she.x * S_PK1_p[4] + nor.x * S_PK1_p[7]) + nor.z * (fib.x * S_PK1_p[2] + she.x * S_PK1_p[5] + nor.x * S_PK1_p[8]); //SPK1p_zx
461  S_PK1_p_xyz[3] = fib.x * (fib.y * S_PK1_p[0] + she.y * S_PK1_p[3] + nor.y * S_PK1_p[6]) + she.x * (fib.y * S_PK1_p[1] + she.y * S_PK1_p[4] + nor.y * S_PK1_p[7]) + nor.x * (fib.y * S_PK1_p[2] + she.y * S_PK1_p[5] + nor.y * S_PK1_p[8]); //SPK1p_yx
462  S_PK1_p_xyz[4] = fib.y * (fib.y * S_PK1_p[0] + she.y * S_PK1_p[3] + nor.y * S_PK1_p[6]) + she.y * (fib.y * S_PK1_p[1] + she.y * S_PK1_p[4] + nor.y * S_PK1_p[7]) + nor.y * (fib.y * S_PK1_p[2] + she.y * S_PK1_p[5] + nor.y * S_PK1_p[8]); //SPK1p_yy
463  S_PK1_p_xyz[5] = fib.z * (fib.y * S_PK1_p[0] + she.y * S_PK1_p[3] + nor.y * S_PK1_p[6]) + she.z * (fib.y * S_PK1_p[1] + she.y * S_PK1_p[4] + nor.y * S_PK1_p[7]) + nor.z * (fib.y * S_PK1_p[2] + she.y * S_PK1_p[5] + nor.y * S_PK1_p[8]); //SPK1p_yz
464  S_PK1_p_xyz[6] = fib.x * (fib.z * S_PK1_p[0] + she.z * S_PK1_p[3] + nor.z * S_PK1_p[6]) + she.x * (fib.z * S_PK1_p[1] + she.z * S_PK1_p[4] + nor.z * S_PK1_p[7]) + nor.x * (fib.z * S_PK1_p[2] + she.z * S_PK1_p[5] + nor.z * S_PK1_p[8]); //SPK1p_zx
465  S_PK1_p_xyz[7] = fib.y * (fib.z * S_PK1_p[0] + she.z * S_PK1_p[3] + nor.z * S_PK1_p[6]) + she.y * (fib.z * S_PK1_p[1] + she.z * S_PK1_p[4] + nor.z * S_PK1_p[7]) + nor.y * (fib.z * S_PK1_p[2] + she.z * S_PK1_p[5] + nor.z * S_PK1_p[8]); //SPK1p_zy
466  S_PK1_p_xyz[8] = fib.z * (fib.z * S_PK1_p[0] + she.z * S_PK1_p[3] + nor.z * S_PK1_p[6]) + she.z * (fib.z * S_PK1_p[1] + she.z * S_PK1_p[4] + nor.z * S_PK1_p[7]) + nor.z * (fib.z * S_PK1_p[2] + she.z * S_PK1_p[5] + nor.z * S_PK1_p[8]); //SPK1p_zz
467 
468  S_PK1_n_xyz[0] = fib.x * (fib.x * S_PK1_n[0] + she.x * S_PK1_n[3] + nor.x * S_PK1_n[6]) + she.x * (fib.x * S_PK1_n[1] + she.x * S_PK1_n[4] + nor.x * S_PK1_n[7]) + nor.x * (fib.x * S_PK1_n[2] + she.x * S_PK1_n[5] + nor.x * S_PK1_n[8]); //SPK1n_xx
469  S_PK1_n_xyz[1] = fib.y * (fib.x * S_PK1_n[0] + she.x * S_PK1_n[3] + nor.x * S_PK1_n[6]) + she.y * (fib.x * S_PK1_n[1] + she.x * S_PK1_n[4] + nor.x * S_PK1_n[7]) + nor.y * (fib.x * S_PK1_n[2] + she.x * S_PK1_n[5] + nor.x * S_PK1_n[8]); //SPK1n_yx
470  S_PK1_n_xyz[2] = fib.z * (fib.x * S_PK1_n[0] + she.x * S_PK1_n[3] + nor.x * S_PK1_n[6]) + she.z * (fib.x * S_PK1_n[1] + she.x * S_PK1_n[4] + nor.x * S_PK1_n[7]) + nor.z * (fib.x * S_PK1_n[2] + she.x * S_PK1_n[5] + nor.x * S_PK1_n[8]); //SPK1n_zx
471  S_PK1_n_xyz[3] = fib.x * (fib.y * S_PK1_n[0] + she.y * S_PK1_n[3] + nor.y * S_PK1_n[6]) + she.x * (fib.y * S_PK1_n[1] + she.y * S_PK1_n[4] + nor.y * S_PK1_n[7]) + nor.x * (fib.y * S_PK1_n[2] + she.y * S_PK1_n[5] + nor.y * S_PK1_n[8]); //SPK1n_yx
472  S_PK1_n_xyz[4] = fib.y * (fib.y * S_PK1_n[0] + she.y * S_PK1_n[3] + nor.y * S_PK1_n[6]) + she.y * (fib.y * S_PK1_n[1] + she.y * S_PK1_n[4] + nor.y * S_PK1_n[7]) + nor.y * (fib.y * S_PK1_n[2] + she.y * S_PK1_n[5] + nor.y * S_PK1_n[8]); //SPK1n_yy
473  S_PK1_n_xyz[5] = fib.z * (fib.y * S_PK1_n[0] + she.y * S_PK1_n[3] + nor.y * S_PK1_n[6]) + she.z * (fib.y * S_PK1_n[1] + she.y * S_PK1_n[4] + nor.y * S_PK1_n[7]) + nor.z * (fib.y * S_PK1_n[2] + she.y * S_PK1_n[5] + nor.y * S_PK1_n[8]); //SPK1n_yz
474  S_PK1_n_xyz[6] = fib.x * (fib.z * S_PK1_n[0] + she.z * S_PK1_n[3] + nor.z * S_PK1_n[6]) + she.x * (fib.z * S_PK1_n[1] + she.z * S_PK1_n[4] + nor.z * S_PK1_n[7]) + nor.x * (fib.z * S_PK1_n[2] + she.z * S_PK1_n[5] + nor.z * S_PK1_n[8]); //SPK1n_zx
475  S_PK1_n_xyz[7] = fib.y * (fib.z * S_PK1_n[0] + she.z * S_PK1_n[3] + nor.z * S_PK1_n[6]) + she.y * (fib.z * S_PK1_n[1] + she.z * S_PK1_n[4] + nor.z * S_PK1_n[7]) + nor.y * (fib.z * S_PK1_n[2] + she.z * S_PK1_n[5] + nor.z * S_PK1_n[8]); //SPK1n_zy
476  S_PK1_n_xyz[8] = fib.z * (fib.z * S_PK1_n[0] + she.z * S_PK1_n[3] + nor.z * S_PK1_n[6]) + she.z * (fib.z * S_PK1_n[1] + she.z * S_PK1_n[4] + nor.z * S_PK1_n[7]) + nor.z * (fib.z * S_PK1_n[2] + she.z * S_PK1_n[5] + nor.z * S_PK1_n[8]); //SPK1n_zz
477 
478 
479  double dv = w[iidx] * detJ; //weighted integral
480  vol += dv;
481 
482  for (std::size_t a = 0; a < nnodes; a++)
483  {
484  double sax = gshape[1][a], say = gshape[2][a], saz = gshape[3][a];
485  for(std::size_t k = 0; k < col_dpn; k++)
486  {
487  buff[i][3 * a + k] += dv/(2 * epsilon) * ((S_PK1_p_xyz[k] - S_PK1_n_xyz[k]) * sax
488  + (S_PK1_p_xyz[k + 3] - S_PK1_n_xyz[k + 3]) * say
489  + (S_PK1_p_xyz[k + 6] - S_PK1_n_xyz[k + 6]) * saz);
490  }
491  }
492  }
493  }
494 
495 #ifdef DEBUG_INT
496  printf("\n vol: %g \n\n", vol);
497  buff.disp("Element Matrix:");
498 #endif
499 }
500 
502 {
503  row_dpn = 3;
504  col_dpn = 3;
505 }
506 
508 {
509  SF::elem_t type = elem.type();
510  mesh_int_t nnodes = elem.num_nodes();
511  const int int_order = get_preferred_int_order(type);
512 
513  int ndof = nnodes;
514  shape.set_size(4, ndof);
515  buff.assign(ndof, ndof, 0.0);
516 
517  SF::Point fib = {1, 0, 0}; // this is a dummy fibre to satisfy get_transformed_pts()
518 
519  int nint;
520  elem.integration_points(int_order, ipts, w, nint);
521  SF::get_transformed_pts(elem, lpts, fib);
522 
523  // Integration loop
524  for(int iidx=0; iidx < nint; iidx++)
525  {
526  double detj;
527  // get shape function and its spatial derivatives
528  SF::reference_shape(type, ipts[iidx], shape);
529  SF::jacobian_matrix(shape, nnodes, lpts, J);
530  SF::invert_jacobian_matrix(type, J, detj);
531 
532  double dx = w[iidx] * detj;
533 
534  for (int k = 0; k < ndof; k++) {
535  double sk = shape[0][k];
536  for (int l = 0; l < ndof; l++) {
537  double sl = shape[0][l];
538  buff[k][l] += sk * sl * dx;
539  }
540  }
541  }
542 }
543 
545 {
546  row_dpn = 3;
547  col_dpn = 3;
548 }
549 
550 } // namespace opencarp
551 
int mesh_int_t
Definition: SF_container.h:46
#define SF_MAX_ELEM_NODES
max #nodes defining an element
Definition: SF_fem_utils.h:40
void assign(const dmat< S > &m)
copy a mtrix.
Definition: dense_mat.hpp:135
void set_size(const short irows, const short icols)
set the matrix dimensions
Definition: dense_mat.hpp:73
void disp(const char *name)
Definition: dense_mat.hpp:254
Comfort class. Provides getter functions to access the mesh member variables more comfortably.
Definition: SF_fem_utils.h:705
Point fiber() const
Get element fiber direction.
Definition: SF_fem_utils.h:874
void integration_points(const short order, Point *ip, double *w, int &nint) const
Definition: SF_fem_utils.h:937
elem_t type() const
Getter function for the element type.
Definition: SF_fem_utils.h:773
size_t element_index() const
Get currently selected element index.
Definition: SF_fem_utils.h:906
bool has_sheet() const
Check if a sheet direction is present.
Definition: SF_fem_utils.h:896
T num_nodes() const
Getter function for the number of nodes.
Definition: SF_fem_utils.h:763
Point sheet() const
Get element sheet direction.
Definition: SF_fem_utils.h:883
void zero_buff(double *buff, mesh_int_t nrows)
Definition: SF_fem_utils.h:988
size_t size() const
The current size of the vector.
Definition: SF_vector.h:104
void operator()(const SF::element_view< mesh_int_t, mesh_real_t > &elem, double *buff)
Calculate internal force vector for a given element at each node.
void dpn(mesh_int_t &dpn)
return (by reference) the row and column dimensions
void dpn(mesh_int_t &row_dpn, mesh_int_t &col_dpn)
ACHTUNG: HIER AENDERUNG VON MIR.
void operator()(const SF::element_view< mesh_int_t, mesh_real_t > &elem, SF::dmat< double > &buff)
compute the element matrix for a given element.
void operator()(const SF::element_view< mesh_int_t, mesh_real_t > &elem, SF::dmat< double > &buff)
Calculate mech stiffness matrix for a given element at each node.
void dpn(mesh_int_t &row_dpn, mesh_int_t &col_dpn)
ACHTUNG: HIER AENDERUNG VON MIR.
centralize time managment and output triggering
Definition: timer_utils.h:73
double time
current time
Definition: timer_utils.h:76
#define EP_MAX_LPOINTS
maximum supported number of points in a local element
#define EP_MAX_IPOINTS
maximum supported number of integration points
void get_transformed_pts(const element_view< T, S > &view, Point *loc_pts, Point &trsf_fibre)
void invert_3x3(S *ele, S &det)
Definition: dense_mat.hpp:452
void shape_deriv(const double *iJ, const dmat< double > &rshape, const int ndof, dmat< double > &shape)
Compute shape derivatives for an element, based on the shape derivatives of the associated reference ...
Definition: SF_fem_utils.h:674
double inner_prod(const Point &a, const Point &b)
Definition: SF_container.h:91
void jacobian_matrix(const dmat< double > &rshape, const int npts, const Point *pts, double *J)
Compute Jacobian matrix from the real element to the reference element.
Definition: SF_fem_utils.h:610
void get_transformed_upd_pts(const element_view< T, S > &view, Point *loc_pts, Point &trsf_fibre)
ACHTUNG: DAS WURDE VON MIR HINZUGEFÜGT.
elem_t
element type enum
Definition: SF_container.h:54
@ Line
Definition: SF_container.h:62
@ Tri
Definition: SF_container.h:61
@ Prism
Definition: SF_container.h:59
@ Pyramid
Definition: SF_container.h:58
@ Tetra
Definition: SF_container.h:55
@ Quad
Definition: SF_container.h:60
@ Hexa
Definition: SF_container.h:56
void reference_shape(const elem_t type, const Point ip, dmat< double > &rshape)
Compute shape function and its derivatives on a reference element.
Definition: SF_fem_utils.h:383
void invert_jacobian_matrix(const elem_t type, double *J, double &detJ)
Definition: SF_fem_utils.h:633
timer_manager * tm_manager
a manager for the various physics timers
Definition: main.cc:52
vec3< V > normalize(vec3< V > a)
Definition: vect.h:198
Basic_constitutive_model * constitutive_model_setup(mechMat_t type, double *parameter_list)
vec3< V > cross(const vec3< V > &a, const vec3< V > &b)
Definition: vect.h:144
void print_points(SF::Point *pts, int npts)
void log_msg(FILE_SPEC out, int level, unsigned char flag, const char *fmt,...)
Definition: basics.cc:72
int get_preferred_int_order(SF::elem_t &etype, int mat_type)
void apply_active_tension(double *deformation_gradient, double *Piola_Kirchhoff_1_stress)
Apply active tension.
void calc_deformation_gradient(const SF::element_view< mesh_int_t, mesh_real_t > &elem, int ipt, double *F, double *iF, double &detF, int index, double eps)
Calculate deformation gradient at a given integration point.
@ MechMat
Definition: fem_types.h:42
Point and vector struct.
Definition: SF_container.h:66
double y
Definition: SF_container.h:68
double z
Definition: SF_container.h:69
double x
Definition: SF_container.h:67
SF::vector< RegionSpecs > regions
array with region params
Definition: fem_types.h:160
SF::vector< int > regionIDs
elemental region IDs (multiple tags are grouped in one region)
Definition: fem_types.h:159
region based variations of arbitrary material parameters
Definition: fem_types.h:138
physMaterial * material
material parameter description
Definition: fem_types.h:143
mechMat_t mat_t
choose material model
Definition: fem_types.h:92
physMat_t material_type
ID of physics material.
Definition: fem_types.h:62