v0.16.0
Loading...
Searching...
No Matches
NonLinearElasticElement.hpp
Go to the documentation of this file.
1/** \file NonLinearElasticElement.hpp
2 * \ingroup nonlinear_elastic_elem
3 * \brief Operators and data structures for non-linear elastic analysis
4 *
5 * Implementation of nonlinear elastic element.
6 */
7
8
9
10#ifndef __NONLINEAR_ELASTIC_HPP
11#define __NONLINEAR_ELASTIC_HPP
12
13#ifndef WITH_ADOL_C
14#error "MoFEM need to be compiled with ADOL-C"
15#endif
16
17/** \brief structure grouping operators and data used for calculation of
18 * nonlinear elastic element \ingroup nonlinear_elastic_elem
19 *
20 * In order to assemble matrices and right hand vectors, the loops over
21 * elements, entities over that elements and finally loop over integration
22 * points are executed.
23 *
24 * Following implementation separate those three categories of loops and to each
25 * loop attach operator.
26 *
27 */
29
30 /// \brief definition of volume element
32
33 Mat A;
34 Vec F;
35
37
39 virtual ~MyVolumeFE() = default;
40
41 /** \brief it is used to calculate nb. of Gauss integration points
42 *
43 * for more details pleas look
44 * Reference:
45 *
46 * Albert Nijenhuis, Herbert Wilf,
47 * Combinatorial Algorithms for Computers and Calculators,
48 * Second Edition,
49 * Academic Press, 1978,
50 * ISBN: 0-12-519260-6,
51 * LC: QA164.N54.
52 *
53 * More details about algorithm
54 * http://people.sc.fsu.edu/~jburkardt/cpp_src/gm_rule/gm_rule.html
55 **/
56 int getRule(int order);
57
58 SmartPetscObj<Vec> V;
59 double eNergy;
60
61 MoFEMErrorCode preProcess();
62 MoFEMErrorCode postProcess();
63 };
64
65 MyVolumeFE feRhs; ///< calculate right hand side for tetrahedral elements
66 MyVolumeFE &getLoopFeRhs() { return feRhs; } ///< get rhs volume element
67 MyVolumeFE feLhs; //< calculate left hand side for tetrahedral elements
68 MyVolumeFE &getLoopFeLhs() { return feLhs; } ///< get lhs volume element
69
70 MyVolumeFE feEnergy; ///< calculate elastic energy
71 MyVolumeFE &getLoopFeEnergy() { return feEnergy; } ///< get energy fe
72
74 short int tAg;
75
76 NonlinearElasticElement(MoFEM::Interface &m_field, short int tag);
77 virtual ~NonlinearElasticElement() = default;
78
79 template <typename TYPE> struct FunctionsToCalculatePiolaKirchhoffI;
80
81 /** \brief data for calculation het conductivity and heat capacity elements
82 * \ingroup nonlinear_elastic_elem
83 */
84 struct BlockData {
85 int iD;
86 double E;
87 double PoissonRatio;
88 // Eberlein Fibres stiffness properties
89 double k1, k2;
90 Range tEts; ///< constrains elements in block set
91 boost::shared_ptr<FunctionsToCalculatePiolaKirchhoffI<adouble>>
93 boost::shared_ptr<FunctionsToCalculatePiolaKirchhoffI<double>>
97 };
98
99 std::map<int, BlockData>
100 setOfBlocks; ///< maps block set id with appropriate BlockData
101
102 /** \brief common data used by volume elements
103 * \ingroup nonlinear_elastic_elem
104 */
105 struct CommonData {
106
107 std::map<std::string, std::vector<VectorDouble>> dataAtGaussPts;
108 std::map<std::string, std::vector<MatrixDouble>> gradAtGaussPts;
111 std::vector<MatrixDouble3by3> sTress;
112 std::vector<MatrixDouble>
113 jacStress; ///< this is simply material tangent operator
114
115 // This part can be used to calculate stress directly from potential
116
117 std::vector<double> eNergy;
118 std::vector<VectorDouble> jacEnergy;
119 std::vector<VectorDouble> hessianEnergy;
120 };
122
126
127 /** \brief Implementation of elastic (non-linear) St. Kirchhoff equation
128 * \ingroup nonlinear_elastic_elem
129 */
130 template <typename TYPE> struct FunctionsToCalculatePiolaKirchhoffI {
131
135
143
145
146 double lambda, mu;
147 MatrixBoundedArray<TYPE, 9> F, C, E, S, invF, P, sIGma, h, H, invH,
151
152 TYPE J, eNergy, detH, detF;
153
154 int gG; ///< Gauss point number
155 CommonData *commonDataPtr; ///< common data shared between entities (f.e.
156 ///< field values at Gauss pts.)
158 *opPtr; ///< pointer to finite element tetrahedral operator
159
162 t_C(i, j) = t_F(k, i) * t_F(k, j);
164 }
165
166 MoFEMErrorCode calculateE_GreenStrain() {
168 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
169 t_E(i, j) = 0.5 * (t_C(i, j) - t_kd(i, j));
171 }
172
173 // St. Venant–Kirchhoff Material
176 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
177 t_S(i, j) = (2 * mu) * t_E(i, j) + (lambda * t_E(k, k)) * t_kd(i, j);
179 }
180
181 /** \brief Function overload to implement user material
182 *
183
184 * Calculation of Piola Kirchhoff I is implemented by user. Tangent matrix
185 * user implemented physical equation is calculated using automatic
186 * differentiation.
187
188 * \f$\mathbf{S} =
189 \lambda\textrm{tr}[\mathbf{E}]\mathbf{I}+2\mu\mathbf{E}\f$
190
191 * Notes: <br>
192 * Number of actual Gauss point is accessed from variable gG. <br>
193 * Access to operator data structures is available by variable opPtr. <br>
194 * Access to common data is by commonDataPtr. <br>
195
196 * \param block_data used to give access to material parameters
197 * \param fe_ptr pointer to element data structures
198
199 For details look to: <br>
200 NONLINEAR CONTINUUM MECHANICS FOR FINITE ELEMENT ANALYSIS, Javier Bonet,
201 Richard D. Wood
202
203 */
204 virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(
205 const BlockData block_data,
206 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
208 lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
209 mu = MU(block_data.E, block_data.PoissonRatio);
213 t_P(i, j) = t_F(i, k) * t_S(k, j);
215 }
216
217 /** \brief Function overload to implement user material
218 *
219
220 * Calculation of Piola Kirchhoff I is implemented by user. Tangent matrix
221 * user implemented physical equation is calculated using automatic
222 * differentiation.
223
224 * \f$\mathbf{S} =
225 \lambda\textrm{tr}[\mathbf{E}]\mathbf{I}+2\mu\mathbf{E}\f$
226
227 * Notes: <br>
228 * Number of actual Gauss point is accessed from variable gG. <br>
229 * Access to operator data structures is available by variable opPtr. <br>
230 * Access to common data is by commonDataPtr. <br>
231
232 * \param block_data used to give access to material parameters
233 * \param fe_ptr pointer to element data structures
234
235 For details look to: <br>
236 NONLINEAR CONTINUUM MECHANICS FOR FINITE ELEMENT ANALYSIS, Javier Bonet,
237 Richard D. Wood
238
239 */
240 virtual MoFEMErrorCode calculateCauchyStress(
241 const BlockData block_data,
242 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
244 sigmaCauchy.resize(3, 3);
245 t_sigmaCauchy(i, j) = t_P(i, k) * t_F(j, k);
246 t_sigmaCauchy(i, j) /= determinantTensor3by3(t_F);
248 }
249
250 /**
251 * \brief add additional active variables
252 *
253 * \note This member function if used should be implement by template member
254 * function Specialization, different implementation needed for TYPE=double
255 * or TYPE=adouble
256 *
257 * More complex physical models depend on gradient of defamation and some
258 * additional variables. For example can depend on temperature. This
259 * function adds additional independent variables to the model.
260 *
261 * @param nb_active_variables number of active variables
262 * @return error code
263 */
264 virtual MoFEMErrorCode setUserActiveVariables(int &nb_active_variables) {
267 }
268
269 /**
270 * \brief Add additional independent variables
271 * More complex physical models depend on gradient of defamation and some
272 * additional variables. For example can depend on temperature. This
273 * function adds additional independent variables to the model.
274 *
275 * /note First 9 elements are reserved for gradient of deformation.
276 * @param activeVariables vector of deepened variables, values after index
277 * 9 should be add.
278 *
279 * @return error code
280 */
281 virtual MoFEMErrorCode
282 setUserActiveVariables(VectorDouble &activeVariables) {
285 }
286
287 /** \brief Calculate elastic energy density
288 *
289 * \f[\Psi =
290 * \frac{1}{2}\lambda(\textrm{tr}[\mathbf{E}])^2+\mu\mathbf{E}:\mathbf{E}\f]
291 */
292 virtual MoFEMErrorCode calculateElasticEnergy(
293 const BlockData block_data,
294 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
296 lambda = LAMBDA(block_data.E, block_data.PoissonRatio);
297 mu = MU(block_data.E, block_data.PoissonRatio);
300 TYPE trace = 0;
301 eNergy = 0;
302 for (int ii = 0; ii < 3; ii++) {
303 trace += E(ii, ii);
304 for (int jj = 0; jj < 3; jj++) {
305 TYPE e = E(ii, jj);
306 eNergy += mu * e * e;
307 }
308 }
309 eNergy += 0.5 * lambda * trace * trace;
311 }
312
313 /** \brief Calculate Eshelby stress
314 */
315 virtual MoFEMErrorCode calculatesIGma_EshelbyStress(
316 const BlockData block_data,
317 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
319 CHKERR calculateP_PiolaKirchhoffI(block_data, fe_ptr);
320 CHKERR calculateElasticEnergy(block_data, fe_ptr);
321 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
322 t_sIGma(i, j) = t_kd(i, j) * eNergy - t_F(k, i) * t_P(k, j);
324 }
325
326 /** \brief Do operations when pre-process
327 */
328 virtual MoFEMErrorCode getDataOnPostProcessor(
329 std::map<std::string, std::vector<VectorDouble>> &field_map,
330 std::map<std::string, std::vector<MatrixDouble>> &grad_map) {
333 }
334
335 protected:
336 inline static auto resizeAndSet(MatrixBoundedArray<TYPE, 9> &m) {
337 m.resize(3, 3, false);
338 using Mat3 = MatrixBoundedArray<TYPE, 9>;
339 return GetFTensor2FromArrayImpl<3, 3, 0, Mat3>::get(m, 0, 0);
340 };
341 };
342
345
346 std::vector<VectorDouble> &valuesAtGaussPts;
347 std::vector<MatrixDouble> &gradientAtGaussPts;
348 const EntityType zeroAtType;
349
350 OpGetDataAtGaussPts(const std::string field_name,
351 std::vector<VectorDouble> &values_at_gauss_pts,
352 std::vector<MatrixDouble> &gradient_at_gauss_pts);
353
354 /** \brief operator calculating deformation gradient
355 *
356 * temperature gradient is calculated multiplying derivatives of shape
357 * functions by degrees of freedom
358 */
359 MoFEMErrorCode doWork(int side, EntityType type,
360 EntitiesFieldData::EntData &data);
361 };
362
364 OpGetCommonDataAtGaussPts(const std::string field_name,
365 CommonData &common_data);
366 };
367
368 /**
369 * \brief Operator performs automatic differentiation.
370 */
373
374 BlockData &dAta; ///< Structure keeping data about problem, like material
375 ///< parameters
376 CommonData &commonData; ///< Structure keeping data abut this particular
377 ///< element, e.g. gradient of deformation at
378 ///< integration points
379 int tAg; //,lastId; ///< ADOL-C tag used for recording operations
380 int adlocReturnValue; ///< return value from ADOL-C, if non-zero that is
381 ///< error.
382 bool jAcobian; ///< if true Jacobian is calculated
383 bool fUnction; ///< if true stress i calculated
384 bool aLe; ///< true if arbitrary Lagrangian-Eulerian formulation
385 bool fieldDisp; ///< true if field of displacements is given, usually
386 ///< spatial positions are given.
387
388 /**
389 \brief Construct operator to calculate Piola-Kirchhoff stress or its
390 derivatives over gradient deformation
391
392 \param field_name approximation field name of spatial positions or
393 displacements \param data reference to block data (what is Young modulus,
394 Poisson ratio or what elements are part of the block) \param tag adol-c
395 unique tag of the tape \param jacobian if true derivative of Piola Stress
396 is calculated otherwise just stress is calculated \param field_disp if
397 true approximation field keeps displacements not spatial positions
398
399 */
401 BlockData &data, CommonData &common_data,
402 int tag, bool jacobian, bool ale,
403 bool field_disp);
404
405 VectorDouble activeVariables;
407
408 std::vector<MatrixDouble> *ptrh;
409 std::vector<MatrixDouble> *ptrH;
410
414
415 /**
416 * \brief Calculate Paola-Kirchhoff I stress
417 * @return error code
418 */
419 virtual MoFEMErrorCode calculateStress(const int gg);
420
421 /**
422 * \brief Record ADOL-C tape
423 * @return error code
424 */
425 virtual MoFEMErrorCode recordTag(const int gg);
426
427 /**
428 * \brief Play ADOL-C tape
429 * @return error code
430 */
431 virtual MoFEMErrorCode playTag(const int gg);
432
433 /**
434 * \brief Cgeck if tape is recorded for given integration point
435 * @param gg integration point
436 * @return true if tag is recorded
437 */
438 virtual bool recordTagForIntegrationPoint(const int gg) {
439 // return true;
440 if (gg == 0)
441 return true;
442 return false;
443 }
444
445 /**
446 * \brief Calculate stress or jacobian at gauss points
447 *
448 * @param row_side
449 * @param row_type
450 * @param row_data
451 * @return error code
452 */
453 MoFEMErrorCode doWork(int row_side, EntityType row_type,
454 EntitiesFieldData::EntData &row_data);
455 };
456
457 /**
458 * \brief Calculate explicit derivative of free energy
459 */
462
465
466 int tAg; ///< tape tag
467 bool gRadient; ///< if set true gradient of energy is calculated
468 bool hEssian; ///< if set true hessian of energy is calculated
469 bool aLe; ///< true if arbitrary Lagrangian-Eulerian formulation
470 bool fieldDisp; ///< true if displacements instead spatial positions used
471
472 OpJacobianEnergy(const std::string field_name, ///< field name for spatial
473 ///< positions or
474 ///< displacements
475 BlockData &data, CommonData &common_data, int tag,
476 bool gradient, bool hessian, bool ale, bool field_disp);
477
478 VectorDouble activeVariables;
480
481 std::vector<MatrixDouble> *ptrh;
482 std::vector<MatrixDouble> *ptrH;
483
487
488 /**
489 * \brief Check if tape is recorded for given integration point
490 * @param gg integration point
491 * @return true if tag is recorded
492 */
493 virtual bool recordTagForIntegrationPoint(const int gg) {
494 if (gg == 0)
495 return true;
496 return false;
497 }
498
499 /**
500 * \brief Calculate Paola-Kirchhoff I stress
501 * @return error code
502 */
503 virtual MoFEMErrorCode calculateEnergy(const int gg);
504
505 /**
506 * \brief Record ADOL-C tape
507 * @return error code
508 */
509 virtual MoFEMErrorCode recordTag(const int gg);
510
511 /**
512 * \brief Play ADOL-C tape
513 * @return error code
514 */
515 virtual MoFEMErrorCode playTag(const int gg);
516
517 MoFEMErrorCode doWork(int row_side, EntityType row_type,
518 EntitiesFieldData::EntData &row_data);
519 };
520
523
527 bool aLe;
528
529 ublas::vector<int> iNdices;
530 OpRhsPiolaKirchhoff(const std::string field_name, BlockData &data,
531 CommonData &common_data);
532
533 VectorDouble nf;
534 MoFEMErrorCode doWork(int row_side, EntityType row_type,
535 EntitiesFieldData::EntData &row_data);
536
537 virtual MoFEMErrorCode aSemble(int row_side, EntityType row_type,
538 EntitiesFieldData::EntData &row_data);
539 };
540
541 struct OpEnergy
543
546 SmartPetscObj<Vec> ghostVec;
548
549 OpEnergy(const std::string field_name, BlockData &data,
550 CommonData &common_data, SmartPetscObj<Vec> ghost_vec,
551 bool field_disp);
552
553 MoFEMErrorCode doWork(int row_side, EntityType row_type,
554 EntitiesFieldData::EntData &row_data);
555 };
556
559
562 int tAg;
563 bool aLe;
564
565 ublas::vector<int> rowIndices;
566 ublas::vector<int> colIndices;
567
568 OpLhsPiolaKirchhoff_dx(const std::string vel_field,
569 const std::string field_name, BlockData &data,
570 CommonData &common_data);
571
572 MatrixDouble k, trans_k, jac, F;
573
574 /**
575 \brief Directive of Piola Kirchhoff stress over spatial DOFs
576
577 This project derivative \f$\frac{\partial P}{\partial F}\f$, that is
578 \f[
579 \frac{\partial P}{\partial x_\textrm{DOF}} = \frac{\partial P}{\partial
580 F}\frac{\partial F}{\partial x_\textrm{DOF}}, \f] where second therm
581 \f$\frac{\partial F}{\partial x_\textrm{DOF}}\f$ is derivative of shape
582 function
583
584 */
585 virtual MoFEMErrorCode getJac(EntitiesFieldData::EntData &col_data,
586 int gg);
587
588 virtual MoFEMErrorCode aSemble(int row_side, int col_side,
589 EntityType row_type, EntityType col_type,
590 EntitiesFieldData::EntData &row_data,
591 EntitiesFieldData::EntData &col_data);
592
593 MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type,
594 EntityType col_type,
595 EntitiesFieldData::EntData &row_data,
596 EntitiesFieldData::EntData &col_data);
597 };
598
600
601 OpLhsPiolaKirchhoff_dX(const std::string vel_field,
602 const std::string field_name, BlockData &data,
603 CommonData &common_data);
604
605 /// \brief Derivative of Piola Kirchhoff stress over material DOFs
606 MoFEMErrorCode getJac(EntitiesFieldData::EntData &col_data, int gg);
607
608 MoFEMErrorCode aSemble(int row_side, int col_side, EntityType row_type,
609 EntityType col_type,
610 EntitiesFieldData::EntData &row_data,
611 EntitiesFieldData::EntData &col_data);
612 };
613
615
616 OpJacobianEshelbyStress(const std::string field_name, BlockData &data,
617 CommonData &common_data, int tag, bool jacobian,
618 bool ale);
619
620 MoFEMErrorCode calculateStress(const int gg);
621 };
622
624
625 OpRhsEshelbyStress(const std::string field_name, BlockData &data,
626 CommonData &common_data);
627 };
628
629 /**
630 * \deprecated name with spelling mistake
631 */
633
635
636 OpLhsEshelby_dx(const std::string vel_field, const std::string field_name,
637 BlockData &data, CommonData &common_data);
638
639 MoFEMErrorCode getJac(EntitiesFieldData::EntData &col_data, int gg);
640 };
641
643
644 OpLhsEshelby_dX(const std::string vel_field, const std::string field_name,
645 BlockData &data, CommonData &common_data);
646
647 MoFEMErrorCode getJac(EntitiesFieldData::EntData &col_data, int gg);
648 };
649
650 MoFEMErrorCode
652 materialDoublePtr,
654 materialAdoublePtr);
655
656 MoFEMErrorCode addElement(
657 const std::string element_name,
658 const std::string spatial_position_field_name,
659 const std::string material_position_field_name = "MESH_NODE_POSITIONS",
660 const bool ale = false);
661
662 /** \brief Set operators to calculate left hand tangent matrix and right hand
663 * residual
664 *
665 * \param fun class needed to calculate Piola Kirchhoff I Stress tensor
666 * \param spatial_position_field_name name of approximation field
667 * \param material_position_field_name name of field to define geometry
668 * \param ale true if arbitrary Lagrangian Eulerian formulation
669 * \param field_disp true if approximation field represents displacements
670 * otherwise it is field of spatial positions
671 */
672 MoFEMErrorCode setOperators(
673 const std::string spatial_position_field_name,
674 const std::string material_position_field_name = "MESH_NODE_POSITIONS",
675 const bool ale = false, const bool field_disp = false);
676};
677
678#endif //__NONLINEAR_ELASTIC_HPP
679
680/**
681 * \defgroup nonlinear_elastic_elem NonLinear Elastic Element
682 * \ingroup user_modules
683 * \defgroup user_modules User modules
684 **/
std::string type
Kronecker Delta class.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define DEPRECATED
Definition definitions.h:17
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
constexpr int order
double trace(FTensor::Tensor2< T, 2, 2 > &t_stress)
#define MU(E, NU)
Definition fem_tools.h:23
#define LAMBDA(E, NU)
Definition fem_tools.h:22
constexpr auto t_kd
constexpr auto field_name
FTensor::Index< 'm', 3 > m
Deprecated interface functions.
FTensor::Tensor2< double *, 3, 3 > & getJac()
get element Jacobian
data for calculation heat conductivity and heat capacity elements
boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< adouble > > materialAdoublePtr
boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< double > > materialDoublePtr
Range tEts
constrains elements in block set
common data used by volume elements
std::vector< MatrixDouble > jacStress
this is simply material tangent operator
std::map< std::string, std::vector< VectorDouble > > dataAtGaussPts
std::map< std::string, std::vector< MatrixDouble > > gradAtGaussPts
Implementation of elastic (non-linear) St. Kirchhoff equation.
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_h
virtual MoFEMErrorCode calculatesIGma_EshelbyStress(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Calculate Eshelby stress.
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invH
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_C
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Function overload to implement user material.
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_sIGma
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_F
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_sigmaCauchy
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_P
virtual MoFEMErrorCode calculateElasticEnergy(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Calculate elastic energy density.
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_H
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_E
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invF
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_S
virtual MoFEMErrorCode setUserActiveVariables(int &nb_active_variables)
add additional active variables
virtual MoFEMErrorCode getDataOnPostProcessor(std::map< std::string, std::vector< VectorDouble > > &field_map, std::map< std::string, std::vector< MatrixDouble > > &grad_map)
Do operations when pre-process.
MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator * opPtr
pointer to finite element tetrahedral operator
virtual MoFEMErrorCode calculateCauchyStress(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Function overload to implement user material.
virtual MoFEMErrorCode setUserActiveVariables(VectorDouble &activeVariables)
Add additional independent variables More complex physical models depend on gradient of defamation an...
MoFEMErrorCode preProcess()
Pre-processing function executed at loop initialization.
MoFEMErrorCode postProcess()
Post-processing function executed at loop completion.
int getRule(int order)
it is used to calculate nb. of Gauss integration points
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
operator calculating deformation gradient
Calculate explicit derivative of free energy.
bool gRadient
if set true gradient of energy is calculated
bool fieldDisp
true if displacements instead spatial positions used
virtual bool recordTagForIntegrationPoint(const int gg)
Check if tape is recorded for given integration point.
virtual MoFEMErrorCode playTag(const int gg)
Play ADOL-C tape.
bool hEssian
if set true hessian of energy is calculated
virtual MoFEMErrorCode recordTag(const int gg)
Record ADOL-C tape.
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
virtual MoFEMErrorCode calculateEnergy(const int gg)
Calculate Paola-Kirchhoff I stress.
bool aLe
true if arbitrary Lagrangian-Eulerian formulation
MoFEMErrorCode calculateStress(const int gg)
Calculate Paola-Kirchhoff I stress.
virtual MoFEMErrorCode recordTag(const int gg)
Record ADOL-C tape.
bool aLe
true if arbitrary Lagrangian-Eulerian formulation
virtual MoFEMErrorCode playTag(const int gg)
Play ADOL-C tape.
virtual bool recordTagForIntegrationPoint(const int gg)
Cgeck if tape is recorded for given integration point.
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
Calculate stress or jacobian at gauss points.
virtual MoFEMErrorCode calculateStress(const int gg)
Calculate Paola-Kirchhoff I stress.
MoFEMErrorCode aSemble(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
virtual MoFEMErrorCode aSemble(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
virtual MoFEMErrorCode aSemble(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
structure grouping operators and data used for calculation of nonlinear elastic element
MyVolumeFE & getLoopFeLhs()
get lhs volume element
MyVolumeFE feRhs
calculate right hand side for tetrahedral elements
MoFEMErrorCode addElement(const std::string element_name, const std::string spatial_position_field_name, const std::string material_position_field_name="MESH_NODE_POSITIONS", const bool ale=false)
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
DEPRECATED typedef OpRhsEshelbyStress OpRhsEshelbyStrees
MoFEMErrorCode setBlocks(boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< double > > materialDoublePtr, boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< adouble > > materialAdoublePtr)
MyVolumeFE & getLoopFeRhs()
get rhs volume element
MyVolumeFE & getLoopFeEnergy()
get energy fe
virtual ~NonlinearElasticElement()=default
MyVolumeFE feEnergy
calculate elastic energy
MoFEMErrorCode setOperators(const std::string spatial_position_field_name, const std::string material_position_field_name="MESH_NODE_POSITIONS", const bool ale=false, const bool field_disp=false)
Set operators to calculate left hand tangent matrix and right hand residual.