10#ifndef __NONLINEAR_ELASTIC_HPP
11#define __NONLINEAR_ELASTIC_HPP
14#error "MoFEM need to be compiled with ADOL-C"
91 boost::shared_ptr<FunctionsToCalculatePiolaKirchhoffI<adouble>>
93 boost::shared_ptr<FunctionsToCalculatePiolaKirchhoffI<double>>
99 std::map<int, BlockData>
112 std::vector<MatrixDouble>
147 MatrixBoundedArray<TYPE, 9>
F,
C,
E,
S,
invF,
P,
sIGma,
h,
H,
invH,
206 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
242 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
281 virtual MoFEMErrorCode
294 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
302 for (
int ii = 0; ii < 3; ii++) {
304 for (
int jj = 0; jj < 3; jj++) {
317 boost::shared_ptr<const NumeredEntFiniteElement> fe_ptr) {
329 std::map<std::string, std::vector<VectorDouble>> &field_map,
330 std::map<std::string, std::vector<MatrixDouble>> &grad_map) {
337 m.resize(3, 3,
false);
338 using Mat3 = MatrixBoundedArray<TYPE, 9>;
339 return GetFTensor2FromArrayImpl<3, 3, 0, Mat3>::get(
m, 0, 0);
351 std::vector<VectorDouble> &values_at_gauss_pts,
352 std::vector<MatrixDouble> &gradient_at_gauss_pts);
359 MoFEMErrorCode
doWork(
int side, EntityType
type,
360 EntitiesFieldData::EntData &data);
402 int tag,
bool jacobian,
bool ale,
408 std::vector<MatrixDouble> *
ptrh;
409 std::vector<MatrixDouble> *
ptrH;
425 virtual MoFEMErrorCode
recordTag(
const int gg);
431 virtual MoFEMErrorCode
playTag(
const int gg);
453 MoFEMErrorCode
doWork(
int row_side, EntityType row_type,
454 EntitiesFieldData::EntData &row_data);
476 bool gradient,
bool hessian,
bool ale,
bool field_disp);
481 std::vector<MatrixDouble> *
ptrh;
482 std::vector<MatrixDouble> *
ptrH;
509 virtual MoFEMErrorCode
recordTag(
const int gg);
515 virtual MoFEMErrorCode
playTag(
const int gg);
517 MoFEMErrorCode
doWork(
int row_side, EntityType row_type,
518 EntitiesFieldData::EntData &row_data);
534 MoFEMErrorCode
doWork(
int row_side, EntityType row_type,
535 EntitiesFieldData::EntData &row_data);
537 virtual MoFEMErrorCode
aSemble(
int row_side, EntityType row_type,
538 EntitiesFieldData::EntData &row_data);
550 CommonData &common_data, SmartPetscObj<Vec> ghost_vec,
553 MoFEMErrorCode
doWork(
int row_side, EntityType row_type,
554 EntitiesFieldData::EntData &row_data);
585 virtual MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
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);
593 MoFEMErrorCode
doWork(
int row_side,
int col_side, EntityType row_type,
595 EntitiesFieldData::EntData &row_data,
596 EntitiesFieldData::EntData &col_data);
606 MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
int gg);
608 MoFEMErrorCode
aSemble(
int row_side,
int col_side, EntityType row_type,
610 EntitiesFieldData::EntData &row_data,
611 EntitiesFieldData::EntData &col_data);
617 CommonData &common_data,
int tag,
bool jacobian,
639 MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
int gg);
647 MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
int gg);
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);
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);
#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 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 ...
double trace(FTensor::Tensor2< T, 2, 2 > &t_stress)
constexpr auto field_name
FTensor::Index< 'm', 3 > m
Deprecated interface functions.
FTensor::Tensor2< double *, 3, 3 > & getJac()
get element Jacobian
Volume finite element base.
data for calculation heat conductivity and heat capacity elements
Range forcesOnlyOnEntitiesRow
boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< adouble > > materialAdoublePtr
Range forcesOnlyOnEntitiesCol
boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< double > > materialDoublePtr
Range tEts
constrains elements in block set
common data used by volume elements
std::vector< VectorDouble > jacEnergy
std::vector< MatrixDouble > jacStress
this is simply material tangent operator
std::vector< double > eNergy
std::map< std::string, std::vector< VectorDouble > > dataAtGaussPts
std::vector< VectorDouble > hessianEnergy
std::vector< MatrixDouble3by3 > sTress
std::map< std::string, std::vector< MatrixDouble > > gradAtGaussPts
Implementation of elastic (non-linear) St. Kirchhoff equation.
MatrixBoundedArray< TYPE, 9 > invH
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_h
MatrixBoundedArray< TYPE, 9 > h
FunctionsToCalculatePiolaKirchhoffI()
virtual ~FunctionsToCalculatePiolaKirchhoffI()=default
MatrixBoundedArray< TYPE, 9 > E
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
int gG
Gauss point number.
virtual MoFEMErrorCode calculateP_PiolaKirchhoffI(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Function overload to implement user material.
MoFEMErrorCode calculateE_GreenStrain()
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
MatrixBoundedArray< TYPE, 9 > sigmaCauchy
CommonData * commonDataPtr
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_P
MoFEMErrorCode calculateS_PiolaKirchhoffII()
MatrixBoundedArray< TYPE, 9 > H
virtual MoFEMErrorCode calculateElasticEnergy(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Calculate elastic energy density.
MatrixBoundedArray< TYPE, 9 > C
MatrixBoundedArray< TYPE, 9 > sIGma
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_H
MoFEMErrorCode calculateC_CauchyDeformationTensor()
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_E
FTensor::Tensor2< FTensor::PackPtr< TYPE *, 0 >, 3, 3 > t_invF
FTensor::Index< 'i', 3 > i
MatrixBoundedArray< TYPE, 9 > S
FTensor::Index< 'j', 3 > j
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
static auto resizeAndSet(MatrixBoundedArray< TYPE, 9 > &m)
MatrixBoundedArray< TYPE, 9 > invF
MatrixBoundedArray< TYPE, 9 > F
virtual MoFEMErrorCode calculateCauchyStress(const BlockData block_data, boost::shared_ptr< const NumeredEntFiniteElement > fe_ptr)
Function overload to implement user material.
MatrixBoundedArray< TYPE, 9 > P
virtual MoFEMErrorCode setUserActiveVariables(VectorDouble &activeVariables)
Add additional independent variables More complex physical models depend on gradient of defamation an...
FTensor::Index< 'k', 3 > k
definition of volume element
MoFEMErrorCode preProcess()
Pre-processing function executed at loop initialization.
MoFEMErrorCode postProcess()
Post-processing function executed at loop completion.
virtual ~MyVolumeFE()=default
int getRule(int order)
it is used to calculate nb. of Gauss integration points
SmartPetscObj< Vec > ghostVec
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
std::vector< VectorDouble > & valuesAtGaussPts
const EntityType zeroAtType
std::vector< MatrixDouble > & gradientAtGaussPts
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.
FTensor::Index< 'i', 3 > i
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.
FTensor::Index< 'j', 3 > j
std::vector< MatrixDouble > * ptrh
std::vector< MatrixDouble > * ptrH
bool aLe
true if arbitrary Lagrangian-Eulerian formulation
VectorDouble activeVariables
FTensor::Index< 'k', 3 > k
MoFEMErrorCode calculateStress(const int gg)
Calculate Paola-Kirchhoff I stress.
Operator performs automatic differentiation.
bool fUnction
if true stress i calculated
bool jAcobian
if true Jacobian is calculated
FTensor::Index< 'k', 3 > k
FTensor::Index< 'j', 3 > j
virtual MoFEMErrorCode recordTag(const int gg)
Record ADOL-C tape.
FTensor::Index< 'i', 3 > i
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.
std::vector< MatrixDouble > * ptrh
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
Calculate stress or jacobian at gauss points.
VectorDouble activeVariables
std::vector< MatrixDouble > * ptrH
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)
ublas::vector< int > colIndices
ublas::vector< int > rowIndices
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)
ublas::vector< int > iNdices
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
FTensor::Index< 'k', 3 > k
DEPRECATED typedef OpRhsEshelbyStress OpRhsEshelbyStrees
FTensor::Index< 'j', 3 > j
MoFEM::Interface & mField
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
FTensor::Index< 'i', 3 > i
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.