preCICE v3.1.2
Loading...
Searching...
No Matches
SerializedStamples.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <Eigen/Core>
4#include <vector>
6
7namespace precice {
8namespace com {
9class Communication;
10
11namespace serialize {
12
15public:
23
31 static SerializedStamples empty(Eigen::VectorXd timeStamps, const cplscheme::PtrCouplingData data);
32
39 void deserializeInto(const Eigen::VectorXd &timeStamps, const cplscheme::PtrCouplingData data);
40
46 const Eigen::VectorXd &values() const;
47
53 Eigen::VectorXd &values();
54
60 const Eigen::VectorXd &gradients() const;
61
67 Eigen::VectorXd &gradients();
68
74 int nTimeSteps() const;
75
76private:
77 SerializedStamples() = default;
78
79 // Allocates _values and gradients for size matching data and _timeSteps
80 void allocate(const cplscheme::PtrCouplingData data);
81
88
95
102 void deserialize(const Eigen::VectorXd timeStamps, cplscheme::PtrCouplingData data) const;
103
105 Eigen::VectorXd _values;
106
108 Eigen::VectorXd _gradients;
109
111 int _timeSteps = 0;
112};
113
114} // namespace serialize
115} // namespace com
116} // namespace precice
serialized representation of CouplingData
Eigen::VectorXd _gradients
Buffer for serialized gradients of stamples.
void deserializeInto(const Eigen::VectorXd &timeStamps, const cplscheme::PtrCouplingData data)
Deserialize data from this SerializedStamples into provided CouplingData.
int _timeSteps
number of timesteps stored in SerializedStamples
void deserialize(const Eigen::VectorXd timeStamps, cplscheme::PtrCouplingData data) const
Deserialize _values and (if required by data) _gradients into timeStepsStorage of data....
void serializeValues(const cplscheme::PtrCouplingData data)
Serialize values from timeStepsStorage of data into _values.
const Eigen::VectorXd & gradients() const
const reference to serialized gradients. Used for sending serialized gradients.
void allocate(const cplscheme::PtrCouplingData data)
static SerializedStamples empty(Eigen::VectorXd timeStamps, const cplscheme::PtrCouplingData data)
Create SerializedStamples with allocated buffers according to size of CouplingData.
Eigen::VectorXd _values
Buffer for serialized values of stamples.
void serializeGradients(const cplscheme::PtrCouplingData data)
Serialize gradients from timeStepsStorage of data into _gradients.
int nTimeSteps() const
Returns number of timeSteps.
static SerializedStamples serialize(const cplscheme::PtrCouplingData data)
Serializes a given CouplingData into SerializedStamples.
const Eigen::VectorXd & values() const
const reference to serialized values. Used for sending serialized values.
Main namespace of the precice library.