preCICE v3.1.1
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 {
13namespace partition {
14
29class Partition {
30public:
33
35
36 virtual ~Partition() {}
37
39 virtual void compareBoundingBoxes() = 0;
40
42 virtual void communicate() = 0;
43
45 virtual void compute() = 0;
46
48 {
49 _fromMappings.push_back(std::move(fromMapping));
50 }
51
53 {
54 _toMappings.push_back(std::move(toMapping));
55 }
56
58 {
59 _m2ns.push_back(m2n);
60 }
61
62protected:
64
66
68
71
72private:
73 logging::Logger _log{"partition::Partition"};
74};
75
76} // namespace partition
77} // namespace precice
This class provides a lightweight logger.
Definition Logger.hpp:16
Abstract base class for partitions.
Definition Partition.hpp:29
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:67
Partition(mesh::PtrMesh mesh)
Constructor.
Definition Partition.cpp:7
void addFromMapping(mapping::PtrMapping fromMapping)
Definition Partition.hpp:47
void addM2N(m2n::PtrM2N m2n)
Definition Partition.hpp:57
std::vector< mapping::PtrMapping > _fromMappings
Definition Partition.hpp:65
void addToMapping(mapping::PtrMapping toMapping)
Definition Partition.hpp:52
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:70
virtual void communicate()=0
The mesh is communicated between both primary ranks (if required)
Main namespace of the precice library.
T partition(T... args)