18 :
Action(timing, mesh, mapping::Mapping::MeshRequirement::VERTEX), _targetData(mesh->data(targetDataID))
21 for (
int sourceID : sourceDataIDs) {
26 PRECICE_CHECK(source->getDimensions() ==
_targetData->getDimensions(),
"Source and target data dimensions (scalar or vector) of summation action need to be identical.");
35 const int nStamples = referenceData->stamples().size();
36 for (
int stampleId = 0; stampleId < nStamples; stampleId++) {
38 targetValues.setZero();
39 const double currentTimestamp = referenceData->stamples()[stampleId].timestamp;
41 auto sourceStample = sourceData->stamples()[stampleId];
42 PRECICE_CHECK(
math::equals(sourceStample.timestamp, currentTimestamp),
"Trying to perform summation action on samples with different timestamps: expected timestamp {}, but got source data with timestamp {}. Time meshes of all source data must agree. Actions do not fully support subcycling yet.", currentTimestamp, sourceStample.timestamp);
43 auto sourceDataValues = sourceStample.sample.values;
44 targetValues += sourceDataValues;
#define PRECICE_TRACE(...)
#define PRECICE_CHECK(check,...)
Abstract base class for configurable actions on data and/or meshes.
Timing
Defines the time and place of application of the action.
std::vector< mesh::PtrData > _sourceDataVector
mesh::PtrData _targetData
SummationAction(Timing timing, const std::vector< int > &sourceDataIDs, int targetDataID, const mesh::PtrMesh &mesh)
Constructor.
void performAction() final override
Adding data and applying them to target.
contains actions to modify exchanged data.
constexpr bool equals(const Eigen::MatrixBase< DerivedA > &A, const Eigen::MatrixBase< DerivedB > &B, double tolerance=NUMERICAL_ZERO_DIFFERENCE)
Compares two Eigen::MatrixBase for equality up to tolerance.