preCICE v3.2.0
Loading...
Searching...
No Matches
Partition.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5#include "logging/Logger.hpp"
9
10// ----------------------------------------------------------- CLASS DEFINITION
11
12namespace precice::partition {
13
28class Partition {
29public:
32
34
35 virtual ~Partition() = default;
36
38 virtual void compareBoundingBoxes() = 0;
39
41 virtual void communicate() = 0;
42
44 virtual void compute() = 0;
45
47 {
48 _fromMappings.push_back(std::move(fromMapping));
49 }
50
52 {
53 _toMappings.push_back(std::move(toMapping));
54 }
55
57 {
58 _m2ns.push_back(m2n);
59 }
60
61protected:
63
65
67
70
71private:
72 logging::Logger _log{"partition::Partition"};
73};
74
75} // namespace precice::partition
This class provides a lightweight logger.
Definition Logger.hpp:17
virtual void compareBoundingBoxes()=0
Intersections between bounding boxes around each rank are computed.
Partition & operator=(Partition &&)=delete
std::vector< mapping::PtrMapping > _toMappings
Definition Partition.hpp:66
Partition(mesh::PtrMesh mesh)
Constructor.
Definition Partition.cpp:7
void addFromMapping(mapping::PtrMapping fromMapping)
Definition Partition.hpp:46
void addM2N(m2n::PtrM2N m2n)
Definition Partition.hpp:56
std::vector< mapping::PtrMapping > _fromMappings
Definition Partition.hpp:64
void addToMapping(mapping::PtrMapping toMapping)
Definition Partition.hpp:51
virtual void compute()=0
The partition is computed, i.e. the mesh re-partitioned if required and all data structures are set u...
std::vector< m2n::PtrM2N > _m2ns
m2n connection to each connected participant
Definition Partition.hpp:69
virtual void communicate()=0
The mesh is communicated between both primary ranks (if required)
virtual ~Partition()=default
contains the logic of the parallel communication between participants.
Definition BoundM2N.cpp:12
std::shared_ptr< M2N > PtrM2N
std::shared_ptr< Mapping > PtrMapping
provides Mesh, Data and primitives.
std::shared_ptr< Mesh > PtrMesh
contains the partitioning of distributed meshes.
Definition Partition.cpp:5