v0.16.3
Loading...
Searching...
No Matches
AuxiliaryLogarithmicStressTestSetup.hpp
Go to the documentation of this file.
1/**
2 * @file AuxiliaryLogarithmicStressTestSetup.hpp
3 * @brief Shared mesh and problem setup for auxiliary formulation atoms.
4 */
5
6#ifndef AUXILIARY_LOGARITHMIC_STRESS_TEST_SETUP_HPP
7#define AUXILIARY_LOGARITHMIC_STRESS_TEST_SETUP_HPP
8
10
12
14 const std::function<MoFEMErrorCode(EshelbianCore &)> &test) {
16 CHKERR JsonConfigManager::setMeshFileFromJson();
17 char mesh_file[PETSC_MAX_PATH_LEN] = "";
18 PetscBool found;
19 CHKERR PetscOptionsGetString(nullptr, nullptr, "-file_name", mesh_file,
20 sizeof(mesh_file), &found);
21 if (!found)
22 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID,
23 "Missing JSON mesh fixture");
24 CHKERR DMRegister_MoFEM("DMMOFEM");
25 moab::Core moab;
26 auto *parallel = new ParallelComm(&moab, PETSC_COMM_WORLD);
27 CHKERR CommInterface::loadFileRootProcAllRestDistributed(moab, mesh_file,
28 SPACE_DIM);
29 MoFEM::Core core(moab);
30 MoFEM::Interface &m_field = core;
31 CHKERR m_field.getInterface<MeshsetsManager>()->setMeshsetFromFile();
32 CHKERR m_field.getInterface<BitRefManager>()->setBitRefLevelByDim(
33 0, SPACE_DIM, BitRefLevel().set(0));
34 EshelbianCore ep(m_field);
35 auto meshset = get_temp_meshset_ptr(moab);
36 const auto part = CommInterface::getPartEntities(moab, parallel->rank());
37 CHKERR moab.add_entities(*meshset, part);
38 for (const int dim : {0, 1, 2}) {
39 Range adjacent;
40 CHKERR moab.get_adjacencies(part.subset_by_dimension(SPACE_DIM), dim, false,
41 adjacent, moab::Interface::UNION);
42 CHKERR moab.add_entities(*meshset, adjacent);
43 }
44 CHKERR ep.createCrackSurfaceMeshset();
45 CHKERR ep.getSpatialDispBc();
46 CHKERR ep.getSpatialRotationBc();
47 CHKERR ep.getSpatialTractionBc();
48 CHKERR ep.getSpatialTractionFreeBc();
49 CHKERR ep.getExternalStrain();
50 CHKERR ep.setBlockTagsOnSkin();
51 CHKERR ep.createExchangeVectors(Sev::inform);
53 CHKERR ep.resolveDissipationEntities(*meshset);
54 CHKERR ep.addFields(*meshset);
55 CHKERR ep.projectGeometry(*meshset, 0.);
56 CHKERR ep.addVolumeFiniteElement(*meshset);
57 CHKERR ep.addBoundaryFiniteElement(*meshset);
58 CHKERR ep.addDMs();
59 CHKERR test(ep);
61}
62
63} // namespace EshelbianPlasticity
64
65#endif
Eshelbian plasticity interface.
constexpr int SPACE_DIM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
MoFEMErrorCode runAuxiliaryLogarithmicStressTest(const std::function< MoFEMErrorCode(EshelbianCore &)> &test)
static MoFEMErrorCode create(EshelbianCore &ep)
Select and configure the material before registering fields and DMs.
Core (interface) class.
Definition Core.hpp:83
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.