v0.14.0
Public Member Functions | Public Attributes | List of all members
CohesiveElement::ArcLengthElement Struct Reference
Inheritance diagram for CohesiveElement::ArcLengthElement:
[legend]
Collaboration diagram for CohesiveElement::ArcLengthElement:
[legend]

Public Member Functions

 ArcLengthElement (MoFEM::Interface &m_field, boost::shared_ptr< ArcLengthCtx > &arc_ptr)
 
MoFEMErrorCode postProcessLoadPath ()
 
- Public Member Functions inherited from CohesiveElement::ArcLengthIntElemFEMethod
 ArcLengthIntElemFEMethod (moab::Interface &moab, boost::shared_ptr< ArcLengthCtx > arcptr)
 
 ~ArcLengthIntElemFEMethod ()
 
MoFEMErrorCode remove_damaged_prisms_nodes ()
 remove nodes of prims which are fully damaged More...
 
MoFEMErrorCode preProcess ()
 
MoFEMErrorCode calculate_lambda_int (double &_lambda_int_)
 
virtual MoFEMErrorCode calculate_db ()
 
MoFEMErrorCode operator() ()
 
MoFEMErrorCode postProcess ()
 
MoFEMErrorCode calculate_dx_and_dlambda (Vec &x)
 
MoFEMErrorCode calculate_init_dlambda (double *dlambda)
 
MoFEMErrorCode set_dlambda_to_x (Vec &x, double dlambda)
 

Public Attributes

MoFEM::InterfacemField
 
Range postProcNodes
 
- Public Attributes inherited from CohesiveElement::ArcLengthIntElemFEMethod
moab::Interface & mOab
 
boost::shared_ptr< ArcLengthCtxarcPtr
 
Vec GhostLambdaInt
 
Range Faces3
 
Range Faces4
 
Range Edges3
 
Range Edges4
 
Range Nodes3
 
Range Nodes4
 
Tag thDamagedPrism
 
double lambda_int
 

Detailed Description

Definition at line 31 of file arc_length_interface.cpp.

Constructor & Destructor Documentation

◆ ArcLengthElement()

CohesiveElement::ArcLengthElement::ArcLengthElement ( MoFEM::Interface m_field,
boost::shared_ptr< ArcLengthCtx > &  arc_ptr 
)
inline

Definition at line 34 of file arc_length_interface.cpp.

36  : ArcLengthIntElemFEMethod(m_field.get_moab(), arc_ptr), mField(m_field) {
37 
38  for (_IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(mField, "LoadPath", cit)) {
39  EntityHandle meshset = cit->getMeshset();
40  Range nodes;
41  rval = mOab.get_entities_by_type(meshset, MBVERTEX, nodes, true);
43  postProcNodes.merge(nodes);
44  }
45 
46  PetscPrintf(PETSC_COMM_WORLD, "Nb. PostProcNodes %lu\n",
47  postProcNodes.size());
48  };

Member Function Documentation

◆ postProcessLoadPath()

MoFEMErrorCode CohesiveElement::ArcLengthElement::postProcessLoadPath ( )
inline

Definition at line 50 of file arc_length_interface.cpp.

50  {
52  FILE *datafile;
53  PetscFOpen(PETSC_COMM_SELF, DATAFILENAME, "a+", &datafile);
54  const auto bit_number_lambda = mField.get_field_bit_number("LAMBDA");
55 
56  boost::shared_ptr<NumeredDofEntity_multiIndex> numered_dofs_rows =
57  problemPtr->getNumeredRowDofsPtr();
58  auto lit = numered_dofs_rows->lower_bound(
59  FieldEntity::getLoBitNumberUId(bit_number_lambda));
60  auto hi_lit = numered_dofs_rows->upper_bound(
61  FieldEntity::getHiBitNumberUId(bit_number_lambda));
62 
63  if (lit == numered_dofs_rows->end()) {
64  fclose(datafile);
66  } else if (std::distance(lit, hi_lit) != 1) {
67  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
68  "Only one DOF is expected");
69  }
70 
71  Range::iterator nit = postProcNodes.begin();
72  for (; nit != postProcNodes.end(); nit++) {
73  NumeredDofEntityByEnt::iterator dit, hi_dit;
74  dit = numered_dofs_rows->get<Ent_mi_tag>().lower_bound(*nit);
75  hi_dit = numered_dofs_rows->get<Ent_mi_tag>().upper_bound(*nit);
76  double coords[3];
77  CHKERR mOab.get_coords(&*nit, 1, coords);
78  for (; dit != hi_dit; dit++) {
79  PetscPrintf(PETSC_COMM_WORLD, "%s [ %d ] %6.4e -> ",
80  lit->get()->getName().c_str(), lit->get()->getDofCoeffIdx(),
81  lit->get()->getFieldData());
82  PetscPrintf(PETSC_COMM_WORLD, "%s [ %d ] %6.4e ",
83  dit->get()->getName().c_str(), dit->get()->getDofCoeffIdx(),
84  dit->get()->getFieldData());
85  PetscPrintf(PETSC_COMM_WORLD, "-> %3.4f %3.4f %3.4f\n", coords[0],
86  coords[1], coords[2]);
87  PetscFPrintf(PETSC_COMM_WORLD, datafile, "%6.4e %6.4e ",
88  dit->get()->getFieldData(), lit->get()->getFieldData());
89  }
90  }
91  PetscFPrintf(PETSC_COMM_WORLD, datafile, "\n");
92  fclose(datafile);
94  }

Member Data Documentation

◆ mField

MoFEM::Interface& CohesiveElement::ArcLengthElement::mField

Definition at line 32 of file arc_length_interface.cpp.

◆ postProcNodes

Range CohesiveElement::ArcLengthElement::postProcNodes

Definition at line 33 of file arc_length_interface.cpp.


The documentation for this struct was generated from the following file:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::Ent_mi_tag
Definition: TagMultiIndices.hpp:21
EntityHandle
MoFEM::CoreInterface::get_field_bit_number
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
CohesiveElement::ArcLengthIntElemFEMethod::ArcLengthIntElemFEMethod
ArcLengthIntElemFEMethod(moab::Interface &moab, boost::shared_ptr< ArcLengthCtx > arcptr)
Definition: InterfaceGapArcLengthControl.hpp:24
MOAB_THROW
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:541
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
DATAFILENAME
#define DATAFILENAME
Definition: arc_length_interface.cpp:27
Range
CohesiveElement::ArcLengthElement::mField
MoFEM::Interface & mField
Definition: arc_length_interface.cpp:32
CohesiveElement::ArcLengthElement::postProcNodes
Range postProcNodes
Definition: arc_length_interface.cpp:33
_IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_
#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT)
Iterator that loops over Cubit BlockSet having a particular name.
Definition: MeshsetsManager.hpp:94
CohesiveElement::ArcLengthIntElemFEMethod::mOab
moab::Interface & mOab
Definition: InterfaceGapArcLengthControl.hpp:13
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346