13static char help[] =
"...\n\n";
15int main(
int argc,
char *argv[]) {
24 PetscBool flg = PETSC_TRUE;
26#if PETSC_VERSION_GE(3, 6, 4)
33 if (flg != PETSC_TRUE)
34 SETERRQ(PETSC_COMM_SELF, 1,
"*** ERROR -my_file (MESH FILE NEEDED)");
38 moab::Core mb_instance;
39 moab::Interface &moab = mb_instance;
48 CHKERR moab.get_number_entities_by_dimension(0, 0, nb_vertices,
true);
52 moab.get_entities_by_type(root_set, MBTET, tets,
false);
56 CHKERR moab.tag_get_handle(
"VERTEX_WEIGHT", 1, MB_TYPE_INTEGER,
57 th_vertex_weight, MB_TAG_CREAT | MB_TAG_DENSE,
62 tets, 3, 2, m_field.
get_comm_size(), &th_vertex_weight, NULL, NULL,
66 CHKERR moab.write_file(
"partitioned_mesh.h5m");
71 PetscBarrier(PETSC_NULL);
75 moab::Core mb_instance2;
76 moab::Interface &moab2 = mb_instance2;
83 DMType dm_name =
"DMMOFEM";
87 const char *option =
"DEBUG_IO;"
89 "PARALLEL_RESOLVE_SHARED_ENTS;"
90 "PARTITION=PARALLEL_PARTITION;";
94 "partitioned_mesh.h5m");
105 if(problem_ptr->
nbDofsRow != nb_vertices)
107 "Number of vertices and DOFs is inconstent");
111 <<
"All is good in this test";
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ MOFEM_ATOM_TEST_INVALID
#define CHKERR
Inline error check.
PetscErrorCode DMMoFEMGetProblemPtr(DM dm, const MoFEM::Problem **problem_ptr)
Get pointer to problem data structure.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
MoFEMErrorCode partitionMesh(const Range &ents, const int dim, const int adj_dim, const int n_parts, Tag *th_vertex_weights=nullptr, Tag *th_edge_weights=nullptr, Tag *th_part_weights=nullptr, int verb=VERBOSE, const bool debug=false)
Set partition tag to each finite element in the problem.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
virtual int get_comm_size() const =0
virtual int get_comm_rank() const =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.
Deprecated interface functions.
keeps basic data about problem
DofIdx nbDofsRow
Global number of DOFs in row.
Simple interface for fast problem set-up.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.