v0.15.5
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
NonlinearElasticElement Struct Reference

structure grouping operators and data used for calculation of nonlinear elastic element More...

#include "users_modules/basic_finite_elements/src/HookeElement.hpp"

Collaboration diagram for NonlinearElasticElement:
[legend]

Classes

struct  BlockData
 data for calculation heat conductivity and heat capacity elements More...
 
struct  CommonData
 common data used by volume elements More...
 
struct  FunctionsToCalculatePiolaKirchhoffI
 Implementation of elastic (non-linear) St. Kirchhoff equation. More...
 
struct  MyVolumeFE
 definition of volume element More...
 
struct  OpEnergy
 
struct  OpGetCommonDataAtGaussPts
 
struct  OpGetDataAtGaussPts
 
struct  OpJacobianEnergy
 Calculate explicit derivative of free energy. More...
 
struct  OpJacobianEshelbyStress
 
struct  OpJacobianPiolaKirchhoffStress
 Operator performs automatic differentiation. More...
 
struct  OpLhsEshelby_dx
 
struct  OpLhsEshelby_dX
 
struct  OpLhsPiolaKirchhoff_dx
 
struct  OpLhsPiolaKirchhoff_dX
 
struct  OpRhsEshelbyStress
 
struct  OpRhsPiolaKirchhoff
 

Public Member Functions

MyVolumeFEgetLoopFeRhs ()
 get rhs volume element
 
MyVolumeFEgetLoopFeLhs ()
 get lhs volume element
 
MyVolumeFEgetLoopFeEnergy ()
 get energy fe
 
 NonlinearElasticElement (MoFEM::Interface &m_field, short int tag)
 
virtual ~NonlinearElasticElement ()=default
 
MoFEMErrorCode setBlocks (boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< double > > materialDoublePtr, boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< adouble > > materialAdoublePtr)
 
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)
 
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.
 

Public Attributes

DEPRECATED typedef OpRhsEshelbyStress OpRhsEshelbyStrees
 
MyVolumeFE feRhs
 calculate right hand side for tetrahedral elements
 
MyVolumeFE feLhs
 
MyVolumeFE feEnergy
 calculate elastic energy
 
MoFEM::InterfacemField
 
short int tAg
 
std::map< int, BlockDatasetOfBlocks
 maps block set id with appropriate BlockData
 
CommonData commonData
 
FTensor::Index< 'i', 3 > i
 
FTensor::Index< 'j', 3 > j
 
FTensor::Index< 'k', 3 > k
 

Detailed Description

structure grouping operators and data used for calculation of nonlinear elastic element

In order to assemble matrices and right hand vectors, the loops over elements, entities over that elements and finally loop over integration points are executed.

Following implementation separate those three categories of loops and to each loop attach operator.

Examples
mofem/users_modules/basic_finite_elements/nonlinear_elasticity/nonlinear_dynamics.cpp, mofem/users_modules/basic_finite_elements/src/HookeElement.hpp, and mofem/users_modules/bone_remodelling/src/impl/Remodeling.cpp.

Definition at line 27 of file HookeElement.hpp.

Constructor & Destructor Documentation

◆ NonlinearElasticElement()

NonlinearElasticElement::NonlinearElasticElement ( MoFEM::Interface m_field,
short int  tag 
)

Definition at line 78 of file NonLinearElasticElement.cpp.

80 : feRhs(m_field), feLhs(m_field), feEnergy(m_field), mField(m_field),
81 tAg(tag) {}
MyVolumeFE feRhs
calculate right hand side for tetrahedral elements
MyVolumeFE feEnergy
calculate elastic energy

◆ ~NonlinearElasticElement()

virtual NonlinearElasticElement::~NonlinearElasticElement ( )
virtualdefault

Member Function Documentation

◆ addElement()

MoFEMErrorCode NonlinearElasticElement::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 
)

Definition at line 1118 of file NonLinearElasticElement.cpp.

1121 {
1123
1124 CHKERR mField.add_finite_element(element_name, MF_ZERO);
1126 element_name, spatial_position_field_name);
1128 element_name, spatial_position_field_name);
1130 element_name, spatial_position_field_name);
1131 if (mField.check_field(material_position_field_name)) {
1132 if (ale) {
1134 element_name, material_position_field_name);
1136 element_name, material_position_field_name);
1137 }
1139 element_name, material_position_field_name);
1140 }
1141
1142 std::map<int, BlockData>::iterator sit = setOfBlocks.begin();
1143 for (; sit != setOfBlocks.end(); sit++) {
1144 CHKERR mField.add_ents_to_finite_element_by_type(sit->second.tEts, MBTET,
1145 element_name);
1146 }
1147
1149}
@ MF_ZERO
#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.
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string name, const bool recursive=true)=0
add entities to finite element
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
virtual bool check_field(const std::string &name) const =0
check if field is in database
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData

◆ getLoopFeEnergy()

MyVolumeFE & NonlinearElasticElement::getLoopFeEnergy ( )
inline

get energy fe

Definition at line 71 of file NonLinearElasticElement.hpp.

◆ getLoopFeLhs()

MyVolumeFE & NonlinearElasticElement::getLoopFeLhs ( )
inline

get lhs volume element

Definition at line 68 of file NonLinearElasticElement.hpp.

◆ getLoopFeRhs()

MyVolumeFE & NonlinearElasticElement::getLoopFeRhs ( )
inline

get rhs volume element

Definition at line 66 of file NonLinearElasticElement.hpp.

◆ setBlocks()

MoFEMErrorCode NonlinearElasticElement::setBlocks ( boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< double > >  materialDoublePtr,
boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< adouble > >  materialAdoublePtr 
)

Definition at line 1084 of file NonLinearElasticElement.cpp.

1088 {
1090
1091 if (!materialDoublePtr) {
1093 "Pointer for materialDoublePtr not allocated");
1094 }
1095 if (!materialAdoublePtr) {
1097 "Pointer for materialAdoublePtr not allocated");
1098 }
1099
1101 mField, BLOCKSET | MAT_ELASTICSET, it)) {
1102 Mat_Elastic mydata;
1103 CHKERR it->getAttributeDataStructure(mydata);
1104 int id = it->getMeshsetId();
1105 EntityHandle meshset = it->getMeshset();
1106 CHKERR mField.get_moab().get_entities_by_type(meshset, MBTET,
1107 setOfBlocks[id].tEts, true);
1108 setOfBlocks[id].iD = id;
1109 setOfBlocks[id].E = mydata.data.Young;
1110 setOfBlocks[id].PoissonRatio = mydata.data.Poisson;
1111 setOfBlocks[id].materialDoublePtr = materialDoublePtr;
1112 setOfBlocks[id].materialAdoublePtr = materialAdoublePtr;
1113 }
1114
1116}
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
@ BLOCKSET
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Elastic material data structure.

◆ setOperators()

MoFEMErrorCode NonlinearElasticElement::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.

Parameters
funclass needed to calculate Piola Kirchhoff I Stress tensor
spatial_position_field_namename of approximation field
material_position_field_namename of field to define geometry
aletrue if arbitrary Lagrangian Eulerian formulation
field_disptrue if approximation field represents displacements otherwise it is field of spatial positions

Definition at line 1151 of file NonLinearElasticElement.cpp.

1154 {
1156
1157 commonData.spatialPositions = spatial_position_field_name;
1158 commonData.meshPositions = material_position_field_name;
1159
1160 // Rhs
1161 feRhs.getOpPtrVector().push_back(
1162 new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1163 if (mField.check_field(material_position_field_name)) {
1164 feRhs.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1165 material_position_field_name, commonData));
1166 }
1167 std::map<int, BlockData>::iterator sit = setOfBlocks.begin();
1168 for (; sit != setOfBlocks.end(); sit++) {
1169 feRhs.getOpPtrVector().push_back(new OpJacobianPiolaKirchhoffStress(
1170 spatial_position_field_name, sit->second, commonData, tAg, false, ale,
1171 field_disp));
1172 feRhs.getOpPtrVector().push_back(new OpRhsPiolaKirchhoff(
1173 spatial_position_field_name, sit->second, commonData));
1174 }
1175
1176 // Energy
1177 feEnergy.getOpPtrVector().push_back(
1178 new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1179 if (mField.check_field(material_position_field_name)) {
1180 feEnergy.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1181 material_position_field_name, commonData));
1182 }
1183 sit = setOfBlocks.begin();
1184 for (; sit != setOfBlocks.end(); sit++) {
1185 feEnergy.getOpPtrVector().push_back(
1186 new OpEnergy(spatial_position_field_name, sit->second, commonData,
1187 feEnergy.V, field_disp));
1188 }
1189
1190 // Lhs
1191 feLhs.getOpPtrVector().push_back(
1192 new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1193 if (mField.check_field(material_position_field_name)) {
1194 feLhs.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1195 material_position_field_name, commonData));
1196 }
1197 sit = setOfBlocks.begin();
1198 for (; sit != setOfBlocks.end(); sit++) {
1199 feLhs.getOpPtrVector().push_back(new OpJacobianPiolaKirchhoffStress(
1200 spatial_position_field_name, sit->second, commonData, tAg, true, ale,
1201 field_disp));
1202 feLhs.getOpPtrVector().push_back(new OpLhsPiolaKirchhoff_dx(
1203 spatial_position_field_name, spatial_position_field_name, sit->second,
1204 commonData));
1205 }
1206
1208}
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.

Member Data Documentation

◆ commonData

CommonData NonlinearElasticElement::commonData

Definition at line 121 of file NonLinearElasticElement.hpp.

◆ feEnergy

MyVolumeFE NonlinearElasticElement::feEnergy

calculate elastic energy

Definition at line 70 of file NonLinearElasticElement.hpp.

◆ feLhs

MyVolumeFE NonlinearElasticElement::feLhs

Definition at line 67 of file NonLinearElasticElement.hpp.

◆ feRhs

MyVolumeFE NonlinearElasticElement::feRhs

calculate right hand side for tetrahedral elements

Definition at line 65 of file NonLinearElasticElement.hpp.

◆ i

FTensor::Index<'i', 3> NonlinearElasticElement::i

Definition at line 123 of file NonLinearElasticElement.hpp.

◆ j

FTensor::Index<'j', 3> NonlinearElasticElement::j

Definition at line 124 of file NonLinearElasticElement.hpp.

◆ k

FTensor::Index<'k', 3> NonlinearElasticElement::k

Definition at line 125 of file NonLinearElasticElement.hpp.

◆ mField

MoFEM::Interface& NonlinearElasticElement::mField

Definition at line 73 of file NonLinearElasticElement.hpp.

◆ OpRhsEshelbyStrees

DEPRECATED typedef OpRhsEshelbyStress NonlinearElasticElement::OpRhsEshelbyStrees
Deprecated:
name with spelling mistake

Definition at line 631 of file NonLinearElasticElement.hpp.

◆ setOfBlocks

std::map<int, BlockData> NonlinearElasticElement::setOfBlocks

maps block set id with appropriate BlockData

Definition at line 100 of file NonLinearElasticElement.hpp.

◆ tAg

short int NonlinearElasticElement::tAg

Definition at line 74 of file NonLinearElasticElement.hpp.


The documentation for this struct was generated from the following files: