Field to vertices.
More...
#include <MoFEM.hpp>
#include <SaveVertexDofOnTag.hpp>
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
|
static char | help [] = "...\n\n" |
|
Field to vertices.
Definition in file field_to_vertices.cpp.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
- Examples
- field_to_vertices.cpp.
Definition at line 16 of file field_to_vertices.cpp.
23 PetscBool flg_file = PETSC_FALSE;
24 char field_name_param[255] =
"RHO";
25 CHKERR PetscOptionsBegin(PETSC_COMM_WORLD,
"",
"Field to vertices options",
"none");
26 CHKERR PetscOptionsString(
"-my_file",
"mesh file name",
"",
"mesh.h5m",
28 CHKERR PetscOptionsString(
"-my_field",
"field name",
"",
"FIELD",
29 field_name_param, 255, PETSC_NULL);
36 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
38 pcomm =
new ParallelComm(&moab, PETSC_COMM_WORLD);
47 if (flg_file != PETSC_TRUE) {
49 "*** ERROR -my_file (MESH FILE NEEDED)");
57 bool field_flg =
false;
59 for(
auto field : (*fields_ptr)) {
60 bool check_space = field->getSpace() ==
H1;
61 if(field->getName() ==
field_name && check_space) field_flg =
true;
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");
◆ help
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.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.