18int main(
int argc,
char *argv[]) {
24 moab::Core mb_instance;
25 moab::Interface &moab = mb_instance;
27 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
30 PetscBool flg = PETSC_TRUE;
31 char mesh_file_name[255];
32#if PETSC_VERSION_GE(3, 6, 4)
37 mesh_file_name, 255, &flg);
39 if (flg != PETSC_TRUE) {
40 SETERRQ(PETSC_COMM_SELF, 1,
"*** ERROR -my_file (MESH FILE NEEDED)");
46 CHKERR moab.load_file(mesh_file_name, 0, option);
61 for (; ii < 2; ii++) {
69 ->getEntitiesByTypeAndRefLevel(bit_level0,
BitRefLevel().set(),
71 Range::iterator eit = edges.begin();
75 CHKERR moab.get_connectivity(*eit, conn, num_nodes,
true);
80 CHKERR moab.create_meshset(MESHSET_SET, meshset_level1);
82 ->getEntitiesByTypeAndRefLevel(bit_level1,
BitRefLevel().set(), MBTET,
85 std::ostringstream ss;
86 ss <<
"node_merger_" << ii <<
".vtk";
89 CHKERR moab.write_file(ss.str().c_str(),
"VTK",
"", &meshset_level1, 1);
90 bit_level0 = bit_level1;
97 std::cout << tets << std::endl;
98 if (tets.size() != 10) {
100 "diffrent number of tets than expected = %u", tets.size());
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
MoFEMErrorCode mergeNodes(EntityHandle father, EntityHandle mother, Range &out_tets, Range *tets_ptr=NULL, const bool only_if_improve_quality=false, const double move=0, const int line_search=0, Tag th=NULL, const int verb=0)
merge nodes which sharing edge