15 {
16
17
19
20 int nb_vertices;
21
22 try {
23
24 PetscBool flg = PETSC_TRUE;
26#if PETSC_VERSION_GE(3, 6, 4)
28 255, &flg);
29#else
32#endif
33 if (flg != PETSC_TRUE)
34 SETERRQ(PETSC_COMM_SELF, 1, "*** ERROR -my_file (MESH FILE NEEDED)");
35
36
37
38 moab::Core mb_instance;
39 moab::Interface &moab = mb_instance;
40 {
41 const char *option;
42 option = "";
44 }
47
48 CHKERR moab.get_number_entities_by_dimension(0, 0, nb_vertices,
true);
49
52 moab.get_entities_by_type(root_set, MBTET, tets, false);
53
54 Tag th_vertex_weight;
55 int def_val = 1;
56 CHKERR moab.tag_get_handle(
"VERTEX_WEIGHT", 1, MB_TYPE_INTEGER,
57 th_vertex_weight, MB_TAG_CREAT | MB_TAG_DENSE,
58 &def_val);
59
62 tets, 3, 2, m_field.
get_comm_size(), &th_vertex_weight, NULL, NULL,
64
66 CHKERR moab.write_file(
"partitioned_mesh.h5m");
67 }
68 }
70
71 PetscBarrier(PETSC_NULL);
72
73 try {
74
75 moab::Core mb_instance2;
76 moab::Interface &moab2 = mb_instance2;
77
78
81
82
83 DMType dm_name = "DMMOFEM";
85
86
87 const char *option = "DEBUG_IO;"
88 "PARALLEL=READ_PART;"
89 "PARALLEL_RESOLVE_SHARED_ENTS;"
90 "PARTITION=PARALLEL_PARTITION;";
91
94 "partitioned_mesh.h5m");
99
101
104
105 if(problem_ptr->
nbDofsRow != nb_vertices)
107 "Number of vertices and DOFs is inconstent");
108
111 << "All is good in this test";
112 }
114
116
117 return 0;
118}
#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.
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.