v0.16.3
Loading...
Searching...
No Matches
mesh_reconstruction.cpp
/** \file mesh_reconstruction.cpp
* \example mesh_reconstruction.cpp
*/
#include <MoFEM.hpp>
#include <iomanip>
using namespace MoFEM;
struct Example {
currentPtr = std::make_unique<Mesh>();
CHKERR saveStage(*currentPtr, "01_sphere", false);
CHKERR saveStage(*currentPtr, "02_partitioned", false);
CHKERR saveStage(*currentPtr, "03_distributed", true);
for (PetscInt step = 1; step <= stretchSteps; ++step) {
CHKERR saveStage(*currentPtr, "04_ellipsoid", true, step);
CHKERR saveStage(*currentPtr, "05_reconstructed", false, step);
CHKERR saveStage(*currentPtr, "06_synchronised", true, step);
}
MOFEM_LOG("WORLD", Sev::inform)
<< "Completed " << stretchSteps << " stretch/reconstruction steps";
}
private:
// Keep each MOAB database alive until its MoFEM interfaces are destroyed.
// Keep entity handles stable across reconstruction for DM/storage reuse.
struct Mesh {
moab::Core database;
bool sharingReady = false;
bool registrationChanged = true;
};
std::unique_ptr<Mesh> currentPtr;
PetscInt stretchSteps = 10;
PetscInt hybridOrder = 2;
double twistDegrees = 60;
std::array<double, 3> scale{2, 1, .75};
std::string script;
// Complete rank-local work before deciding collectively whether to continue.
int error;
CHKERR MPI_Allreduce(&local_error, &error, 1, MPI_INT, MPI_MAX,
currentPtr->field.get_comm());
if (error)
SETERRQ(currentPtr->field.get_comm(), error,
"Mesh stage failed on an MPI rank");
}
currentPtr->field.getInterface<JsonConfigManager>();
char file[PETSC_MAX_PATH_LEN] = "sphere.py";
CHKERR PetscOptionsGetString(nullptr, nullptr, "-sdf_file", file,
sizeof(file), nullptr);
script = file;
CHKERR PetscOptionsGetInt(nullptr, nullptr, "-hybrid_order", &hybridOrder,
nullptr);
if (hybridOrder < 1)
SETERRQ(currentPtr->field.get_comm(), MOFEM_INVALID_DATA,
"hybrid_order must be positive");
CHKERR PetscOptionsGetReal(nullptr, nullptr, "-twist_degrees",
&twistDegrees, nullptr);
if (!std::isfinite(twistDegrees))
SETERRQ(currentPtr->field.get_comm(), MOFEM_INVALID_DATA,
"twist_degrees must be finite");
CHKERR PetscOptionsGetInt(nullptr, nullptr, "-stretch_steps", &stretchSteps,
nullptr);
if (stretchSteps < 1)
SETERRQ(currentPtr->field.get_comm(), MOFEM_INVALID_DATA,
"stretch_steps must be positive");
CHKERR PetscOptionsGetReal(nullptr, nullptr, "-cell_size",
&settings.cellSize, nullptr);
CHKERR PetscOptionsGetReal(nullptr, nullptr, "-facet_size",
&settings.facetSize, nullptr);
CHKERR PetscOptionsGetReal(nullptr, nullptr, "-facet_distance",
&settings.facetDistance, nullptr);
CHKERR PetscOptionsGetReal(nullptr, nullptr, "-bounding_radius",
&settings.radius, nullptr);
for (int d = 0; d != 3; ++d) {
const std::string option = std::string("-scale_") + "xyz"[d];
CHKERR PetscOptionsGetReal(nullptr, nullptr, option.c_str(), &scale[d],
nullptr);
if (!std::isfinite(scale[d]) || scale[d] <= 0)
SETERRQ(currentPtr->field.get_comm(), MOFEM_INVALID_DATA,
"Scaling must be positive");
}
}
if (currentPtr->field.get_comm_rank())
CHKERR sdf.sdfInit(script);
auto cgal = currentPtr->field.getInterface<CGALInterface>();
sphere, [&](const auto &point) { return sdf.value(point); }, settings);
EntityHandle volume, surface;
CHKERR cgal->importMesh(sphere, BitRefLevel().set(0), currentPtr->entities,
volume, surface);
const int owner = 0;
auto *pc =
ParallelComm::get_pcomm(&currentPtr->field.get_moab(), MYPCOMM_INDEX);
CHKERR currentPtr->field.get_moab().tag_clear_data(
pc->part_tag(), currentPtr->entities, &owner);
}
CHKERR currentPtr->hybrid.prepareUpdate();
currentPtr->sharingReady = false;
currentPtr->registrationChanged = true;
auto comm = currentPtr->field.getInterface<CommInterface>();
EntityHandle volume, surface;
MoFEMErrorCode error = 0;
if (currentPtr->field.get_comm_rank())
error = currentPtr->field.getInterface<CGALInterface>()->importMesh(
sphere, BitRefLevel().set(0), currentPtr->entities, volume, surface);
CHKERR agree(error);
const int initial_owner = 0;
auto &mb = currentPtr->field.get_moab();
auto *pc = ParallelComm::get_pcomm(&mb, MYPCOMM_INDEX);
CHKERR mb.tag_clear_data(pc->part_tag(), currentPtr->entities,
&initial_owner);
CHKERR comm->partitionMesh(currentPtr->entities.subset_by_type(MBTET), 3, 2,
currentPtr->field.get_comm_size(), nullptr,
nullptr, nullptr, QUIET, false, true);
}
}
MoFEMErrorCode deformMesh(PetscInt step) {
auto &mb = currentPtr->field.get_moab();
const double before = static_cast<double>(step - 1) / stretchSteps;
const double after = static_cast<double>(step) / stretchSteps;
std::array<double, 3> old_scale, new_scale;
for (int d = 0; d != 3; ++d) {
old_scale[d] = 1. + before * (scale[d] - 1.);
new_scale[d] = 1. + after * (scale[d] - 1.);
}
// Relative twist between the original unit sphere's x=-1 and x=+1 planes.
const double angle_increment =
.5 * twistDegrees * std::acos(-1.) / 180. / stretchSteps;
for (auto vertex : currentPtr->entities.subset_by_type(MBVERTEX)) {
std::array<double, 3> x;
CHKERR mb.get_coords(&vertex, 1, x.data());
for (int d = 0; d != 3; ++d)
x[d] /= old_scale[d];
const double angle = angle_increment * x[0];
const double c = std::cos(angle), s = std::sin(angle);
const std::array<double, 3> rotated{x[0], c * x[1] - s * x[2],
s * x[1] + c * x[2]};
for (int d = 0; d != 3; ++d)
x[d] = new_scale[d] * rotated[d];
CHKERR mb.set_coords(&vertex, 1, x.data());
}
}
static auto cellKeys(const TetMeshData &mesh) {
std::set<std::array<int, 4>> keys;
for (const auto &cell : mesh.cells) {
std::array<int, 4> ids;
for (int d = 0; d != 4; ++d)
ids[d] = mesh.vertexIds[cell[d]];
std::sort(ids.begin(), ids.end());
keys.insert(ids);
}
return keys;
}
static auto skinKeys(const TetMeshData &mesh) {
std::map<std::array<int, 3>, int> incidence;
for (const auto &cell : mesh.cells)
for (int opposite = 0; opposite != 4; ++opposite) {
std::array<int, 3> face;
int n = 0;
for (int d = 0; d != 4; ++d)
if (d != opposite)
face[n++] = mesh.vertexIds[cell[d]];
std::sort(face.begin(), face.end());
++incidence[face];
}
std::set<std::array<int, 3>> skin;
for (const auto &[face, count] : incidence)
if (count == 1)
skin.insert(face);
return skin;
}
if (!currentPtr->field.get_comm_rank()) {
currentPtr->field.getInterface<CGALInterface>()
->getTools()
auto changes = [](const auto &before, const auto &after) {
const auto retained =
std::count_if(before.begin(), before.end(),
[&](const auto &key) { return after.count(key); });
return std::make_pair(before.size() - retained,
after.size() - retained);
};
const auto cells = changes(cellKeys(sourceMesh), cellKeys(reconstructed));
const auto skin = changes(skinKeys(sourceMesh), skinKeys(reconstructed));
MOFEM_LOG("WORLD", Sev::inform)
<< "Step " << step << "/" << stretchSteps << ": tetrahedra removed "
<< cells.first << ", added " << cells.second
<< "; skin triangles removed " << skin.first << ", added "
<< skin.second;
}
}
CHKERR currentPtr->hybrid.prepareUpdate();
auto source_comm = currentPtr->field.getInterface<CommInterface>();
auto output_comm = currentPtr->field.getInterface<CommInterface>();
CHKERR source_comm->gatherMesh(currentPtr->entities.subset_by_type(MBTET),
// Keep surviving handles and the parent DM; discard only older lineage.
currentPtr->activeBit = BitRefLevel().set(1);
currentPtr->sharingReady = false;
currentPtr->registrationChanged = true;
auto cgal = currentPtr->field.getInterface<CGALInterface>();
EntityHandle volume, surface;
CHKERR agree(cgal->importMesh(sourceMesh, BitRefLevel().set(0),
sourceLineage, volume, surface));
CHKERR agree(cgal->importMesh(reconstructed, BitRefLevel().set(1),
currentPtr->entities, volume, surface));
sourceLineage, currentPtr->entities, BitRefLevel().set(1)));
output_comm->inheritPartitions(sourceLineage, currentPtr->entities));
}
// Detach obsolete registration before importing into the persistent database.
// Full indexed descriptions are still broadcast; this is not delta transport.
auto &field = currentPtr->field;
auto &mb = field.get_moab();
Range geometry;
CHKERR mb.get_entities_by_handle(0, geometry);
geometry = subtract(geometry, geometry.subset_by_type(MBENTITYSET));
// Surviving handles keep their field DOFs. Obsolete lineage is removed
// below; the hybrid update prunes field/FE membership to the active set.
// BitRefManager's setters add bits. Clear the previous active selector
// before assigning this step's source/output bits to surviving handles.
const BitRefLevel no_bits;
CHKERR mb.tag_clear_data(field.get_basic_entity_data_ptr()->th_RefBitLevel,
geometry, &no_bits);
const EntityHandle no_parent = 0;
CHKERR mb.tag_clear_data(
field.getInterface<BitRefManager>()->get_th_RefParentHandle(), geometry,
&no_parent);
auto *pc = ParallelComm::get_pcomm(&mb, MYPCOMM_INDEX);
const unsigned char unshared = 0;
CHKERR mb.tag_clear_data(pc->pstatus_tag(), geometry, &unshared);
for (auto tag : {pc->sharedp_tag(), pc->sharedps_tag(), pc->sharedh_tag(),
pc->sharedhs_tag()}) {
const auto error = mb.tag_delete_data(tag, geometry);
if (error != MB_SUCCESS && error != MB_TAG_NOT_FOUND)
CHKERR error;
}
Range sets = pc->interface_sets();
sets.merge(pc->partition_sets());
CHKERR mb.delete_entities(sets);
// Recreating this registry clears MOAB's private shared-entity table too.
// The mesh, MoFEM core and parent DM remain alive.
delete pc;
int id = -1;
pc = new ParallelComm(&mb, field.get_comm(), &id);
if (id != MYPCOMM_INDEX)
SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
"Unexpected ParallelComm index after resetting sharing");
CHKERR deleteGeometry(subtract(geometry, currentPtr->entities));
sourceLineage.clear();
}
if (remove.empty())
auto &field = currentPtr->field;
auto &mb = field.get_moab();
CHKERR field.remove_ents(remove, QUIET);
Range sets;
CHKERR mb.get_entities_by_type(0, MBENTITYSET, sets);
for (auto set : sets)
CHKERR mb.remove_entities(set, remove);
for (int dim = 3; dim >= 0; --dim) {
const auto batch = remove.subset_by_dimension(dim);
if (!batch.empty())
CHKERR mb.delete_entities(batch);
}
}
auto trim_lineage = [&]() {
if (!currentPtr->field.get_comm_rank())
auto &field = currentPtr->field;
auto &mb = field.get_moab();
Range needed = currentPtr->entities;
const auto parent_tag =
field.getInterface<BitRefManager>()->get_th_RefParentHandle();
for (auto entity : currentPtr->entities) {
EntityHandle parent = 0;
CHKERR mb.tag_get_data(parent_tag, &entity, 1, &parent);
if (parent)
needed.insert(parent);
}
for (int dim = 2; dim >= 0; --dim) {
CHKERR mb.get_adjacencies(needed.subset_by_dimension(dim + 1), dim,
false, closure, moab::Interface::UNION);
needed.merge(closure);
}
const auto remove = subtract(sourceLineage, needed);
if (remove.empty())
sourceLineage = intersect(sourceLineage, needed);
};
CHKERR agree(trim_lineage());
}
MoFEMErrorCode prepareDistributed(Mesh &mesh, const Range &preserve = {}) {
auto &field = mesh.field;
auto &mb = field.get_moab();
auto *pc = ParallelComm::get_pcomm(&mb, MYPCOMM_INDEX);
if (!mesh.sharingReady) {
CHKERR mesh.hybrid.prepareUpdate();
auto retain = [&]() {
if (!field.get_comm_rank())
const auto cells = mesh.entities.subset_by_type(MBTET);
Range owned, vertices, halo;
for (auto cell : cells) {
int owner;
CHKERR mb.tag_get_data(pc->part_tag(), &cell, 1, &owner);
if (owner == field.get_comm_rank())
owned.insert(cell);
}
CHKERR mb.get_connectivity(owned, vertices, true);
CHKERR mb.get_adjacencies(vertices, 3, false, halo,
moab::Interface::UNION);
// A reconstructed face inherits its representative parent's owner.
// That rank need not own either incident output cell. Keep both cells
// for every preferred-owned face as well as the owned-cell halo.
Range owned_faces, face_cells;
for (auto face : mesh.entities.subset_by_type(MBTRI)) {
int owner;
CHKERR mb.tag_get_data(pc->part_tag(), &face, 1, &owner);
if (owner == field.get_comm_rank())
owned_faces.insert(face);
}
CHKERR mb.get_adjacencies(owned_faces, 3, false, face_cells,
moab::Interface::UNION);
halo.merge(face_cells);
// Select only the active reconstruction, never inactive lineage cells.
halo = intersect(halo, cells);
for (int dim : {0, 1, 2}) {
CHKERR mb.get_adjacencies(halo.subset_by_type(MBTET), dim, false,
closure, moab::Interface::UNION);
halo.merge(closure);
}
Range protected_entities = preserve;
protected_entities.merge(halo);
CHKERR field.getInterface<CommInterface>()->retainPartition(
mesh.entities, mesh.activeBit, protected_entities);
mesh.entities = halo;
};
CHKERR agree(retain());
CHKERR field.getInterface<BitRefManager>()->setBitRefLevel(
mesh.entities, mesh.activeBit, false);
CHKERR field.getInterface<CommInterface>()->synchroniseByConnectivity(
mesh.entities, 0);
mesh.sharingReady = true;
}
int owned = 0, invalid = 0;
for (auto cell : mesh.entities.subset_by_type(MBTET)) {
int owner;
unsigned char status;
CHKERR mb.tag_get_data(pc->part_tag(), &cell, 1, &owner);
CHKERR pc->get_pstatus(cell, status);
owned += owner == field.get_comm_rank();
invalid += owner != field.get_comm_rank() && !(status & PSTATUS_GHOST);
}
int global_owned, root_cells = mesh.entities.num_of_type(MBTET);
CHKERR MPI_Allreduce(&owned, &global_owned, 1, MPI_INT, MPI_SUM,
field.get_comm());
CHKERR MPI_Bcast(&root_cells, 1, MPI_INT, 0, field.get_comm());
auto testing_ptr = field.getInterface<TestingInterface>();
const auto zero = TestingInterface::Tolerance{0, 0};
CHKERR testing_ptr->checkValue<TestType::SCALAR>(
"root retains every owned cell", root_cells, global_owned, zero);
CHKERR testing_ptr->checkValue<TestType::SCALAR>(
"off-partition residents are ghost cells", invalid, 0, zero);
CHKERR pc->check_all_shared_handles();
}
MoFEMErrorCode rebuildHybrid(Mesh &mesh, const std::string &tag) {
auto &field = mesh.field;
auto &mb = field.get_moab();
std::vector<std::array<int, 3>> keys;
auto find_interior = [&]() {
if (field.get_comm_rank())
const auto tets = mesh.entities.subset_by_type(MBTET);
CHKERR mb.get_adjacencies(tets, 2, true, faces, moab::Interface::UNION);
Skinner skinner(&mb);
CHKERR skinner.find_skin(0, tets, false, skin);
for (auto face : subtract(faces, skin)) {
const EntityHandle *conn;
int n;
std::array<int, 3> ids;
CHKERR mb.get_connectivity(face, conn, n, true);
CHKERR mb.tag_get_data(mb.globalId_tag(), conn, 3, ids.data());
std::sort(ids.begin(), ids.end());
keys.push_back(ids);
}
if (keys.size() > static_cast<size_t>(INT_MAX) / 3)
SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED,
"Skeleton exceeds MPI count range");
};
CHKERR agree(find_interior());
int count = keys.size();
CHKERR MPI_Bcast(&count, 1, MPI_INT, 0, field.get_comm());
keys.resize(count);
CHKERR MPI_Bcast(keys.data(), 3 * count, MPI_INT, 0, field.get_comm());
const std::set<std::array<int, 3>> interior(keys.begin(), keys.end());
Range skeleton;
auto select_skeleton = [&]() {
for (auto face : mesh.entities.subset_by_type(MBTRI)) {
const EntityHandle *conn;
int n;
std::array<int, 3> ids;
CHKERR mb.get_connectivity(face, conn, n, true);
CHKERR mb.tag_get_data(mb.globalId_tag(), conn, 3, ids.data());
std::sort(ids.begin(), ids.end());
if (interior.count(ids))
skeleton.insert(face);
}
};
CHKERR agree(select_skeleton());
CHKERR mesh.hybrid.build(mesh.entities, skeleton, mesh.activeBit,
hybridOrder, mesh.registrationChanged);
CHKERR mesh.hybrid.validate(mesh.entities, skeleton, hybridOrder, tag);
mesh.registrationChanged = false;
}
MoFEMErrorCode saveStage(Mesh &mesh, const char *stage, bool distributed,
PetscInt step = 0) {
auto &m_field = mesh.field;
const auto &entities = mesh.entities;
std::ostringstream name;
name << stage;
if (step)
name << "_" << std::setw(4) << std::setfill('0') << step;
name << ".h5m";
const auto file = name.str();
auto write = [&]() {
if (!distributed && m_field.get_comm_rank())
auto &mb = m_field.get_moab();
EntityHandle selection;
CHKERR mb.create_meshset(MESHSET_SET, selection);
CHKERR mb.add_entities(selection, entities);
Tag summary_tag;
CHKERR mb.tag_get_handle("FUN3_HYBRID_COUNTS", 5, MB_TYPE_DOUBLE,
summary_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
CHKERR mb.tag_set_data(summary_tag, &selection, 1,
mesh.hybrid.summary.data());
auto pc = ParallelComm::get_pcomm(&mb, MYPCOMM_INDEX);
auto tag = pc->part_tag();
Range parts;
CHKERR mb.get_entities_by_type_and_tag(0, MBENTITYSET, &tag, nullptr, 1,
parts);
CHKERR mb.add_entities(selection, parts);
CHKERR mb.write_file(file.c_str(), "MOAB",
distributed ? "PARALLEL=WRITE_PART" : "", &selection,
1);
CHKERR mb.delete_entities(&selection, 1);
};
CHKERR agree(write());
MOFEM_LOG("WORLD", Sev::inform) << "Saved " << file;
}
};
int main(int argc, char *argv[]) {
&argc, &argv, nullptr,
"Sphere, partition, stretch, twist and reconstruct a mesh\n");
try {
CHKERR SDFPython::initialise();
{
CHKERR DMRegister_MoFEM("DMMOFEM");
}
CHKERR SDFPython::finalise();
}
return 0;
}
CGALInterfaceImpl & owner
std::vector< std::array< EntityHandle, 3 > > faces
Sorted keys.
FaceSet skin
bool angle
Radians between candidate face and target plane.
WorkMesh mesh
std::vector< int > vertices
std::vector< int > parent
bool closure
The face (f0, f1, w) closes a corner at f0 or f1.
std::vector< Cell > cells
unsigned char status
ParentChildKey key
MPI_Comm comm
moab::Interface & mb
Tag tag
ProjectedField & field
Reusable hybrid algebra and graph validation for FUN-3.
std::string name
int main()
@ QUIET
#define CATCH_ERRORS
Catch errors.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
@ MOFEM_INVALID_DATA
Definition definitions.h:36
@ 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.
#define MOFEM_LOG(channel, severity)
Log.
const double c
speed of light (cm/ns)
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
Definition sdf.py:1
MoFEM::CoreTmp<-1 > core
Fun3::HybridProblem hybrid
MoFEM::Interface & field
[Example]
Definition plastic.cpp:209
std::unique_ptr< Mesh > currentPtr
TetMeshData reconstructed
MoFEMErrorCode rebuildHybrid(Mesh &mesh, const std::string &tag)
MoFEMErrorCode deleteGeometry(const Range &remove)
MoFEMErrorCode generateSphere()
CGALTools::ImplicitMeshSettings settings
PetscInt stretchSteps
TetMeshData sourceMesh
TetMeshData sphere
MoFEMErrorCode distributeSphere()
MoFEMErrorCode reconstructOnRoot(PetscInt step)
static auto skinKeys(const TetMeshData &mesh)
MoFEMErrorCode reconstructMesh(PetscInt step)
MoFEMErrorCode saveStage(Mesh &mesh, const char *stage, bool distributed, PetscInt step=0)
MoFEMErrorCode run()
static auto cellKeys(const TetMeshData &mesh)
std::string script
MoFEMErrorCode readOptions()
MoFEMErrorCode synchroniseMesh()
MoFEMErrorCode resetMeshForImport()
MoFEMErrorCode deformMesh(PetscInt step)
MoFEMErrorCode partitionSphere()
PetscInt hybridOrder
MoFEMErrorCode agree(MoFEMErrorCode local_error)
MoFEMErrorCode prepareDistributed(Mesh &mesh, const Range &preserve={})
std::array< double, 3 > scale
Retain the parent/sub-DMs, field DOFs and block storage across mesh edits.
Managing BitRefLevels.
Tag get_th_RefParentHandle() const
virtual CGALTools & getTools()=0
virtual MoFEMErrorCode importMesh(const TetMeshData &data, BitRefLevel bit, Range &entities, EntityHandle &volume, EntityHandle &surface)=0
virtual MoFEMErrorCode reconstructDelaunay(const Range &source_entities, BitRefLevel output_bit, Range &entities, CGALTools::ReconstructionMethod method=CGALTools::ReconstructionMethod::PointDelaunay)=0
void createImplicitMesh(TetMeshData &result, const std::function< double(const std::array< double, 3 > &)> &sdf, const ImplicitMeshSettings &settings) const
Managing BitRefLevels.
MoFEMErrorCode inheritPartitions(const Range &source_entities, const Range &child_entities)
MoFEMErrorCode gatherMesh(const Range &cells, TetMeshData &data, int root=0)
MoFEMErrorCode broadcastMesh(TetMeshData &data, int root=0)
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
Deprecated interface functions.
Mesh refinement interface.
MoFEMErrorCode setTopologicalParents(const Range &source_entities, const Range &child_entities, const BitRefLevel &output_bit, int verb=QUIET, const std::map< EntityHandle, EntityHandle > &moved_vertices={})
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.