23#ifndef DRO_POPULATIONS_H
24#define DRO_POPULATIONS_H
40 virtual bool getDataVectorInfo(std::string& dataType,
unsigned int& dataSize,
unsigned int& vectorSize)
const {
41 std::cerr <<
"Error! Trying to perform population-based data reducer on unspecialized template!" << std::endl;
61 std::cerr <<
"Warning: trying to use variable " <<
getName() <<
" as a diagnostic reducer, but it's vectorSize is " <<
_vectorSize <<
" > 1" << std::endl;
71 *target = *
reinterpret_cast<const Real*
>(ptr);
81 const T* ptr =
reinterpret_cast<const T*
>(population_struct +
_byteOffset);
84 if(!std::isfinite(ptr[
i])) {
85 std::string message =
"The DataReductionOperator " + this->
getName() +
" returned a nan or an inf.";
86 bailout(
true, message, __FILE__, __LINE__);
104 dataSize =
sizeof(
Real);
110 dataSize =
sizeof(int);
116 dataSize =
sizeof(uint);
virtual bool getDataVectorInfo(std::string &dataType, unsigned int &dataSize, unsigned int &vectorSize) const
virtual bool reduceData(const spatial_cell::SpatialCell *cell, char *buffer)
virtual ~DataReductionOperatorPopulations()
virtual bool reduceDiagnostic(const spatial_cell::SpatialCell *cell, Real *target)
virtual std::string getName() const
virtual bool setSpatialCell(const spatial_cell::SpatialCell *cell)
DataReductionOperatorPopulations(const std::string &name, const uint popID, const unsigned int byteOffset, const unsigned int vectorSize)
Population & get_population(const uint popID)
void bailout(const bool condition, const std::string &message, const char *const file, const int line)
A function to stop the simulation if the boolean condition is true. Raises a flag which gets MPI_Redu...