preCICE v3.1.2
Loading...
Searching...
No Matches
ReceivedPartition.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4#include <vector>
5#include "Partition.hpp"
6#include "logging/Logger.hpp"
8#include "mesh/Mesh.hpp"
10#include "mesh/Vertex.hpp"
11
12namespace precice {
13namespace m2n {
14class M2N;
15} // namespace m2n
16
17namespace partition {
18
28
29public:
41
43 ReceivedPartition(const mesh::PtrMesh &mesh, GeometricFilter geometricFilter, double safetyFactor, bool allowDirectAccess = false);
44
45 virtual ~ReceivedPartition() {}
46
47 void communicate() override;
48
49 void compute() override;
50
51 void compareBoundingBoxes() override;
52
53private:
55 m2n::M2N &m2n();
56
58
60 void prepareBoundingBox();
61
67 bool isAnyProvidedMeshNonEmpty() const;
68
70 bool hasAnyMapping() const;
71
73 void tagMeshFirstRound();
74
76 void tagMeshSecondRound();
77
79
81 void setOwnerInformation(const std::vector<int> &ownerVec);
82
85
87
89
91
93
95
96 logging::Logger _log{"partition::ReceivedPartition"};
97
100
103};
104
105} // namespace partition
106} // namespace precice
This class provides a lightweight logger.
Definition Logger.hpp:16
M2N communication class. This layer is necessary since communication between two participants can be ...
Definition M2N.hpp:31
An axis-aligned bounding box around a (partition of a) mesh.
Abstract base class for partitions.
Definition Partition.hpp:29
A partition that is computed from a mesh received from another participant.
void prepareBoundingBox()
Sets _bb to the union with the mesh from fromMapping resp. toMapping, also enlage by _safetyFactor.
ReceivedPartition(const mesh::PtrMesh &mesh, GeometricFilter geometricFilter, double safetyFactor, bool allowDirectAccess=false)
Constructor.
void compute() override
The partition is computed, i.e. the mesh re-partitioned if required and all data structures are set u...
std::vector< int > _remoteMaxGlobalVertexIDs
Max global vertex IDs of remote connected ranks.
void tagMeshFirstRound()
Tag mesh in first round according to all mappings.
std::vector< int > _remoteMinGlobalVertexIDs
Min global vertex IDs of remote connected ranks.
bool hasAnyMapping() const
Returns whether any mapping is defined.
void tagMeshSecondRound()
Tag mesh in second round according to all mappings.
m2n::M2N & m2n()
return the one m2n, a ReceivedPartition can only have one m2n
void compareBoundingBoxes() override
Intersections between bounding boxes around each rank are computed.
bool _boundingBoxPrepared
Is the local other (i.e. provided) bounding box already prepared (i.e. has prepareBoundingBox() been ...
GeometricFilter
Defines the type of geometric filter used.
@ ON_PRIMARY_RANK
Filter at primary rank and communicate only filtered mesh.
@ ON_SECONDARY_RANKS
Filter after communication on all secondary ranks.
@ NO_FILTER
No geometric filter used (e.g. for RBF mappings)
void setOwnerInformation(const std::vector< int > &ownerVec)
Helper function for 'createOwnerFunction' to set local owner information.
void communicate() override
The mesh is communicated between both primary ranks (if required)
Main namespace of the precice library.
T partition(T... args)