METHOD
parallelSaveData.h
Go to the documentation of this file.
1 #ifndef PARALLELSAVEDATA_H
2 #define PARALLELSAVEDATA_H
3 
4 #include <string>
5 #include <iostream>
6 #include <cstdio>
7 #include <cstdlib>
8 #include <cstring>
9 #include "simData.h"
10 #include "saveData.h"
11 #include "parallelEnv.h"
12 
13 using namespace std;
14 
16 
27 class ParallelSaveData : public SaveData
28 {
29  public:
31 
32  private:
33 
41  void packStateVectorBuffer(double *buffer, double *stateVector, int nVars);
42 
49  void sendStateVectorBufferToMaster(double *buffer, int numCellsSent, int rank);
50 
59  void unpackStateVectorBuffer(double *buffer, double *stateVector, int nVars, int rank);
60 
69  void copyMasterStateVectorToFullStateVector(double *fullStateVector, double *stateVector, int nVars);
70 
71  // TODO -- docstring
72  void writeStateVectorToFile(FILE *f, double *fullStateVector, int nVars);
73 
74  public:
75 
77  void saveCons();
78 
80  void savePrims();
81 
83  void saveAux();
84 
86  void saveDomain();
87 
89  void saveConsts();
90 
91 
93 
103  ParallelSaveData(Data * data, ParallelEnv * env, int test=0) : SaveData(data, test), env(env) { }
104 
105  virtual ~ParallelSaveData() { }
106 
108 
115  void saveAll(bool timeSeries=false);
116 
118 
125  void saveVar(string variable, int num=1);
126 
127 };
128 
129 #endif
Class used to save simulation data to a text format using multiple processes
Class used to save simulation data
Definition: saveData.h:23
virtual ~ParallelSaveData()
Destructor.
ParallelEnv
Definition: parallelEnv.h:19
ParallelSaveData(Data *data, ParallelEnv *env, int test=0)
Constructor.
Data object
Definition: simData.h:49
ParallelEnv * env
Pointer to PlatformEnv class containing platform specific info such as MPI details.