v0.16.3
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
MoFEM::MeshPCommRegistry Struct Reference

#include "src/interfaces/CommInterface.hpp"

Static Public Member Functions

static auto & getMap ()
 
static auto getOrCreate (moab::Core *core_mesh_ptr)
 
static auto getOrCreate (const boost::shared_ptr< moab::Core > &core_mesh_ptr)
 

Detailed Description

Definition at line 18 of file CommInterface.hpp.

Member Function Documentation

◆ 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
Deprecated:
Do not use this function, use getOrCreate(moab::Core*) instead

Definition at line 58 of file CommInterface.hpp.

58 {
59 return MeshPCommRegistry::getOrCreate(core_mesh_ptr.get());
60 }
static auto getOrCreate(moab::Core *core_mesh_ptr)

◆ 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 }
It it
Definition Schur.cpp:2568
#define MYPCOMM_INDEX
default communicator number PCOMM

The documentation for this struct was generated from the following file: