#include "src/interfaces/CommInterface.hpp"
|
| static auto & | getMap () |
| |
| static auto | getOrCreate (moab::Core *core_mesh_ptr) |
| |
| static auto | getOrCreate (const boost::shared_ptr< moab::Core > &core_mesh_ptr) |
| |
Definition at line 18 of file CommInterface.hpp.
◆ getMap()
| static auto & MoFEM::MeshPCommRegistry::getMap |
( |
| ) |
|
|
inlinestatic |
Definition at line 27 of file CommInterface.hpp.
27 {
28 static std::map<moab::Core *, boost::weak_ptr<ParallelComm>> pcomm_map;
29 return pcomm_map;
30 }
◆ getOrCreate() [1/2]
| static auto MoFEM::MeshPCommRegistry::getOrCreate |
( |
const boost::shared_ptr< moab::Core > & |
core_mesh_ptr | ) |
|
|
inlinestatic |
◆ getOrCreate() [2/2]
| static auto MoFEM::MeshPCommRegistry::getOrCreate |
( |
moab::Core * |
core_mesh_ptr | ) |
|
|
inlinestatic |
Definition at line 32 of file CommInterface.hpp.
32 {
33 auto *mesh_ptr = core_mesh_ptr;
34 auto &pcomm_map =
getMap();
35
36 if (
auto it = pcomm_map.find(mesh_ptr);
it != pcomm_map.end()) {
37 if (
auto pcomm_ptr =
it->second.lock())
38 return pcomm_ptr;
39 }
40
41 if (
auto *raw_pcomm = ParallelComm::get_pcomm(mesh_ptr,
MYPCOMM_INDEX)) {
42 auto pcomm_ptr = boost::shared_ptr<ParallelComm>(
43 raw_pcomm, [mesh_ptr](ParallelComm *) {});
44 pcomm_map[mesh_ptr] = pcomm_ptr;
45 return pcomm_ptr;
46 }
47
48 auto pcomm_ptr = boost::shared_ptr<ParallelComm>(
49 new ParallelComm(mesh_ptr, PETSC_COMM_WORLD),
50 [mesh_ptr](ParallelComm *pcomm) {
51 delete pcomm;
52 return;
53 });
54 return pcomm_ptr;
55 }
#define MYPCOMM_INDEX
default communicator number PCOMM
The documentation for this struct was generated from the following file: