Atom testing mesh partitioning.
static char help[] =
"...\n\n";
int main(
int argc,
char *argv[]) {
int nb_vertices;
try {
PetscBool flg = PETSC_TRUE;
#if PETSC_VERSION_GE(3, 6, 4)
255, &flg);
#else
CHKERR PetscOptionsGetString(PETSC_NULL, PETSC_NULL,
"-my_file",
#endif
if (flg != PETSC_TRUE)
SETERRQ(PETSC_COMM_SELF, 1, "*** ERROR -my_file (MESH FILE NEEDED)");
moab::Core mb_instance;
moab::Interface &moab = mb_instance;
{
const char *option;
option = "";
}
CHKERR moab.get_number_entities_by_dimension(0, 0, nb_vertices,
true);
moab.get_entities_by_type(root_set, MBTET, tets, false);
Tag th_vertex_weight;
int def_val = 1;
CHKERR moab.tag_get_handle(
"VERTEX_WEIGHT", 1, MB_TYPE_INTEGER,
th_vertex_weight, MB_TAG_CREAT | MB_TAG_DENSE,
&def_val);
tets, 3, 2, m_field.
get_comm_size(), &th_vertex_weight, NULL, NULL,
CHKERR moab.write_file(
"partitioned_mesh.h5m");
}
}
PetscBarrier(PETSC_NULL);
try {
moab::Core mb_instance2;
moab::Interface &moab2 = mb_instance2;
DMType dm_name = "DMMOFEM";
CHKERR DMRegister_MoFEM(dm_name);
const char *option = "DEBUG_IO;"
"PARALLEL=READ_PART;"
"PARALLEL_RESOLVE_SHARED_ENTS;"
"PARTITION=PARALLEL_PARTITION;";
"partitioned_mesh.h5m");
CHKERR DMMoFEMGetProblemPtr(dm, &problem_ptr);
"Number of vertices and DOFs is inconstent");
<< "All is good in this test";
}
return 0;
}
#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.
#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
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.