v0.14.0
elasticity_mixed_formulation.cpp
Go to the documentation of this file.
1 /** \file elasticity_mixed_formulation.cpp
2  * \example elasticity_mixed_formulation.cpp
3  *
4  * \brief Main implementation of U-P (mixed) finite element.
5  *
6  */
7 
8 
9 
10 #include <BasicFiniteElements.hpp>
12 
13 using namespace boost::numeric;
14 using namespace MoFEM;
15 using namespace std;
16 
17 static char help[] = "-my_order_p approximation order_p \n"
18  "-my_order_u approximation order_u \n"
19  "-is_partitioned is_partitioned? \n";
20 
21 int main(int argc, char *argv[]) {
22 
23  const string default_options = "-ksp_type gmres \n"
24  "-pc_type lu \n"
25  "-pc_factor_mat_solver_type mumps \n"
26  "-mat_mumps_icntl_20 0 \n"
27  "-ksp_monitor\n";
28 
29  string param_file = "param_file.petsc";
30  if (!static_cast<bool>(ifstream(param_file))) {
31  std::ofstream file(param_file.c_str(), std::ios::ate);
32  if (file.is_open()) {
33  file << default_options;
34  file.close();
35  }
36  }
37 
38  MoFEM::Core::Initialize(&argc, &argv, param_file.c_str(), help);
39 
40  try {
41 
42  // Create mesh database
43  moab::Core mb_instance; // create database
44  moab::Interface &moab = mb_instance; // create interface to database
45 
46  // Create moab communicator
47  // Create separate MOAB communicator, it is duplicate of PETSc communicator.
48  // NOTE That this should eliminate potential communication problems between
49  // MOAB and PETSC functions.
50  ParallelComm *pcomm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
51  auto moab_comm_wrap =
52  boost::make_shared<WrapMPIComm>(PETSC_COMM_WORLD, false);
53  if (pcomm == NULL)
54  pcomm = new ParallelComm(&moab, moab_comm_wrap->get_comm());
55 
56  // Get command line options
57  char mesh_file_name[255];
58  PetscBool flg_file;
59  int order_p = 2; // default approximation order_p
60  int order_u = 3; // default approximation order_u
61  PetscBool is_partitioned = PETSC_FALSE;
62  PetscBool flg_test = PETSC_FALSE; // true check if error is numerical error
63 
64  CHKERR PetscOptionsBegin(PETSC_COMM_WORLD, "", "Mix elastic problem",
65  "none");
66 
67  CHKERR PetscOptionsString("-my_file", "mesh file name", "", "mesh.h5m",
68  mesh_file_name, 255, &flg_file);
69  // Set approximation order
70  CHKERR PetscOptionsInt("-my_order_p", "approximation order_p", "", order_p,
71  &order_p, PETSC_NULL);
72  CHKERR PetscOptionsInt("-my_order_u", "approximation order_u", "", order_u,
73  &order_u, PETSC_NULL);
74 
75  CHKERR PetscOptionsBool("-is_partitioned", "is_partitioned?", "",
76  is_partitioned, &is_partitioned, PETSC_NULL);
77 
78  // Set testing (used by CTest)
79  CHKERR PetscOptionsBool("-test", "if true is ctest", "", flg_test,
80  &flg_test, PETSC_NULL);
81  ierr = PetscOptionsEnd();
82 
83  if (flg_file != PETSC_TRUE) {
84  SETERRQ(PETSC_COMM_SELF, 1, "*** ERROR -my_file (MESH FILE NEEDED)");
85  }
86 
87  // Read whole mesh or part of it if partitioned
88  if (is_partitioned == PETSC_TRUE) {
89  // This is a case of distributed mesh and algebra. In that case each
90  // processor keeps only part of the problem.
91  const char *option;
92  option = "PARALLEL=READ_PART;"
93  "PARALLEL_RESOLVE_SHARED_ENTS;"
94  "PARTITION=PARALLEL_PARTITION;";
95  CHKERR moab.load_file(mesh_file_name, 0, option);
96  } else {
97  // In this case, we have distributed algebra, i.e. assembly of vectors and
98  // matrices is in parallel, but whole mesh is stored on all processors.
99  // Solver and matrix scales well, however problem set-up of problem is
100  // not fully parallel.
101  const char *option;
102  option = "";
103  CHKERR moab.load_file(mesh_file_name, 0, option);
104  }
105 
106  // Create MoFEM database and link it to MoAB
107  MoFEM::Core core(moab);
108  MoFEM::Interface &m_field = core;
109 
110  // Print boundary conditions and material parameters
111  MeshsetsManager *meshsets_mng_ptr;
112  CHKERR m_field.getInterface(meshsets_mng_ptr);
113  CHKERR meshsets_mng_ptr->printDisplacementSet();
114  CHKERR meshsets_mng_ptr->printForceSet();
115  CHKERR meshsets_mng_ptr->printMaterialsSet();
116 
117  BitRefLevel bit_level0;
118  bit_level0.set(0);
119  CHKERR m_field.getInterface<BitRefManager>()->setBitRefLevelByDim(
120  0, 3, bit_level0);
121 
122  // **** ADD FIELDS **** //
123  CHKERR m_field.add_field("MESH_NODE_POSITIONS", H1, AINSWORTH_LEGENDRE_BASE,
124  3);
125  CHKERR m_field.add_ents_to_field_by_type(0, MBTET, "MESH_NODE_POSITIONS");
126  CHKERR m_field.set_field_order(0, MBVERTEX, "MESH_NODE_POSITIONS", 1);
127 
128  CHKERR m_field.add_field("U", H1, AINSWORTH_LEGENDRE_BASE, 3);
129  CHKERR m_field.add_ents_to_field_by_type(0, MBTET, "U");
130  CHKERR m_field.set_field_order(0, MBVERTEX, "U", 1);
131  CHKERR m_field.set_field_order(0, MBEDGE, "U", order_u);
132  CHKERR m_field.set_field_order(0, MBTRI, "U", order_u);
133  CHKERR m_field.set_field_order(0, MBTET, "U", order_u);
134 
135  CHKERR m_field.add_field("P", H1, AINSWORTH_LEGENDRE_BASE, 1);
136  CHKERR m_field.add_ents_to_field_by_type(0, MBTET, "P");
137  CHKERR m_field.set_field_order(0, MBVERTEX, "P", 1);
138  CHKERR m_field.set_field_order(0, MBEDGE, "P", order_p);
139  CHKERR m_field.set_field_order(0, MBTRI, "P", order_p);
140  CHKERR m_field.set_field_order(0, MBTET, "P", order_p);
141 
142  CHKERR m_field.build_fields();
143 
144  // CHKERR m_field.getInterface<FieldBlas>()->setField(
145  // 0, MBVERTEX, "P"); // initial p = 0 everywhere
146  {
147  Projection10NodeCoordsOnField ent_method_material(m_field,
148  "MESH_NODE_POSITIONS");
149  CHKERR m_field.loop_dofs("MESH_NODE_POSITIONS", ent_method_material);
150  }
151  // setup elements for loading
153  CHKERR MetaNodalForces::addElement(m_field, "U");
154  CHKERR MetaEdgeForces::addElement(m_field, "U");
155 
156  // **** ADD ELEMENTS **** //
157 
158  // Add finite element (this defines element, declaration comes later)
159  CHKERR m_field.add_finite_element("ELASTIC");
160  CHKERR m_field.modify_finite_element_add_field_row("ELASTIC", "U");
161  CHKERR m_field.modify_finite_element_add_field_col("ELASTIC", "U");
162  CHKERR m_field.modify_finite_element_add_field_data("ELASTIC", "U");
163 
164  CHKERR m_field.modify_finite_element_add_field_row("ELASTIC", "P");
165  CHKERR m_field.modify_finite_element_add_field_col("ELASTIC", "P");
166  CHKERR m_field.modify_finite_element_add_field_data("ELASTIC", "P");
168  "MESH_NODE_POSITIONS");
169 
170  // Add entities to that element
171  CHKERR m_field.add_ents_to_finite_element_by_type(0, MBTET, "ELASTIC");
172  // build finite elements
173  CHKERR m_field.build_finite_elements();
174  // build adjacencies between elements and degrees of freedom
175  CHKERR m_field.build_adjacencies(bit_level0);
176 
177  // **** BUILD DM **** //
178  DM dm;
179  DMType dm_name = "DM_ELASTIC_MIX";
180  // Register DM problem
181  CHKERR DMRegister_MoFEM(dm_name);
182  CHKERR DMCreate(PETSC_COMM_WORLD, &dm);
183  CHKERR DMSetType(dm, dm_name);
184  // Create DM instance
185  CHKERR DMMoFEMCreateMoFEM(dm, &m_field, dm_name, bit_level0);
186  // Configure DM form line command options (DM itself, solvers,
187  // pre-conditioners, ... )
188  CHKERR DMSetFromOptions(dm);
189  // Add elements to dm (only one here)
190  CHKERR DMMoFEMAddElement(dm, "ELASTIC");
191  if (m_field.check_finite_element("PRESSURE_FE"))
192  CHKERR DMMoFEMAddElement(dm, "PRESSURE_FE");
193  if (m_field.check_finite_element("FORCE_FE"))
194  CHKERR DMMoFEMAddElement(dm, "FORCE_FE");
195  CHKERR DMMoFEMSetIsPartitioned(dm, is_partitioned);
196  // setup the DM
197  CHKERR DMSetUp(dm);
198 
199  DataAtIntegrationPts commonData(m_field);
200  CHKERR commonData.getParameters();
201 
202  boost::shared_ptr<FEMethod> nullFE;
203  boost::shared_ptr<VolumeElementForcesAndSourcesCore> feLhs(
204  new VolumeElementForcesAndSourcesCore(m_field));
205  boost::shared_ptr<VolumeElementForcesAndSourcesCore> feRhs(
206  new VolumeElementForcesAndSourcesCore(m_field));
207 
209 
210  // loop over blocks
211  for (auto &sit : commonData.setOfBlocksData) {
212 
213  feLhs->getOpPtrVector().push_back(
214  new OpAssembleP(commonData, sit.second));
215  feLhs->getOpPtrVector().push_back(
216  new OpAssembleK(commonData, sit.second));
217  feLhs->getOpPtrVector().push_back(
218  new OpAssembleG(commonData, sit.second));
219 
220  auto u_ptr = boost::make_shared<MatrixDouble>();
221 
222  post_proc.getOpPtrVector().push_back(
223  new OpCalculateVectorFieldValues<3>("U", u_ptr));
224  post_proc.getOpPtrVector().push_back(
225  new OpCalculateScalarFieldValues("P", commonData.pPtr));
226  post_proc.getOpPtrVector().push_back(
228  commonData.gradDispPtr));
229 
231 
232  post_proc.getOpPtrVector().push_back(
233 
234  new OpPPMap(
235 
236  post_proc.getPostProcMesh(), post_proc.getMapGaussPts(),
237  {{"P", commonData.pPtr}},
238 
239  {{"U", u_ptr}},
240 
241  {},
242 
243  {}));
244 
245  post_proc.getOpPtrVector().push_back(new OpPostProcStress(
246  post_proc.getPostProcMesh(), post_proc.getMapGaussPts(), commonData,
247  sit.second));
248  }
249 
250  Mat Aij; // Stiffness matrix
251  Vec d, F_ext; // Vector of DOFs and the RHS
252 
253  {
255  CHKERR VecZeroEntries(d);
256  CHKERR VecDuplicate(d, &F_ext);
257  CHKERR DMCreateMatrix_MoFEM(dm, &Aij);
258  CHKERR VecGhostUpdateBegin(d, INSERT_VALUES, SCATTER_FORWARD);
259  CHKERR VecGhostUpdateEnd(d, INSERT_VALUES, SCATTER_FORWARD);
260  CHKERR DMoFEMMeshToLocalVector(dm, d, INSERT_VALUES, SCATTER_REVERSE);
261  CHKERR MatZeroEntries(Aij);
262  }
263 
264  // Assign global matrix/vector
265  feLhs->ksp_B = Aij;
266  feLhs->ksp_f = F_ext;
267 
268  boost::shared_ptr<DirichletDisplacementBc> dirichlet_bc_ptr(
269  new DirichletDisplacementBc(m_field, "U", Aij, d, F_ext));
270  dirichlet_bc_ptr->snes_ctx = FEMethod::CTX_SNESNONE;
271  dirichlet_bc_ptr->ts_ctx = FEMethod::CTX_TSNONE;
272  CHKERR DMoFEMPreProcessFiniteElements(dm, dirichlet_bc_ptr.get());
273  CHKERR DMoFEMLoopFiniteElements(dm, "ELASTIC", feLhs);
274 
275  // Assemble pressure and traction forces.
276  boost::ptr_map<std::string, NeumannForcesSurface> neumann_forces;
277  CHKERR MetaNeumannForces::setMomentumFluxOperators(m_field, neumann_forces,
278  F_ext, "U");
279 
280  {
281  boost::ptr_map<std::string, NeumannForcesSurface>::iterator mit =
282  neumann_forces.begin();
283  for (; mit != neumann_forces.end(); mit++) {
284  CHKERR DMoFEMLoopFiniteElements(dm, mit->first.c_str(),
285  &mit->second->getLoopFe());
286  }
287  }
288  // Assemble forces applied to nodes
289  boost::ptr_map<std::string, NodalForce> nodal_forces;
290  CHKERR MetaNodalForces::setOperators(m_field, nodal_forces, F_ext, "U");
291 
292  {
293  boost::ptr_map<std::string, NodalForce>::iterator fit =
294  nodal_forces.begin();
295  for (; fit != nodal_forces.end(); fit++) {
296  CHKERR DMoFEMLoopFiniteElements(dm, fit->first.c_str(),
297  &fit->second->getLoopFe());
298  }
299  }
300  // Assemble edge forces
301  boost::ptr_map<std::string, EdgeForce> edge_forces;
302  CHKERR MetaEdgeForces::setOperators(m_field, edge_forces, F_ext, "U");
303 
304  {
305  boost::ptr_map<std::string, EdgeForce>::iterator fit =
306  edge_forces.begin();
307  for (; fit != edge_forces.end(); fit++) {
308  CHKERR DMoFEMLoopFiniteElements(dm, fit->first.c_str(),
309  &fit->second->getLoopFe());
310  }
311  }
312 
313  CHKERR DMoFEMPostProcessFiniteElements(dm, dirichlet_bc_ptr.get());
314  CHKERR DMMoFEMKSPSetComputeOperators(dm, "ELASTIC", feLhs, nullFE, nullFE);
315  CHKERR VecAssemblyBegin(F_ext);
316  CHKERR VecAssemblyEnd(F_ext);
317 
318  // **** SOLVE **** //
319 
320  KSP solver;
321 
322  CHKERR KSPCreate(PETSC_COMM_WORLD, &solver);
323  CHKERR KSPSetFromOptions(solver);
324  CHKERR KSPSetOperators(solver, Aij, Aij);
325  CHKERR KSPSetUp(solver);
326  CHKERR KSPSolve(solver, F_ext, d);
327 
328  // VecView(F_ext, PETSC_VIEWER_STDOUT_WORLD);
329  // CHKERR VecView(d, PETSC_VIEWER_STDOUT_WORLD); // Print out the results
330  CHKERR DMoFEMMeshToGlobalVector(dm, d, INSERT_VALUES, SCATTER_REVERSE);
331 
332  // Save data on mesh
333  CHKERR DMoFEMLoopFiniteElements(dm, "ELASTIC", &post_proc);
334  PetscPrintf(PETSC_COMM_WORLD, "Output file: %s\n", "out.h5m");
335  CHKERR post_proc.writeFile("out.h5m");
336 
337  CHKERR MatDestroy(&Aij);
338  CHKERR VecDestroy(&d);
339  CHKERR VecDestroy(&F_ext);
340  CHKERR DMDestroy(&dm);
341  }
342  CATCH_ERRORS;
343 
344  // finish work cleaning memory, getting statistics, etc
346  return 0;
347 }
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Definition: UnknownInterface.hpp:93
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:215
MetaNeumannForces::addNeumannBCElements
static MoFEMErrorCode addNeumannBCElements(MoFEM::Interface &m_field, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS", Range *intersect_ptr=NULL)
Declare finite element.
Definition: SurfacePressure.cpp:1974
MoFEM::CoreInterface::loop_dofs
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
H1
@ H1
continuous field
Definition: definitions.h:85
sdf_hertz.d
float d
Definition: sdf_hertz.py:5
MetaNodalForces::addElement
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const std::string field_name, Range *intersect_ptr=NULL)
Add element taking information from NODESET.
Definition: NodalForce.hpp:92
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
ElasticityMixedFormulation.hpp
MoFEM::PostProcBrokenMeshInMoabBase::getMapGaussPts
auto & getMapGaussPts()
Get vector of vectors associated to integration points.
Definition: PostProcBrokenMeshInMoabBase.hpp:637
MoFEM::OpCalculateVectorFieldValues
Get values at integration pts for tensor filed rank 1, i.e. vector field.
Definition: UserDataOperators.hpp:466
MoFEM::DMoFEMMeshToLocalVector
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition: DMMoFEM.cpp:527
BasicFiniteElements.hpp
MoFEM::Projection10NodeCoordsOnField
Projection of edge entities with one mid-node on hierarchical basis.
Definition: Projection10NodeCoordsOnField.hpp:24
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::DMMoFEMKSPSetComputeOperators
PetscErrorCode DMMoFEMKSPSetComputeOperators(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
Set KSP operators and push mofem finite element methods.
Definition: DMMoFEM.cpp:682
DirichletDisplacementBc
Set Dirichlet boundary conditions on displacements.
Definition: DirichletBC.hpp:57
MoFEM::CoreInterface::add_ents_to_field_by_type
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
main
int main(int argc, char *argv[])
Definition: elasticity_mixed_formulation.cpp:21
MoFEM::DMMoFEMAddElement
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
Definition: DMMoFEM.cpp:501
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
OpPostProcStress
Definition: ElasticityMixedFormulation.hpp:429
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
MetaNodalForces::setOperators
static MoFEMErrorCode setOperators(MoFEM::Interface &m_field, boost::ptr_map< std::string, NodalForce > &nodal_forces, Vec F, const std::string field_name)
Set integration point operators.
Definition: NodalForce.hpp:128
MoFEM::DMCreateGlobalVector_MoFEM
PetscErrorCode DMCreateGlobalVector_MoFEM(DM dm, Vec *g)
DMShellSetCreateGlobalVector.
Definition: DMMoFEM.cpp:1171
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
MoFEM::DMCreateMatrix_MoFEM
PetscErrorCode DMCreateMatrix_MoFEM(DM dm, Mat *M)
Definition: DMMoFEM.cpp:1201
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::MeshsetsManager::printForceSet
MoFEMErrorCode printForceSet() const
print meshsets with force boundary conditions data structure
Definition: MeshsetsManager.cpp:301
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
OpAssembleK
Assemble K *.
Definition: ElasticityMixedFormulation.hpp:311
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
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
MetaNeumannForces::setMomentumFluxOperators
static MoFEMErrorCode setMomentumFluxOperators(MoFEM::Interface &m_field, boost::ptr_map< std::string, NeumannForcesSurface > &neumann_forces, Vec F, const std::string field_name, const std::string mesh_nodals_positions="MESH_NODE_POSITIONS")
Set operators to finite elements calculating right hand side vector.
Definition: SurfacePressure.cpp:2069
MoFEM::CoreInterface::build_finite_elements
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
MoFEM::CoreInterface::add_field
virtual MoFEMErrorCode add_field(const std::string &name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
OpPPMap
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Definition: photon_diffusion.cpp:29
MoFEM::DMoFEMMeshToGlobalVector
PetscErrorCode DMoFEMMeshToGlobalVector(DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode)
set ghosted vector values on all existing mesh entities
Definition: DMMoFEM.cpp:539
MoFEM::OpCalculateScalarFieldValues
Get value at integration points for scalar field.
Definition: UserDataOperators.hpp:82
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:47
MoFEM::PostProcBrokenMeshInMoab< VolumeElementForcesAndSourcesCore >
Definition: PostProcBrokenMeshInMoabBase.hpp:670
OpAssembleP
Assemble P *.
Definition: ElasticityMixedFormulation.hpp:114
MoFEM::DMoFEMPreProcessFiniteElements
PetscErrorCode DMoFEMPreProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
Definition: DMMoFEM.cpp:550
MoFEM::DMoFEMPostProcessFiniteElements
PetscErrorCode DMoFEMPostProcessFiniteElements(DM dm, MoFEM::FEMethod *method)
execute finite element method for each element in dm (problem)
Definition: DMMoFEM.cpp:560
MoFEM::DMMoFEMCreateMoFEM
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
Definition: DMMoFEM.cpp:118
MoFEM::VolumeElementForcesAndSourcesCore
Volume finite element base.
Definition: VolumeElementForcesAndSourcesCore.hpp:26
MoFEM::MeshsetsManager::printMaterialsSet
MoFEMErrorCode printMaterialsSet() const
print meshsets with material data structure set on it
Definition: MeshsetsManager.cpp:322
mesh_file_name
char mesh_file_name[255]
Definition: mesh_smoothing.cpp:23
MoFEM::OpCalculateVectorFieldGradient
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Definition: UserDataOperators.hpp:1536
MetaEdgeForces::addElement
static MoFEMErrorCode addElement(MoFEM::Interface &m_field, const std::string field_name, Range *intersect_ptr=NULL)
Add element taking information from NODESET.
Definition: EdgeForce.hpp:62
MoFEM::CoreTmp< 0 >::Initialize
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:72
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
MoFEM::MeshsetsManager::printDisplacementSet
MoFEMErrorCode printDisplacementSet() const
print meshsets with displacement boundary conditions data structure
Definition: MeshsetsManager.cpp:287
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1094
std
Definition: enable_if.hpp:5
help
static char help[]
Definition: elasticity_mixed_formulation.cpp:17
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
MoFEM::ForcesAndSourcesCore::getOpPtrVector
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
Definition: ForcesAndSourcesCore.hpp:83
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
MoFEM::MeshsetsManager
Interface for managing meshsets containing materials and boundary conditions.
Definition: MeshsetsManager.hpp:104
MoFEM::CoreInterface::build_fields
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
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_filed)=0
set finite element field data
MoFEM::PostProcBrokenMeshInMoabBase::getPostProcMesh
auto & getPostProcMesh()
Get postprocessing mesh.
Definition: PostProcBrokenMeshInMoabBase.hpp:641
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEM::CoreInterface::build_adjacencies
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
MoFEM::CoreInterface::check_finite_element
virtual bool check_finite_element(const std::string &name) const =0
Check if finite element is in database.
MoFEM::CoreInterface::set_field_order
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
MoFEM::DMoFEMLoopFiniteElements
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
Definition: DMMoFEM.cpp:590
MoFEM::DMMoFEMSetIsPartitioned
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)
Definition: DMMoFEM.cpp:1127
OpAssembleG
Assemble G *.
Definition: ElasticityMixedFormulation.hpp:215
MetaEdgeForces::setOperators
static MoFEMErrorCode setOperators(MoFEM::Interface &m_field, boost::ptr_map< std::string, EdgeForce > &edge_forces, Vec F, const std::string field_name, std::string mesh_node_positions="MESH_NODE_POSITIONS")
Set integration point operators.
Definition: EdgeForce.hpp:97
MoFEM::OpPostProcMapInMoab
Post post-proc data at points from hash maps.
Definition: PostProcBrokenMeshInMoabBase.hpp:698