Create blockset and add entities. Next check if entities are in the blockset.
static char help[] =
"...\n\n";
int main(
int argc,
char *argv[]) {
try {
const char *option = "";
CHKERR moab.load_file(
"rectangle_tri.h5m", 0, option);
auto meshsets_mng = m_field.
getInterface<MeshsetsManager>();
auto get_ents_on_mesh_skin = [&]() {
Range faces;
Range skin_edges;
CHKERR skin.find_skin(0, faces,
false, skin_edges);
Range skin_verts;
CHKERR moab.get_connectivity(skin_edges, skin_verts,
true);
skin_edges.merge(skin_verts);
return skin_edges;
};
auto add_blockset = [&](const Range skin_ents) {
};
auto print_blocksets = [&]() {
for (auto &it : meshsets_mng->getMeshsetsMultindex())
cout << it << endl;
};
auto check_meshset = [&](const Range skin_ents) {
std::vector<EntityHandle> ents(skin_ents.size());
std::copy(skin_ents.begin(), skin_ents.end(), ents.begin());
const bool test = meshsets_mng->checkIfMeshsetContainsEntities(
1,
BLOCKSET, &*ents.begin(), ents.size());
if (!test)
"All entities should be in blockset");
};
auto skin_ents = get_ents_on_mesh_skin();
CHKERR add_blockset(skin_ents);
CHKERR check_meshset(skin_ents);
}
}
int main(int argc, char *argv[])
#define CATCH_ERRORS
Catch errors.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
implementation of Data Operators for Forces and Sources
DeprecatedCoreInterface Interface
virtual moab::Interface & get_moab()=0
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.