v0.9.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 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 het 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)
 
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, and Remodeling.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 125 of file NonLinearElasticElement.cpp.

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

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 1181 of file NonLinearElasticElement.cpp.

1184  {
1186 
1187  CHKERR mField.add_finite_element(element_name, MF_ZERO);
1189  element_name, spatial_position_field_name);
1191  element_name, spatial_position_field_name);
1193  element_name, spatial_position_field_name);
1194  if (mField.check_field(material_position_field_name)) {
1195  if (ale) {
1197  element_name, material_position_field_name);
1199  element_name, material_position_field_name);
1200  }
1202  element_name, material_position_field_name);
1203  }
1204 
1205  std::map<int, BlockData>::iterator sit = setOfBlocks.begin();
1206  for (; sit != setOfBlocks.end(); sit++) {
1207  CHKERR mField.add_ents_to_finite_element_by_type(sit->second.tEts, MBTET,
1208  element_name);
1209  }
1210 
1212 }
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:477
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:596
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:407

◆ getLoopFeEnergy()

MyVolumeFE& NonlinearElasticElement::getLoopFeEnergy ( )

get energy fe

Definition at line 84 of file NonLinearElasticElement.hpp.

◆ getLoopFeLhs()

MyVolumeFE& NonlinearElasticElement::getLoopFeLhs ( )

get lhs volume element

Definition at line 81 of file NonLinearElasticElement.hpp.

◆ getLoopFeRhs()

MyVolumeFE& NonlinearElasticElement::getLoopFeRhs ( )

get rhs volume element

Definition at line 79 of file NonLinearElasticElement.hpp.

◆ setBlocks()

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

Definition at line 1147 of file NonLinearElasticElement.cpp.

1151  {
1153 
1154  if (!materialDoublePtr) {
1156  "Pointer for materialDoublePtr not allocated");
1157  }
1158  if (!materialAdoublePtr) {
1160  "Pointer for materialAdoublePtr not allocated");
1161  }
1162 
1164  mField, BLOCKSET | MAT_ELASTICSET, it)) {
1165  Mat_Elastic mydata;
1166  CHKERR it->getAttributeDataStructure(mydata);
1167  int id = it->getMeshsetId();
1168  EntityHandle meshset = it->getMeshset();
1169  CHKERR mField.get_moab().get_entities_by_type(meshset, MBTET,
1170  setOfBlocks[id].tEts, true);
1171  setOfBlocks[id].iD = id;
1172  setOfBlocks[id].E = mydata.data.Young;
1173  setOfBlocks[id].PoissonRatio = mydata.data.Poisson;
1174  setOfBlocks[id].materialDoublePtr = materialDoublePtr;
1175  setOfBlocks[id].materialAdoublePtr = materialAdoublePtr;
1176  }
1177 
1179 }
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:477
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:596
block name is "MAT_ELASTIC"
Definition: definitions.h:222
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
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

Definition at line 1214 of file NonLinearElasticElement.cpp.

1217  {
1219 
1220  commonData.spatialPositions = spatial_position_field_name;
1221  commonData.meshPositions = material_position_field_name;
1222 
1223  // Rhs
1224  feRhs.getOpPtrVector().push_back(
1225  new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1226  if (mField.check_field(material_position_field_name)) {
1227  feRhs.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1228  material_position_field_name, commonData));
1229  }
1230  std::map<int, BlockData>::iterator sit = setOfBlocks.begin();
1231  for (; sit != setOfBlocks.end(); sit++) {
1232  feRhs.getOpPtrVector().push_back(new OpJacobianPiolaKirchhoffStress(
1233  spatial_position_field_name, sit->second, commonData, tAg, false, ale,
1234  field_disp));
1235  feRhs.getOpPtrVector().push_back(new OpRhsPiolaKirchhoff(
1236  spatial_position_field_name, sit->second, commonData));
1237  }
1238 
1239  // Energy
1240  feEnergy.getOpPtrVector().push_back(
1241  new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1242  if (mField.check_field(material_position_field_name)) {
1243  feEnergy.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1244  material_position_field_name, commonData));
1245  }
1246  sit = setOfBlocks.begin();
1247  for (; sit != setOfBlocks.end(); sit++) {
1248  feEnergy.getOpPtrVector().push_back(
1249  new OpEnergy(spatial_position_field_name, sit->second, commonData,
1250  feEnergy.V, field_disp));
1251  }
1252 
1253  // Lhs
1254  feLhs.getOpPtrVector().push_back(
1255  new OpGetCommonDataAtGaussPts(spatial_position_field_name, commonData));
1256  if (mField.check_field(material_position_field_name)) {
1257  feLhs.getOpPtrVector().push_back(new OpGetCommonDataAtGaussPts(
1258  material_position_field_name, commonData));
1259  }
1260  sit = setOfBlocks.begin();
1261  for (; sit != setOfBlocks.end(); sit++) {
1262  feLhs.getOpPtrVector().push_back(new OpJacobianPiolaKirchhoffStress(
1263  spatial_position_field_name, sit->second, commonData, tAg, true, ale,
1264  field_disp));
1265  feLhs.getOpPtrVector().push_back(new OpLhsPiolaKirchhoff_dx(
1266  spatial_position_field_name, spatial_position_field_name, sit->second,
1267  commonData));
1268  }
1269 
1271 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
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:407

Member Data Documentation

◆ commonData

CommonData NonlinearElasticElement::commonData

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

◆ setOfBlocks

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

maps block set id with appropriate BlockData

Definition at line 112 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: