v0.15.0
Loading...
Searching...
No Matches
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
 
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 };
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT)
Iterator that loops over Cubit BlockSet having a particular name.
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
ArcLengthIntElemFEMethod(moab::Interface &moab, boost::shared_ptr< ArcLengthCtx > arcptr)
virtual moab::Interface & get_moab()=0

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 }
#define DATAFILENAME
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
virtual FieldBitNumber get_field_bit_number(const std::string name) const =0
get field bit number
static UId getHiBitNumberUId(const FieldBitNumber bit_number)
static UId getLoBitNumberUId(const FieldBitNumber bit_number)

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: