preCICE v3.1.2
Loading...
Searching...
No Matches
SerializedMesh.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
5namespace precice {
6namespace mesh {
7class Mesh;
8} // namespace mesh
9namespace com {
10class Communication;
11
12namespace serialize {
13
16public:
21 static SerializedMesh serialize(const mesh::Mesh &mesh);
22
27 void addToMesh(mesh::Mesh &mesh) const;
28
30 void assertValid() const;
31
32 void send(Communication &communication, int rankReceiver);
33
35 static SerializedMesh receive(Communication &communication, int rankSender);
36
37 void broadcastSend(Communication &communication);
38
40 static SerializedMesh broadcastReceive(Communication &communication);
41
42private:
43 SerializedMesh() = default;
44
47
50
51 // if no connectivity ( sum(sizes[1-3]) == 0)
52 // then contains sizes[0] global IDs
53 // else contains sizes[0] pairs of (global id, local id)
54 // followed by sizes[1] pairs of local ids defining edges
55 // followed by sizes[2] triples of local ids defining triangles
56 // followed by sizes[3] quadruples of local ids defining tetrahedra
58};
59
60} // namespace serialize
61} // namespace com
62} // namespace precice
Interface for all interprocess communication classes.
serialized representation of mesh::Mesh
static SerializedMesh serialize(const mesh::Mesh &mesh)
std::vector< double > coords
sizes[0] * dimension coordinates for vertices
void broadcastSend(Communication &communication)
static SerializedMesh receive(Communication &communication, int rankSender)
receives a SerializedMesh and calls assertValid before returning
static SerializedMesh broadcastReceive(Communication &communication)
receives a SerializedMesh and calls assertValid before returning
void send(Communication &communication, int rankReceiver)
void addToMesh(mesh::Mesh &mesh) const
std::vector< int > sizes
contains the dimension, followed by the numbers of vertices, edges, triangles, and tetrahedra
void assertValid() const
asserts the content for correctness
Container and creator for meshes.
Definition Mesh.hpp:39
Main namespace of the precice library.