|
Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
|
#include <datareducer.h>
Public Member Functions | |
| DataReducer () | |
| ~DataReducer () | |
| bool | addOperator (DRO::DataReductionOperator *op) |
| bool | getDataVectorInfo (const unsigned int &operatorID, std::string &dataType, unsigned int &dataSize, unsigned int &vectorSize) const |
| bool | addMetadata (const unsigned int operatorID, std::string unit, std::string unitLaTeX, std::string variableLaTeX, std::string unitConversion) |
| bool | getMetadata (const unsigned int &operatorID, std::string &unit, std::string &unitLaTeX, std::string &variableLaTeX, std::string &unitConversion) const |
| std::string | getName (const unsigned int &operatorID) const |
| bool | hasParameters (const unsigned int &operatorID) const |
| bool | reduceData (const SpatialCell *cell, const unsigned int &operatorID, char *buffer) |
| bool | reduceDiagnostic (const SpatialCell *cell, const unsigned int &operatorID, Real *result) |
| unsigned int | size () const |
| bool | writeParameters (const unsigned int &operatorID, vlsv::Writer &vlsvWriter) |
| bool | writeFsGridData (const FieldSolverData &fieldSolverData, const std::string &meshName, const unsigned int operatorID, vlsv::Writer &vlsvWriter, const bool writeAsFloat=false) |
| bool | writeIonosphereGridData (SBC::SphericalTriGrid &grid, const std::string &meshName, const unsigned int operatorID, vlsv::Writer &vlsvWriter) |
Private Member Functions | |
| DataReducer (const DataReducer &dr) | |
Private Attributes | |
| std::vector< DRO::DataReductionOperator * > | operators |
The purpose of DataReducer is to contain DRO::DataReductionOperators, and apply them to simulation data when writing output files. Files containing full distribution functions of every spatial cell require so much disk space that they cannot be written out so often as user would want. Thus, derived quantities need to be calculated for every spatial cell, which are then written to data files. This process is here called data reduction.
Definition at line 42 of file datareducer.h.
| DataReducer::DataReducer | ( | ) |
Constructor for class DataReducer.
Definition at line 2887 of file datareducer.cpp.

| DataReducer::~DataReducer | ( | ) |
Destructor for class DataReducer. All stored DataReductionOperators are deleted.
Definition at line 2892 of file datareducer.cpp.
|
private |
Private copy-constructor to prevent copying the class.

| bool DataReducer::addMetadata | ( | const unsigned int | operatorID, |
| std::string | unit, | ||
| std::string | unitLaTeX, | ||
| std::string | variableLaTeX, | ||
| std::string | unitConversion ) |
Add a metadata to the specified DRO::DataReductionOperator.
| operatorID | ID number of the DataReductionOperator to add metadata to |
| unit | string with the physical unit of the DRO result |
| unitLaTeX | LaTeX-formatted string with the physical unit of the DRO result |
| variableLaTeX | LaTeX-formatted string with a descriptive short name for the DRO result |
| conversionFactor | floating point conversion factor between DRO result and SI units |
Definition at line 2941 of file datareducer.cpp.

| bool DataReducer::addOperator | ( | DRO::DataReductionOperator * | op | ) |
Add a new DRO::DataReductionOperator which has been created with new operation. DataReducer will take care of deleting it.
Definition at line 2904 of file datareducer.cpp.

| bool DataReducer::getDataVectorInfo | ( | const unsigned int & | operatorID, |
| std::string & | dataType, | ||
| unsigned int & | dataSize, | ||
| unsigned int & | vectorSize ) const |
Get info on the type of data calculated by the given DataReductionOperator. A DataReductionOperator writes an array on disk. Each element of the array is a vector with n elements. Finally, each vector element has a byte size, as given by the sizeof function.
| operatorID | ID number of the DataReductionOperator whose output data info is requested. |
| dataType | Basic datatype, must be int, uint, or float. |
| dataSize | Byte size of written datatype, for example double-precision floating points have byte size of sizeof(double). |
| vectorSize | How many elements are in the vector returned by the DataReductionOperator. |
Definition at line 2928 of file datareducer.cpp.

| bool DataReducer::getMetadata | ( | const unsigned int & | operatorID, |
| std::string & | unit, | ||
| std::string & | unitLaTeX, | ||
| std::string & | variableLaTeX, | ||
| std::string & | unitConversion ) const |
Get metadata on the unit of data calculated by the given DataReductionOperator.
| operatorID | ID number of the DataReductionOperator whose output unit metadata is requested. |
| unit | Physical unit of variable |
| unitLaTeX | Physical unit of variable, written using LaTeX notation |
| unitConversion | Floating point value of conversion factor to SI units |
Definition at line 2953 of file datareducer.cpp.

| std::string DataReducer::getName | ( | const unsigned int & | operatorID | ) | const |
Get the name of a DataReductionOperator.
| operatorID | ID number of the operator whose name is requested. |
Definition at line 2913 of file datareducer.cpp.

| bool DataReducer::hasParameters | ( | const unsigned int & | operatorID | ) | const |
Ask a DataReductionOperator if it wants to write parameters to the vlsv file header
| operatorID | ID number of the DataReductionOperator. |
Definition at line 2961 of file datareducer.cpp.

| bool DataReducer::reduceData | ( | const SpatialCell * | cell, |
| const unsigned int & | operatorID, | ||
| char * | buffer ) |
Request a DataReductionOperator to calculate its output data and to write it to the given buffer.
| cell | Pointer to spatial cell whose data is to be reduced. |
| operatorID | ID number of the applied DataReductionOperator. |
| buffer | Buffer in which DataReductionOperator should write its data. |
Definition at line 2972 of file datareducer.cpp.


| bool DataReducer::reduceDiagnostic | ( | const SpatialCell * | cell, |
| const unsigned int & | operatorID, | ||
| Real * | result ) |
Request a DataReductionOperator to calculate its output data and to write it to the given variable.
| cell | Pointer to spatial cell whose data is to be reduced. |
| operatorID | ID number of the applied DataReductionOperator. |
| result | Real variable in which DataReductionOperator should write its result. |
Definition at line 2987 of file datareducer.cpp.


| unsigned int DataReducer::size | ( | ) | const |
Get the number of DataReductionOperators stored in DataReducer.
Definition at line 2999 of file datareducer.cpp.

| bool DataReducer::writeFsGridData | ( | const FieldSolverData & | fieldSolverData, |
| const std::string & | meshName, | ||
| const unsigned int | operatorID, | ||
| vlsv::Writer & | vlsvWriter, | ||
| const bool | writeAsFloat = false ) |
Write all data thet the given DataReductionOperator wants to obtain from fsgrid into the output file.
Definition at line 3015 of file datareducer.cpp.


| bool DataReducer::writeIonosphereGridData | ( | SBC::SphericalTriGrid & | grid, |
| const std::string & | meshName, | ||
| const unsigned int | operatorID, | ||
| vlsv::Writer & | vlsvWriter ) |
Definition at line 3030 of file datareducer.cpp.


| bool DataReducer::writeParameters | ( | const unsigned int & | operatorID, |
| vlsv::Writer & | vlsvWriter ) |
Write parameters related to given DataReductionOperator to the output file.
| operatorID | ID number of the selected DataReductionOperator. |
| vlsvWriter | VLSV file writer that has output file open. |
Definition at line 3005 of file datareducer.cpp.


|
private |
A container for all DRO::DataReductionOperators stored in DataReducer.
Definition at line 69 of file datareducer.h.