v0.16.3
Loading...
Searching...
No Matches
comm_parent_child.cpp
Go to the documentation of this file.
1/** \file comm_parent_child.cpp
2 * \brief Synchronisation of independently constructed simplicial subdivisions.
3 *
4 * Parent tetrahedron i has vertices {1, 2, 3 + 2*i, 4 + 2*i}. All parents
5 * share edge {1, 2}, which becomes multishared when several ranks own cells.
6 * Each producer inserts vertex 1001 at that edge's midpoint and splits each
7 * local parent into two tetrahedra. MeshRefinement records their ancestry;
8 * CommInterface must match existing copies and supply missing descendants.
9 *
10 * Bit levels 0 and 1 select parents and children. Unrelated vertices on level
11 * 7 and reversed creation order make local handles differ between ranks.
12 * JSON supplies the coordinate scale; CTest runs this suite on 1, 2 and 4 ranks.
13 */
14#include <MoFEM.hpp>
15
16using namespace MoFEM;
17
18namespace {
19
20/// Select one generation without including entities from other test levels.
21BitRefLevel level(int n) { return BitRefLevel().set(n); }
22
23/// Report a violated test invariant through the standard MoFEM error path.
24MoFEMErrorCode require(bool valid, const char *message) {
26 if (!valid)
27 SETERRQ(PETSC_COMM_WORLD, MOFEM_ATOM_TEST_INVALID, "%s", message);
29}
30
31/** Encode the fixture entity's type and sorted global corner IDs.
32 * Equal topology has the same key despite different local handles, corner
33 * order or creation order. Base 2048 is sufficient for the small fixture IDs
34 * and at most four corners; this encoding is not a general mesh ID allocator.
35 */
36unsigned long long identity(moab::Interface &mb, EntityHandle entity) {
37 const auto type = mb.type_from_handle(entity);
38 std::vector<int> ids;
39 if (type == MBVERTEX) {
40 ids.resize(1);
41 CHK_MOAB_THROW(mb.tag_get_data(mb.globalId_tag(), &entity, 1, ids.data()),
42 "Fixture vertex ID");
43 } else {
44 const EntityHandle *conn;
45 int count;
46 CHK_MOAB_THROW(mb.get_connectivity(entity, conn, count), "Fixture corners");
47 ids.resize(count);
48 CHK_MOAB_THROW(mb.tag_get_data(mb.globalId_tag(), conn, count, ids.data()),
49 "Fixture corner IDs");
50 std::sort(ids.begin(), ids.end());
51 }
52 unsigned long long key = type;
53 for (int i = 0; i != 4; ++i)
54 key = key * 2048 + (i < ids.size() ? ids[i] : 0);
55 return key;
56}
57
58/** Allocate a tetrahedron batch and register its connectivity with MOAB.
59 * The caller sets bit levels afterwards, creating/registering the lower
60 * dimensional closure needed by ancestry and adjacency queries.
61 */
62MoFEMErrorCode makeTets(moab::Interface &mb,
63 const std::vector<std::array<EntityHandle, 4>> &cells,
64 Range &tets) {
66 if (!cells.empty()) {
67 ReadUtilIface *reader;
68 CHKERR mb.query_interface(reader);
69 EntityHandle start, *conn;
70 CHKERR reader->get_element_connect(cells.size(), 4, MBTET, 0, start, conn);
71 for (size_t i = 0; i != cells.size(); ++i)
72 std::copy(cells[i].begin(), cells[i].end(), conn + 4 * i);
73 CHKERR reader->update_adjacencies(start, cells.size(), 4, conn);
74 tets.insert(start, start + cells.size() - 1);
75 }
77}
78
79/** Establish the known parent layout before testing child synchronisation.
80 * Cell i and its private vertices/edges/faces belong to rank i. The common
81 * edge {1, 2} and its endpoints belong to rank 0 and form partition interfaces;
82 * extra resident copies of private entities are ghosts.
83 *
84 * Gather fixture identities and local handles to initialise MOAB's remote
85 * correspondence independently of synchroniseByParentChild. Restore
86 * the prescribed owner after MOAB's lowest-rank registration, including cases
87 * where rank 0 retains a ghost of a cell owned elsewhere. Validate this parent
88 * state before any child creation, so a fixture error cannot masquerade as a
89 * failure of the operation under test.
90 */
91MoFEMErrorCode initialiseLayout(MoFEM::Interface &m_field, ParallelComm &pc,
92 const Range &source) {
94 auto &mb = m_field.get_moab();
95 const int rank = pc.rank(), size = pc.size();
96 std::vector<unsigned long long> local;
97 for (auto entity : source) {
98 local.push_back(identity(mb, entity));
99 local.push_back(entity);
100 }
101 int count = local.size();
102 std::vector<int> counts(size), offsets(size);
103 CHKERR MPI_Allgather(&count, 1, MPI_INT, counts.data(), 1, MPI_INT,
104 pc.comm());
105 int total = 0;
106 for (int p = 0; p != size; ++p) {
107 offsets[p] = total;
108 total += counts[p];
109 }
110 std::vector<unsigned long long> all(total);
111 CHKERR MPI_Allgatherv(local.data(), count, MPI_UNSIGNED_LONG_LONG, all.data(),
112 counts.data(), offsets.data(), MPI_UNSIGNED_LONG_LONG,
113 pc.comm());
114 std::map<unsigned long long, std::map<int, EntityHandle>> copies;
115 for (int p = 0; p != size; ++p)
116 for (int i = offsets[p]; i < offsets[p] + counts[p]; i += 2)
117 copies[all[i]][p] = all[i + 1];
118 for (auto entity : source) {
119 const auto &residents = copies.at(identity(mb, entity));
120 int owner = 0;
121 auto key = identity(mb, entity);
122 // IDs 3+2*i and 4+2*i identify cell i's private corners; IDs 1 and 2
123 // identify the common edge and leave its owner at rank 0.
124 for (int i = 0; i != 4; ++i) {
125 const int id = key % 2048;
126 key /= 2048;
127 if (id >= 3)
128 owner = (id - 3) / 2;
129 }
130 if (residents.size() == 1)
131 continue;
132 std::vector<int> procs;
133 std::vector<EntityHandle> handles;
134 for (const auto &[p, handle] : residents)
135 if (p != rank) {
136 procs.push_back(p);
137 handles.push_back(handle);
138 }
139 CHKERR pc.update_remote_data(entity, procs, handles);
140 unsigned char status = PSTATUS_SHARED;
141 const bool common =
142 owner == 0 &&
143 (mb.type_from_handle(entity) == MBVERTEX
144 ? (identity(mb, entity) / (2048ULL * 2048 * 2048)) <= 2
145 : identity(mb, entity) ==
146 (((1ULL * 2048 + 1) * 2048 + 2) * 2048) * 2048);
147 if (common)
148 status |= PSTATUS_INTERFACE;
149 else if (owner != rank)
150 status |= PSTATUS_GHOST;
151 if (owner != rank)
152 status |= PSTATUS_NOT_OWNED;
153 if (residents.size() > 2) {
154 // MOAB stores the owner first in multishared processor/handle arrays.
155 status |= PSTATUS_MULTISHARED;
156 std::array<int, MAX_SHARING_PROCS> ps;
157 std::array<EntityHandle, MAX_SHARING_PROCS> hs{};
158 ps.fill(-1);
159 ps[0] = owner;
160 hs[0] = residents.at(owner);
161 int i = 1;
162 for (const auto &[p, handle] : residents)
163 if (p != owner) {
164 ps[i] = p;
165 hs[i++] = handle;
166 }
167 CHKERR mb.tag_set_data(pc.sharedps_tag(), &entity, 1, ps.data());
168 CHKERR mb.tag_set_data(pc.sharedhs_tag(), &entity, 1, hs.data());
169 }
170 CHKERR mb.tag_set_data(pc.pstatus_tag(), &entity, 1, &status);
171 }
172 std::map<std::vector<int>, std::vector<EntityHandle>> interfaces;
173 // Build interface sets only for the common edge/endpoints. Including ghost
174 // entities would let MOAB's interface helper change their prescribed roles.
175 for (auto entity : source) {
176 unsigned char status;
177 CHKERR pc.get_pstatus(entity, status);
178 if (!(status & PSTATUS_INTERFACE))
179 continue;
180 const auto &residents = copies.at(identity(mb, entity));
181 std::vector<int> procs;
182 for (const auto &[p, handle] : residents)
183 if (residents.size() > 2 || p != rank)
184 procs.push_back(p);
185 interfaces[procs].push_back(entity);
186 }
187 CHKERR pc.create_interface_sets(interfaces);
188 std::set<unsigned int> peers;
189 CHKERR pc.get_interface_procs(peers, true);
190 CHKERR pc.check_all_shared_handles();
192}
193
194/** Construct and check one parent-layout/child-producer scenario collectively.
195 * Each call uses a fresh MOAB/MoFEM database on the same MPI communicator.
196 *
197 * @param layout "distributed": each rank stores its own parent; "replicated":
198 * all ranks store all parents; "root_complete": rank 0 stores all parents and
199 * other ranks store their own; "empty": omit the last parent's rank when
200 * there are more than two ranks; "all_empty": no selected parent/child mesh.
201 * @param producer Negative means every rank refines its resident parents;
202 * otherwise only the named rank creates children, leaving missing copies for
203 * CommInterface to transfer. Single-producer cases use replicated parents.
204 * @param invalid Fault injected on the last rank: 0 valid; 1 missing midpoint
205 * ID; 3 conflicting parent; 4 inconsistent midpoint
206 * ID/subdivision; 5 inconsistent source ownership; 6 parent outside level 0.
207 * @param scale Positive coordinate scale loaded from the JSON configuration.
208 * @param different_coordinates Give shared source and child vertices different
209 * positions on the last rank; identity/sharing must still match by global IDs.
210 */
211MoFEMErrorCode run(const std::string &layout, int producer, int invalid,
212 double scale, bool different_coordinates = false) {
214 moab::Core mb;
215 MoFEM::Core core(mb, PETSC_COMM_WORLD);
216 MoFEM::Interface &m_field = core;
217 auto *bits = m_field.getInterface<BitRefManager>();
218 auto *comm = m_field.getInterface<CommInterface>();
219 auto *pc = ParallelComm::get_pcomm(&mb, MYPCOMM_INDEX);
220 const int rank = pc->rank(), size = pc->size();
221 const int cell_count = layout == "all_empty" ? 0
222 : layout == "empty" && size > 2 ? size - 1
223 : size;
224 std::vector<int> cells;
225 for (int i = 0; i != cell_count; ++i)
226 if (layout == "replicated" || i == rank ||
227 (layout == "root_complete" && rank == 0))
228 cells.push_back(i);
229 std::set<int> vertex_ids;
230 for (int i : cells)
231 for (int id : {1, 2, 3 + 2 * i, 4 + 2 * i})
232 vertex_ids.insert(id);
233 std::vector<int> order(vertex_ids.begin(), vertex_ids.end());
234 if (rank % 2)
235 std::reverse(order.begin(), order.end());
236 // An unrelated level also forces different handle offsets on each rank.
237 std::vector<double> padding(3 * (rank + 1), -1);
238 Range unused;
239 CHKERR mb.create_vertices(padding.data(), rank + 1, unused);
240 CHKERR bits->setEntitiesBitRefLevel(unused, level(7));
242 std::map<int, EntityHandle> node;
243 if (!order.empty()) {
244 ReadUtilIface *reader;
245 CHKERR mb.query_interface(reader);
246 EntityHandle start;
247 std::vector<double *> coordinates;
248 CHKERR reader->get_node_coords(3, order.size(), 0, start, coordinates);
249 for (size_t n = 0; n != order.size(); ++n) {
250 const auto id = order[n];
251 node[id] = start + n;
252 const auto angle = id < 3 ? 0 : .7 * (id - 3);
253 coordinates[0][n] = id == 2 ? scale : 0;
254 coordinates[1][n] = id < 3 ? 0 : scale * std::cos(angle);
255 coordinates[2][n] = id < 3 ? 0 : scale * std::sin(angle);
256 CHKERR mb.tag_set_data(mb.globalId_tag(), &node[id], 1, &id);
257 }
258 }
259 std::vector<std::array<EntityHandle, 4>> connectivity;
260 for (int i : cells)
261 connectivity.push_back(
262 {node.at(1), node.at(2), node.at(3 + 2 * i), node.at(4 + 2 * i)});
263 Range source_tets, source;
264 CHKERR makeTets(mb, connectivity, source_tets);
265 CHKERR bits->setBitRefLevel(source_tets, level(0), false);
266 CHKERR bits->getEntitiesByRefLevel(level(0), BitRefLevel().set(), source);
267 CHKERR initialiseLayout(m_field, *pc, source);
268 // Keep an independent snapshot: synchronising children must preserve the
269 // selected source entities and their established ownership/parallel status.
270 std::map<EntityHandle, std::pair<int, unsigned char>> source_layout;
271 for (auto entity : source) {
272 auto &expected = source_layout[entity];
273 CHKERR pc->get_owner(entity, expected.first);
274 CHKERR pc->get_pstatus(entity, expected.second);
275 }
276 std::vector<EntityHandle> boundary_sets;
277 auto *meshsets_manager = m_field.getInterface<MeshsetsManager>();
278 if (!source.empty()) {
279 Range edge;
280 const EntityHandle endpoints[] = {node.at(1), node.at(2)};
281 CHKERR mb.get_adjacencies(endpoints, 2, 1, false, edge,
282 moab::Interface::INTERSECT);
283 // Overlapping labelled sets must both acquire the common-edge descendants.
284 for (int id : {101, 102}) {
285 CHKERR meshsets_manager->addMeshset(BLOCKSET, id, "sync_boundary");
286 const auto set =
287 meshsets_manager->getCubitMeshsetPtr(id, BLOCKSET)->getMeshset();
288 CHKERR mb.add_entities(set, edge);
289 boundary_sets.push_back(set);
290 }
291 }
292 std::vector<EntityHandle> partitions;
293 // Each source cell starts in a separate partition set; after splitting,
294 // that same set must contain exactly its two child cells on resident ranks.
295 for (size_t n = 0; n != cells.size(); ++n) {
296 EntityHandle part;
297 CHKERR mb.create_meshset(MESHSET_SET, part);
298 const auto tag = pc->part_tag();
299 CHKERR mb.tag_set_data(tag, &part, 1, &cells[n]);
300 const auto tet = source_tets[n];
301 CHKERR mb.add_entities(part, &tet, 1);
302 pc->partition_sets().insert(part);
303 partitions.push_back(part);
304 }
305 const bool generate = producer < 0 || producer == rank;
306 if (generate && !cells.empty()) {
307 EntityHandle midpoint;
308 const double x[] = {.5 * scale, 0, 0};
309 CHKERR mb.create_vertex(x, midpoint);
310 int id = 1001;
311 if (rank == size - 1) {
312 if (invalid == 1)
313 id = 0;
314 else if (invalid == 4)
315 id = 1002;
316 }
317 CHKERR mb.tag_set_data(mb.globalId_tag(), &midpoint, 1, &id);
318 if (different_coordinates && rank == size - 1) {
319 const double moved[] = {.4 * scale, 0, 0};
320 CHKERR mb.set_coords(&midpoint, 1, moved);
321 }
322 Range edge;
323 const EntityHandle endpoints[] = {node.at(1), node.at(2)};
324 CHKERR mb.get_adjacencies(endpoints, 2, 1, false, edge,
325 moab::Interface::INTERSECT);
326 connectivity.clear();
327 for (int i : cells) {
328 connectivity.push_back(
329 {node.at(1), midpoint, node.at(3 + 2 * i), node.at(4 + 2 * i)});
330 connectivity.push_back(
331 {midpoint, node.at(2), node.at(3 + 2 * i), node.at(4 + 2 * i)});
332 }
333 if (rank % 2)
334 std::reverse(connectivity.begin(), connectivity.end());
335 Range child_tets, children;
336 CHKERR makeTets(mb, connectivity, child_tets);
337 CHKERR bits->setBitRefLevel(child_tets, level(1), false);
338 CHKERR bits->getEntitiesByRefLevel(level(1), BitRefLevel().set(), children);
339 // Supply only the midpoint's geometric classification. MeshRefinement
340 // derives edge/face/tet parents topologically from this vertex ancestry.
341 CHKERR m_field.getInterface<MeshRefinement>()->setParents(
342 source, children, {{midpoint, edge.front()}}, level(1));
343 if (different_coordinates && rank == size - 1) {
344 const auto vertex = node.at(1);
345 const double moved[] = {0, .01 * scale, 0};
346 CHKERR mb.set_coords(&vertex, 1, moved);
347 }
348 // Alter ancestry/ownership after valid construction so the communication
349 // preflight, rather than the mesh generator, detects these injected faults.
350 if (rank == size - 1 && (invalid == 3 || invalid == 6)) {
351 EntityHandle wrong_parent = unused.front();
352 if (invalid == 3) {
353 Range wrong_edge;
354 const EntityHandle endpoints[] = {node.at(1), node.at(3)};
355 CHKERR mb.get_adjacencies(endpoints, 2, 1, false, wrong_edge,
356 moab::Interface::INTERSECT);
357 wrong_parent = wrong_edge.front();
358 }
359 auto *refs = const_cast<RefEntity_multiIndex *>(m_field.get_ref_ents());
360 CHKERR require(refs->modify(refs->find(midpoint),
361 RefEntity_change_parent(wrong_parent)),
362 "Could not prepare invalid ancestry");
363 }
364 if (rank == size - 1 && invalid == 5) {
365 const auto entity = source_tets.front();
366 const unsigned char status = 0;
367 CHKERR mb.tag_set_data(pc->pstatus_tag(), &entity, 1, &status);
368 }
369 }
370 const auto old_source_count = source.size();
371 if (invalid) {
372 // Expected failures must return collectively without hanging or allocating
373 // entities. The return error handler permits checking the error code.
374 Range before, after;
375 CHKERR mb.get_entities_by_handle(0, before);
376 CHKERR PetscPushErrorHandler(PetscReturnErrorHandler, nullptr);
377 const auto error =
378 comm->synchroniseByParentChild(level(0), level(1));
379 CHKERR PetscPopErrorHandler();
380 CHKERR require(error == MOFEM_DATA_INCONSISTENCY,
381 "Invalid concurrent input was not rejected");
382 CHKERR mb.get_entities_by_handle(0, after);
383 CHKERR require(before == after, "Rejected input changed the mesh");
385 }
386 Range previous, previous_database;
387 // The first call completes the inherited layout; the second must preserve
388 // all entity handles and meshsets, including MOAB's internal interface sets.
389 for (int repeat = 0; repeat != 2; ++repeat) {
390 CHKERR comm->synchroniseByParentChild(level(0), level(1));
391 Range children, unchanged;
392 CHKERR bits->getEntitiesByRefLevel(level(1), BitRefLevel().set(), children);
393 CHKERR bits->getEntitiesByRefLevel(level(0), BitRefLevel().set(),
394 unchanged);
395 CHKERR require(unchanged == source && source.size() == old_source_count,
396 "Source level changed during synchronisation");
397 for (const auto &[entity, expected] : source_layout) {
398 int owner;
399 unsigned char status;
400 CHKERR pc->get_owner(entity, owner);
401 CHKERR pc->get_pstatus(entity, status);
402 CHKERR require(owner == expected.first && status == expected.second,
403 "Source ownership or parallel status changed");
404 }
405 CHKERR require(children.num_of_type(MBTET) == 2 * cells.size(),
406 "Missing or duplicate received child tetrahedra");
407 if (repeat)
408 CHKERR require(children == previous, "Repeated sync created entities");
409 previous = children;
410 Range database;
411 CHKERR mb.get_entities_by_handle(0, database);
412 if (repeat)
413 CHKERR require(database == previous_database,
414 "Repeated sync created extra meshsets or topology");
415 previous_database = database;
416 std::set<unsigned long long> identities;
417 for (auto child : children) {
418 CHKERR require(identities.insert(identity(mb, child)).second,
419 "Synchronisation duplicated an entity");
420 if (source.find(child) != source.end())
421 continue;
422 EntityHandle parent;
423 CHKERR mb.tag_get_data(bits->get_th_RefParentHandle(), &child, 1,
424 &parent);
425 CHKERR require(source.find(parent) != source.end(),
426 "Invalid local parent");
427 int child_owner, parent_owner;
428 CHKERR pc->get_owner(child, child_owner);
429 CHKERR pc->get_owner(parent, parent_owner);
430 CHKERR require(child_owner == parent_owner, "Inherited owner changed");
431 unsigned char child_status, parent_status;
432 CHKERR pc->get_pstatus(child, child_status);
433 CHKERR pc->get_pstatus(parent, parent_status);
434 CHKERR require((child_status & PSTATUS_GHOST) ==
435 (parent_status & PSTATUS_GHOST),
436 "Inherited ghost role changed");
437 const auto *refs = m_field.get_ref_ents();
438 const auto entry = refs->find(child);
439 CHKERR require(entry != refs->end() && (*entry)->getParentEnt() == parent,
440 "Refinement parent was not registered");
441 const auto bucket = refs->get<Ent_Ent_mi_tag>().equal_range(parent);
442 CHKERR require(
443 std::any_of(bucket.first, bucket.second,
444 [&](const auto &e) { return e->getEnt() == child; }),
445 "Parent index does not contain received child");
446 }
447 for (auto partition : partitions) {
448 Range members;
449 CHKERR mb.get_entities_by_handle(partition, members);
450 CHKERR require(intersect(members, children).num_of_type(MBTET) == 2,
451 "Partition membership was not inherited");
452 }
453 for (auto boundary : boundary_sets) {
454 Range members;
455 CHKERR mb.get_entities_by_handle(boundary, members);
456 CHKERR require(members.num_of_type(MBEDGE) == 3 &&
457 members.num_of_type(MBVERTEX) == 1,
458 "Overlapping BC sets missed common-edge descendants");
459 }
460 const int zero = 0;
461 Tag values;
462 CHKERR mb.tag_get_handle("SYNC_TEST_VALUE", 1, MB_TYPE_INTEGER, values,
463 MB_TAG_CREAT | MB_TAG_DENSE, &zero);
464 // An owner supplies a known value and every remote copy starts with -1.
465 // Successful MOAB exchange proves that the resulting sharing is usable,
466 // beyond merely inspecting the parallel and ancestry tags.
467 for (auto child : children) {
468 int owner;
469 CHKERR pc->get_owner(child, owner);
470 const int value = owner == rank ? owner + 10 : -1;
471 CHKERR mb.tag_set_data(values, &child, 1, &value);
472 }
473 CHKERR pc->exchange_tags(values, children);
474 for (auto child : children) {
475 int owner, value;
476 CHKERR pc->get_owner(child, owner);
477 CHKERR mb.tag_get_data(values, &child, 1, &value);
478 CHKERR require(value == owner + 10, "MOAB tag exchange missed child");
479 }
480 CHKERR pc->check_all_shared_handles();
481 }
482 MOFEM_LOG("WORLD", Sev::inform)
483 << "Parent-child sync passed: " << layout << ", producer " << producer;
485}
486
487} // namespace
488
489/** Load JSON options and execute the same scenario suite on every MPI rank.
490 * Each CTest invocation chooses the communicator size. The suite covers the
491 * mesh layouts, concurrent/single producers, repeated calls and collective
492 * rejection of inconsistent input. Cross-rank conflicts need at least two ranks.
493 */
494int main(int argc, char **argv) {
495 MoFEM::Core::Initialize(&argc, &argv, nullptr,
496 "Parent-child communication checks\n");
497 try {
498 {
499 // Initialise JSON options before reading scale; scenario databases below
500 // are independent and reuse the resulting PETSc options.
501 moab::Core mb;
502 MoFEM::Core core(mb, PETSC_COMM_WORLD);
503 CHKERR core.getInterface<JsonConfigManager>()->getSubInterfaceOptions();
504 }
505 double scale = 0;
506 CHKERR PetscOptionsGetReal(nullptr, nullptr, "-synchronisation_scale",
507 &scale, nullptr);
508 CHKERR require(scale > 0, "JSON must supply synchronisation_scale");
509 int size;
510 CHKERR MPI_Comm_size(PETSC_COMM_WORLD, &size);
511 for (const auto &layout :
512 {"distributed", "replicated", "root_complete", "empty", "all_empty"})
513 CHKERR run(layout, -1, 0, scale);
514 CHKERR run("replicated", 0, 0, scale);
515 CHKERR run("replicated", size - 1, 0, scale);
516 CHKERR run("replicated", -1, 1, scale);
517 if (size > 1) {
518 CHKERR run("replicated", -1, 0, scale, true);
519 for (int invalid = 3; invalid != 7; ++invalid)
520 CHKERR run("replicated", -1, invalid, scale);
521 }
522 }
525 return 0;
526}
CGALInterfaceImpl & owner
std::vector< int > source
int boundary
std::vector< int > size
bool angle
Radians between candidate face and target plane.
std::vector< int > vertices
std::vector< int > parent
std::vector< Cell > cells
std::array< int, 4 > connectivity
unsigned char status
EntityHandle handle
ParentChildKey key
MPI_Comm comm
moab::Interface & mb
Tag tag
std::map< EntityHandle, size_t > offsets
std::map< EntityHandle, std::pair< bool, std::vector< double > > > previous
std::vector< std::array< double, 3 > > coordinates
std::string type
It end
Definition Schur.cpp:2568
SmartPetscObj< Vec > values
int main()
#define CATCH_ERRORS
Catch errors.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ BLOCKSET
@ MOFEM_ATOM_TEST_INVALID
Definition definitions.h:40
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
constexpr int order
virtual const RefEntity_multiIndex * get_ref_ents() const =0
Get the ref ents object.
#define MOFEM_LOG(channel, severity)
Log.
FTensor::Index< 'i', SPACE_DIM > i
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
PetscErrorCode PetscOptionsGetReal(PetscOptions *, const char pre[], const char name[], PetscReal *dval, PetscBool *set)
double scale
Definition plastic.cpp:124
MoFEMErrorCode run(MoFEM::Interface &m_field)
Definition sdf_python.cpp:7
Managing BitRefLevels.
Managing BitRefLevels.
virtual moab::Interface & get_moab()=0
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
Deprecated interface functions.
Mesh refinement interface.
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.