v0.9.1
Classes | Public Member Functions | Public Attributes | List of all members
NonlinearElasticElement Struct Reference

structure grouping operators and data used for calculation of nonlinear elastic elementIn order to assemble matrices and right hand vectors, the loops over elements, entities over that elements and finally loop over integration points are executed. 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 More...
 
MyVolumeFEgetLoopFeLhs ()
 get lhs volume element More...
 
MyVolumeFEgetLoopFeEnergy ()
 get energy fe More...
 
 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
 

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, Remodeling.cpp, and simple_contact.cpp.

Definition at line 40 of file HookeElement.hpp.

Constructor & Destructor Documentation

◆ NonlinearElasticElement()

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

Definition at line 105 of file NonLinearElasticElement.cpp.

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

◆ ~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
simple_contact.cpp.

Definition at line 1162 of file NonLinearElasticElement.cpp.

1165  {
1167 
1168  CHKERR mField.add_finite_element(element_name, MF_ZERO);
1170  element_name, spatial_position_field_name);
1172  element_name, spatial_position_field_name);
1174  element_name, spatial_position_field_name);
1175  if (mField.check_field(material_position_field_name)) {
1176  if (ale) {
1178  element_name, material_position_field_name);
1180  element_name, material_position_field_name);
1181  }
1183  element_name, material_position_field_name);
1184  }
1185 
1186  std::map<int, BlockData>::iterator sit = setOfBlocks.begin();
1187  for (; sit != setOfBlocks.end(); sit++) {
1188  CHKERR mField.add_ents_to_finite_element_by_type(sit->second.tEts, MBTET,
1189  element_name);
1190  }
1191 
1193 }
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
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
#define CHKERR
Inline error check.
Definition: definitions.h:602
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string &name_filed)=0
set finite element field data
virtual bool check_field(const std::string &name) const =0
check if field is in database
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
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ getLoopFeEnergy()

MyVolumeFE& NonlinearElasticElement::getLoopFeEnergy ( )

get energy fe

Examples
simple_contact.cpp.

Definition at line 84 of file NonLinearElasticElement.hpp.

◆ getLoopFeLhs()

MyVolumeFE& NonlinearElasticElement::getLoopFeLhs ( )

get lhs volume element

Examples
simple_contact.cpp.

Definition at line 81 of file NonLinearElasticElement.hpp.

◆ getLoopFeRhs()

MyVolumeFE& NonlinearElasticElement::getLoopFeRhs ( )

get rhs volume element

Examples
simple_contact.cpp.

Definition at line 79 of file NonLinearElasticElement.hpp.

◆ setBlocks()

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

Definition at line 1128 of file NonLinearElasticElement.cpp.

1132  {
1134 
1135  if (!materialDoublePtr) {
1137  "Pointer for materialDoublePtr not allocated");
1138  }
1139  if (!materialAdoublePtr) {
1141  "Pointer for materialAdoublePtr not allocated");
1142  }
1143 
1145  mField, BLOCKSET | MAT_ELASTICSET, it)) {
1146  Mat_Elastic mydata;
1147  CHKERR it->getAttributeDataStructure(mydata);
1148  int id = it->getMeshsetId();
1149  EntityHandle meshset = it->getMeshset();
1150  CHKERR mField.get_moab().get_entities_by_type(meshset, MBTET,
1151  setOfBlocks[id].tEts, true);
1152  setOfBlocks[id].iD = id;
1153  setOfBlocks[id].E = mydata.data.Young;
1154  setOfBlocks[id].PoissonRatio = mydata.data.Poisson;
1155  setOfBlocks[id].materialDoublePtr = materialDoublePtr;
1156  setOfBlocks[id].materialAdoublePtr = materialAdoublePtr;
1157  }
1158 
1160 }
virtual moab::Interface & get_moab()=0
Elastic material data structure.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
#define CHKERR
Inline error check.
Definition: definitions.h:602
block name is "MAT_ELASTIC"
Definition: definitions.h:228
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413
virtual MPI_Comm & get_comm() const =0

◆ 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
simple_contact.cpp.

Definition at line 1195 of file NonLinearElasticElement.cpp.

1198  {
1200 
1201  commonData.spatialPositions = spatial_position_field_name;
1202  commonData.meshPositions = material_position_field_name;
1203 
1204  // Rhs
1205  feRhs.getOpPtrVector().push_back(
1206  new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1207  if (mField.check_field(material_position_field_name)) {
1208  feRhs.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1209  material_position_field_name, commonData));
1210  }
1211  std::map<int, BlockData>::iterator sit = setOfBlocks.begin();
1212  for (; sit != setOfBlocks.end(); sit++) {
1213  feRhs.getOpPtrVector().push_back(new OpJacobianPiolaKirchhoffStress(
1214  spatial_position_field_name, sit->second, commonData, tAg, false, ale,
1215  field_disp));
1216  feRhs.getOpPtrVector().push_back(new OpRhsPiolaKirchhoff(
1217  spatial_position_field_name, sit->second, commonData));
1218  }
1219 
1220  // Energy
1221  feEnergy.getOpPtrVector().push_back(
1222  new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1223  if (mField.check_field(material_position_field_name)) {
1224  feEnergy.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1225  material_position_field_name, commonData));
1226  }
1227  sit = setOfBlocks.begin();
1228  for (; sit != setOfBlocks.end(); sit++) {
1229  feEnergy.getOpPtrVector().push_back(
1230  new OpEnergy(spatial_position_field_name, sit->second, commonData,
1231  feEnergy.V, field_disp));
1232  }
1233 
1234  // Lhs
1235  feLhs.getOpPtrVector().push_back(
1236  new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1237  if (mField.check_field(material_position_field_name)) {
1238  feLhs.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1239  material_position_field_name, commonData));
1240  }
1241  sit = setOfBlocks.begin();
1242  for (; sit != setOfBlocks.end(); sit++) {
1243  feLhs.getOpPtrVector().push_back(new OpJacobianPiolaKirchhoffStress(
1244  spatial_position_field_name, sit->second, commonData, tAg, true, ale,
1245  field_disp));
1246  feLhs.getOpPtrVector().push_back(new OpLhsPiolaKirchhoff_dx(
1247  spatial_position_field_name, spatial_position_field_name, sit->second,
1248  commonData));
1249  }
1250 
1252 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
MyVolumeFE feEnergy
calculate elastic energy
MyVolumeFE feRhs
calculate right hand side for tetrahedral elements
std::map< int, BlockData > setOfBlocks
maps block set id with appropriate BlockData
boost::ptr_vector< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
virtual bool check_field(const std::string &name) const =0
check if field is in database
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

Member Data Documentation

◆ commonData

CommonData NonlinearElasticElement::commonData

Definition at line 134 of file NonLinearElasticElement.hpp.

◆ feEnergy

MyVolumeFE NonlinearElasticElement::feEnergy

calculate elastic energy

Definition at line 83 of file NonLinearElasticElement.hpp.

◆ feLhs

MyVolumeFE NonlinearElasticElement::feLhs

Definition at line 80 of file NonLinearElasticElement.hpp.

◆ feRhs

MyVolumeFE NonlinearElasticElement::feRhs

calculate right hand side for tetrahedral elements

Definition at line 78 of file NonLinearElasticElement.hpp.

◆ mField

MoFEM::Interface& NonlinearElasticElement::mField

Definition at line 86 of file NonLinearElasticElement.hpp.

◆ OpRhsEshelbyStrees

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

Definition at line 640 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 113 of file NonLinearElasticElement.hpp.

◆ tAg

short int NonlinearElasticElement::tAg

Definition at line 87 of file NonLinearElasticElement.hpp.


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