16 {
17
19
20 try {
21
24 char mesh_out_file[255] = "out.h5m";
25
26 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Prism surface",
"none");
27 CHKERR PetscOptionsString(
"-my_file",
"mesh file name",
"",
"mesh.h5m",
29 CHKERR PetscOptionsString(
"-output_file",
"output mesh file name",
"",
30 "out.h5m", mesh_out_file, 255, PETSC_NULL);
31 ierr = PetscOptionsEnd();
33
36 "error -my_file (mesh file needed)");
37
38 moab::Core mb_instance;
39 moab::Interface &moab = mb_instance;
40 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
41 if (pcomm == NULL)
42 pcomm = new ParallelComm(&moab, PETSC_COMM_WORLD);
43
44 const char *option;
45 option = "";
47
51
54
55 const std::string extrude_block_name = "EXTRUDE_PRISMS";
57 if (it->getName().compare(0, extrude_block_name.length(),
58 extrude_block_name) == 0) {
59 std::vector<double> thickness;
60 CHKERR it->getAttributes(thickness);
61 if (thickness.size() != 2)
63 "Data inconsistency");
65 CHKERR m_field.
get_moab().get_entities_by_type(it->meshset, MBTRI, tris,
66 true);
71 block_prisms, thickness[0], thickness[1]);
73 block_prisms);
75 block_prisms);
76
77 std::cout << "Extrude block " << it->getMeshsetId() << " set prisms "
78 << block_prisms.size() << endl;
79 }
80 }
81
82 CHKERR moab.write_file(mesh_out_file);
83 }
85
87
88 return 0;
89}
#define CATCH_ERRORS
Catch errors.
#define MYPCOMM_INDEX
default communicator number PCOMM
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
@ MOFEM_DATA_INCONSISTENCY
#define CHKERR
Inline error check.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
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.
merge node from two bit levels
MoFEMErrorCode setNormalThickness(const Range &prisms, double thickness3, double thickness4)
MoFEMErrorCode createPrisms(const Range &ents, const SwapType swap_type, Range &prisms, int verb=-1)
Make prisms from triangles.
MoFEMErrorCode updateMeshestByEdgeBlock(const Range &prisms)
Add quads to bockset.
MoFEMErrorCode updateMeshestByTriBlock(const Range &prisms)
Add prism to bockset.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.