v0.14.0
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

 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. More...
 

Public Attributes

DEPRECATED typedef OpRhsEshelbyStress OpRhsEshelbyStrees
 
MyVolumeFE feRhs
 calculate right hand side for tetrahedral elements More...
 
MyVolumeFE feLhs
 
MyVolumeFE feEnergy
 calculate elastic energy More...
 
MoFEM::InterfacemField
 
short int tAg
 
std::map< int, BlockDatasetOfBlocks
 maps block set id with appropriate BlockData More...
 
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
cell_forces.cpp, HookeElement.hpp, nonlinear_dynamics.cpp, nonlinear_elastic.cpp, Remodeling.cpp, and simple_contact.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 81 of file NonLinearElasticElement.cpp.

83  : feRhs(m_field), feLhs(m_field), feEnergy(m_field), mField(m_field),
84  tAg(tag) {}

◆ ~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 
)
Examples
nonlinear_elastic.cpp, and simple_contact.cpp.

Definition at line 1120 of file NonLinearElasticElement.cpp.

1123  {
1125 
1126  CHKERR mField.add_finite_element(element_name, MF_ZERO);
1128  element_name, spatial_position_field_name);
1130  element_name, spatial_position_field_name);
1132  element_name, spatial_position_field_name);
1133  if (mField.check_field(material_position_field_name)) {
1134  if (ale) {
1136  element_name, material_position_field_name);
1138  element_name, material_position_field_name);
1139  }
1141  element_name, material_position_field_name);
1142  }
1143 
1144  std::map<int, BlockData>::iterator sit = setOfBlocks.begin();
1145  for (; sit != setOfBlocks.end(); sit++) {
1146  CHKERR mField.add_ents_to_finite_element_by_type(sit->second.tEts, MBTET,
1147  element_name);
1148  }
1149 
1151 }

◆ setBlocks()

MoFEMErrorCode NonlinearElasticElement::setBlocks ( boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< double >>  materialDoublePtr,
boost::shared_ptr< FunctionsToCalculatePiolaKirchhoffI< adouble >>  materialAdoublePtr 
)
Examples
nonlinear_elastic.cpp, and simple_contact.cpp.

Definition at line 1086 of file NonLinearElasticElement.cpp.

1090  {
1092 
1093  if (!materialDoublePtr) {
1095  "Pointer for materialDoublePtr not allocated");
1096  }
1097  if (!materialAdoublePtr) {
1099  "Pointer for materialAdoublePtr not allocated");
1100  }
1101 
1103  mField, BLOCKSET | MAT_ELASTICSET, it)) {
1104  Mat_Elastic mydata;
1105  CHKERR it->getAttributeDataStructure(mydata);
1106  int id = it->getMeshsetId();
1107  EntityHandle meshset = it->getMeshset();
1108  CHKERR mField.get_moab().get_entities_by_type(meshset, MBTET,
1109  setOfBlocks[id].tEts, true);
1110  setOfBlocks[id].iD = id;
1111  setOfBlocks[id].E = mydata.data.Young;
1112  setOfBlocks[id].PoissonRatio = mydata.data.Poisson;
1113  setOfBlocks[id].materialDoublePtr = materialDoublePtr;
1114  setOfBlocks[id].materialAdoublePtr = materialAdoublePtr;
1115  }
1116 
1118 }

◆ 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
Examples
nonlinear_elastic.cpp, and simple_contact.cpp.

Definition at line 1153 of file NonLinearElasticElement.cpp.

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

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

Examples
simple_contact.cpp.

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:
EntityHandle
NonlinearElasticElement::mField
MoFEM::Interface & mField
Definition: NonLinearElasticElement.hpp:73
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
MoFEM::CoreInterface::modify_finite_element_add_field_row
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
MoFEM::Mat_Elastic
Elastic material data structure.
Definition: MaterialBlocks.hpp:139
NonlinearElasticElement::feRhs
MyVolumeFE feRhs
calculate right hand side for tetrahedral elements
Definition: NonLinearElasticElement.hpp:65
_IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
Definition: MeshsetsManager.hpp:49
NonlinearElasticElement::tAg
short int tAg
Definition: NonLinearElasticElement.hpp:74
MoFEM::CoreInterface::add_ents_to_finite_element_by_type
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
NonlinearElasticElement::CommonData::spatialPositions
string spatialPositions
Definition: NonLinearElasticElement.hpp:109
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
NonlinearElasticElement::feLhs
MyVolumeFE feLhs
Definition: NonLinearElasticElement.hpp:67
MoFEM::CoreInterface::add_finite_element
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::CoreInterface::modify_finite_element_add_field_col
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
MAT_ELASTICSET
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
Definition: definitions.h:172
NonlinearElasticElement::CommonData::meshPositions
string meshPositions
Definition: NonLinearElasticElement.hpp:110
NonlinearElasticElement::MyVolumeFE::V
SmartPetscObj< Vec > V
Definition: NonLinearElasticElement.hpp:58
MoFEM::Mat_Elastic::data
_data_ data
Definition: MaterialBlocks.hpp:155
MoFEM::CoreInterface::check_field
virtual bool check_field(const std::string &name) const =0
check if field is in database
MoFEM::CoreInterface::modify_finite_element_add_field_data
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
NonlinearElasticElement::commonData
CommonData commonData
Definition: NonLinearElasticElement.hpp:121
MF_ZERO
@ MF_ZERO
Definition: definitions.h:111
BLOCKSET
@ BLOCKSET
Definition: definitions.h:161
NonlinearElasticElement::setOfBlocks
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
Definition: NonLinearElasticElement.hpp:100
MoFEM::ForcesAndSourcesCore::getOpPtrVector
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Definition: ForcesAndSourcesCore.hpp:83
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
NonlinearElasticElement::feEnergy
MyVolumeFE feEnergy
calculate elastic energy
Definition: NonLinearElasticElement.hpp:70
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359