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);
350 std::vector<VectorDouble> &values_at_gauss_pts,
351 std::vector<MatrixDouble> &gradient_at_gauss_pts);
359 EntitiesFieldData::EntData &data);
401 int tag,
bool jacobian,
bool ale,
407 std::vector<MatrixDouble> *
ptrh;
408 std::vector<MatrixDouble> *
ptrH;
424 virtual MoFEMErrorCode
recordTag(
const int gg);
430 virtual MoFEMErrorCode
playTag(
const int gg);
453 EntitiesFieldData::EntData &row_data);
475 bool gradient,
bool hessian,
bool ale,
bool field_disp);
480 std::vector<MatrixDouble> *
ptrh;
481 std::vector<MatrixDouble> *
ptrH;
508 virtual MoFEMErrorCode
recordTag(
const int gg);
514 virtual MoFEMErrorCode
playTag(
const int gg);
517 EntitiesFieldData::EntData &row_data);
534 EntitiesFieldData::EntData &row_data);
537 EntitiesFieldData::EntData &row_data);
549 CommonData &common_data, SmartPetscObj<Vec> ghost_vec,
553 EntitiesFieldData::EntData &row_data);
584 virtual MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
587 virtual MoFEMErrorCode
aSemble(
int row_side,
int col_side,
589 EntitiesFieldData::EntData &row_data,
590 EntitiesFieldData::EntData &col_data);
594 EntitiesFieldData::EntData &row_data,
595 EntitiesFieldData::EntData &col_data);
605 MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
int gg);
609 EntitiesFieldData::EntData &row_data,
610 EntitiesFieldData::EntData &col_data);
616 CommonData &common_data,
int tag,
bool jacobian,
638 MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
int gg);
646 MoFEMErrorCode
getJac(EntitiesFieldData::EntData &col_data,
int gg);
656 const std::string element_name,
657 const std::string spatial_position_field_name,
658 const std::string material_position_field_name =
"MESH_NODE_POSITIONS",
659 const bool ale =
false);
672 const std::string spatial_position_field_name,
673 const std::string material_position_field_name =
"MESH_NODE_POSITIONS",
674 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 ...
FTensor::Index< 'm', SPACE_DIM > m
constexpr auto field_name
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()
function is run at the beginning of loop
MoFEMErrorCode postProcess()
function is run at the end of loop
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.