7 {
9
10 try {
11
12 moab::Core mb_instance;
13 moab::Interface &moab = mb_instance;
14 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
15 if (pcomm == NULL)
16 pcomm = new ParallelComm(&moab, PETSC_COMM_WORLD);
17
18
21
22
24 char mesh_out_file[255] = "out.h5m";
25 int dim = 3;
26 PetscBool flg_file;
27
28 PetscOptionsBegin(PETSC_COMM_WORLD, "", "none", "none");
30
31 CHKERR PetscOptionsString(
"-file_name",
"mesh file name",
"",
"mesh.h5m",
33 CHKERR PetscOptionsString(
"-output_file",
"output mesh file name",
"",
34 mesh_out_file, mesh_out_file, 255, PETSC_NULLPTR);
35 CHKERR PetscOptionsInt(
"-dim",
"mesh dimension",
"", dim, &dim, PETSC_NULLPTR);
36
37
38 PetscOptionsEnd();
39
40 if (flg_file != PETSC_TRUE)
41 SETERRQ(PETSC_COMM_SELF, 1,
42 "*** ERROR -my_file (-file_name) (MESH FILE NEEDED)");
43
45 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Out file " << mesh_out_file;
46 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Mesh dimension " << dim;
47
48 const char *option;
49 option = "";
51
53 CHKERR moab.get_entities_by_dimension(0, dim, ents);
54 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Ents:\n" << ents;
55
56 Skinner skinner(&moab);
57 CHKERR skinner.find_skin(0, ents,
false, skin);
58 MOFEM_LOG(
"WORLD", Sev::verbose) <<
"Skin:\n" << skin;
59
61 CHKERR moab.create_meshset(MESHSET_SET, set);
62 CHKERR moab.add_entities(set, skin);
63
64 CHKERR moab.write_file(mesh_out_file,
"MOAB",
"", &set, 1);
65 }
67
69
70 return 0;
71}
#define CATCH_ERRORS
Catch errors.
#define MYPCOMM_INDEX
default communicator number PCOMM
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
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.