Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
datareducer.h
Go to the documentation of this file.
1/*
2 * This file is part of Vlasiator.
3 * Copyright 2010-2016 Finnish Meteorological Institute
4 *
5 * For details of usage, see the COPYING file and read the "Rules of the Road"
6 * at http://www.physics.helsinki.fi/vlasiator/
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 */
22
23#ifndef DATAREDUCER_H
24#define DATAREDUCER_H
25
26#include "../grid.h"
27#include <vector>
28#include "fsgrid.hpp"
29
30#include "../definitions.h"
34
43 public:
46
48 bool getDataVectorInfo(const unsigned int& operatorID,std::string& dataType,
49 unsigned int& dataSize,unsigned int& vectorSize) const;
50 bool addMetadata(const unsigned int operatorID,std::string unit,std::string unitLaTeX,std::string variableLaTeX,std::string unitConversion);
51 bool getMetadata(const unsigned int& operatorID,std::string& unit,std::string& unitLaTeX,std::string& variableLaTeX,std::string& unitConversion) const;
52
53 std::string getName(const unsigned int& operatorID) const;
54 bool hasParameters(const unsigned int& operatorID) const;
55 bool reduceData(const SpatialCell* cell,const unsigned int& operatorID,char* buffer);
56 bool reduceDiagnostic(const SpatialCell* cell,const unsigned int& operatorID,Real * result);
57 unsigned int size() const;
58 bool writeParameters(const unsigned int& operatorID, vlsv::Writer& vlsvWriter);
59 bool writeFsGridData(const FieldSolverData& fieldSolverData, const std::string& meshName,
60 const unsigned int operatorID, vlsv::Writer& vlsvWriter, const bool writeAsFloat = false);
61 bool writeIonosphereGridData(SBC::SphericalTriGrid& grid, const std::string& meshName,
62 const unsigned int operatorID, vlsv::Writer& vlsvWriter);
63
64 private:
68
69 std::vector<DRO::DataReductionOperator*> operators;
71};
72
73void initializeDataReducers(DataReducer * outputReducer, DataReducer * diagnosticReducer);
74
75#endif
bool reduceDiagnostic(const SpatialCell *cell, const unsigned int &operatorID, Real *result)
bool getMetadata(const unsigned int &operatorID, std::string &unit, std::string &unitLaTeX, std::string &variableLaTeX, std::string &unitConversion) const
unsigned int size() const
bool writeFsGridData(const FieldSolverData &fieldSolverData, const std::string &meshName, const unsigned int operatorID, vlsv::Writer &vlsvWriter, const bool writeAsFloat=false)
bool addOperator(DRO::DataReductionOperator *op)
bool hasParameters(const unsigned int &operatorID) const
bool addMetadata(const unsigned int operatorID, std::string unit, std::string unitLaTeX, std::string variableLaTeX, std::string unitConversion)
bool writeParameters(const unsigned int &operatorID, vlsv::Writer &vlsvWriter)
std::string getName(const unsigned int &operatorID) const
bool reduceData(const SpatialCell *cell, const unsigned int &operatorID, char *buffer)
std::vector< DRO::DataReductionOperator * > operators
Definition datareducer.h:69
bool writeIonosphereGridData(SBC::SphericalTriGrid &grid, const std::string &meshName, const unsigned int operatorID, vlsv::Writer &vlsvWriter)
DataReducer(const DataReducer &dr)
bool getDataVectorInfo(const unsigned int &operatorID, std::string &dataType, unsigned int &dataSize, unsigned int &vectorSize) const
void initializeDataReducers(DataReducer *outputReducer, DataReducer *diagnosticReducer)
float Real
Definition definitions.h:41