25 return 2 + kv.second.size();
30 for (
const auto &[rank, ids] : cm) {
43 int numEntries = *begin;
45 if (numEntries == 0) {
51 for (
int entry = 0; entry < numEntries; ++entry) {
59 auto verticesStart = begin;
69 const size_t totalSize =
content.size();
72 const auto numEntries =
content.front();
77 for (
int entry = 0; entry < numEntries; ++entry) {
81 auto rank =
content[consumed++];
84 auto size =
content[consumed++];
88 PRECICE_ASSERT(totalSize >= consumed + size,
"size larger than remaining");
133 coords.reserve(1 + 2 * dims);
147 auto dims =
static_cast<int>(
coords.at(0));
155 for (
int d = 0; d < dims; ++d) {
157 buffer[offset] =
coords[1 + d];
158 buffer[offset + 1] =
coords[1 + d + dims];
166 auto dims =
static_cast<size_t>(
coords.front());
199 auto size = bbm.
size();
200 info.reserve(2 + size);
201 const auto dims = bbm.
begin()->second.getDimension();
203 info.push_back(size);
204 info.push_back(dims);
205 coords.reserve(size * dims);
207 for (
const auto &[rank, bb] : bbm) {
208 info.push_back(rank);
209 auto min = bb.minCorner();
211 auto max = bb.maxCorner();
220 if (
info.size() == 1) {
233 auto coordIter =
coords.begin();
234 for (
int entry = 0; entry < size; ++entry) {
238 for (
int d = 0; d < dims; ++d) {
240 buffer[offset] = coordIter[d];
241 buffer[offset + 1] = coordIter[d + dims];
255 if (
info.size() == 1) {
261 auto numEntries =
info[0];
267 for (
int entry = 0; entry < numEntries; ++entry) {
275 if (
info.size() > 1) {
294 if (
info.size() > 1) {
#define PRECICE_ASSERT(...)
T back_inserter(T... args)
Interface for all interprocess communication classes.
std::vector< int > receiveRange(Rank rankSender, AsVectorTag< int >)
Receives a range of ints as a vector<int>
void sendRange(precice::span< const double > itemsToSend, Rank rankReceiver)
Sends a range of doubles (size + content)
virtual void broadcast(precice::span< const int > itemsToSend)
static SerializedBoundingBoxMap broadcastReceive(Communication &communication)
receives a SerializedBoundingBoxMap and calls assertValid before returning
SerializedBoundingBoxMap()=default
std::map< Rank, mesh::BoundingBox > BoundingBoxMap
std::vector< double > coords
static SerializedBoundingBoxMap receive(Communication &communication, int rankSender)
receives a SerializedBoundingBoxMap and calls assertValid before returning
void broadcastSend(Communication &communication)
BoundingBoxMap toBoundingBoxMap() const
Builds and returns the BoundingBoxMap represented by the serialized state.
void send(Communication &communication, int rankReceiver)
static SerializedBoundingBoxMap serialize(const BoundingBoxMap &bbm)
void assertValid() const
asserts the content for correctness
static SerializedBoundingBox receive(Communication &communication, int rankSender)
receives a SerializedBoundingBox and calls assertValid before returning
static SerializedBoundingBox serialize(const mesh::BoundingBox &bbm)
mesh::BoundingBox toBoundingBox() const
Builds and returns the BoundingBox represented by the serialized state.
void send(Communication &communication, int rankReceiver)
std::vector< double > coords
void assertValid() const
asserts the content for correctness
SerializedBoundingBox()=default
void broadcastSend(Communication &communication) const
static SerializedConnectionMap receive(Communication &communication, int rankSender)
receives a SerializedConnectionMap and calls assertValid before returning
ConnectionMap toConnectionMap() const
Builds and returns the connection map represented by the serialized state.
std::vector< int > content
static SerializedConnectionMap serialize(const ConnectionMap &cm)
static SerializedConnectionMap broadcastReceive(Communication &communication)
receives a SerializedConnectionMap and calls assertValid before returning
SerializedConnectionMap()=default
std::map< Rank, std::vector< VertexID > > ConnectionMap
void assertValid() const
asserts the content for correctness
void send(Communication &communication, int rankReceiver) const
An axis-aligned bounding box around a (partition of a) mesh.
Eigen::VectorXd maxCorner() const
the max corner of the bounding box
Eigen::VectorXd minCorner() const
the min corner of the bounding box
int getDimension() const
Getter dimension of the bounding box.
contains serialization logic
constexpr auto asVector
Allows to use Communication::AsVectorTag in a less verbose way.