12static char help[] =
"...\n\n";
14int main(
int argc,
char *argv[]) {
20 char mesh_file_name[255];
21 PetscBool flg_file = PETSC_FALSE;
22 char field_name_param[255] =
"RHO";
23 PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Field to vertices options",
25 CHKERR PetscOptionsString(
"-my_file",
"mesh file name",
"",
"mesh.h5m",
26 mesh_file_name, 255, &flg_file);
27 CHKERR PetscOptionsString(
"-my_field",
"field name",
"",
"FIELD",
28 field_name_param, 255, PETSC_NULLPTR);
33 moab::Core mb_instance;
34 moab::Interface &moab = mb_instance;
35 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
37 pcomm =
new ParallelComm(&moab, PETSC_COMM_WORLD);
40 CHKERR moab.load_file(mesh_file_name, 0, option);
46 if (flg_file != PETSC_TRUE) {
48 "*** ERROR -my_file (MESH FILE NEEDED)");
56 bool field_flg =
false;
58 for (
auto field : (*fields_ptr)) {
59 bool check_space = field->getSpace() ==
H1;
60 if (field->getName() ==
field_name && check_space)
65 "*** ERROR -my_field (FIELD (in H1 space) is NOT FOUND)");
72 PetscPrintf(PETSC_COMM_WORLD,
"\nDone. Saving files... \n");
76 bit_level0,
BitRefLevel().set(), MBTET,
"out_mesh.vtk",
"VTK",
"");
77 CHKERR moab.write_file(
"out.h5m");
#define CATCH_ERRORS
Catch errors.
#define MYPCOMM_INDEX
default communicator number PCOMM
#define CHKERR
Inline error check.
virtual const Field_multiIndex * get_fields() const =0
Get the fields object.
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
virtual MoFEMErrorCode loop_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
constexpr auto field_name
Save field DOFS on vertices/tags.
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 reference to pointer of interface.