METHOD
simData.h
Go to the documentation of this file.
1 #ifndef SIMDATA_H
2 #define SIMDATA_H
3 
4 #include <vector>
5 #include <string>
6 #include "platformEnv.h"
7 #include "dataArgs.h"
8 
9 // Macro for getting array index
10 #define ID(variable, idx, jdx, kdx) ((variable)*(d->Nx)*(d->Ny)*(d->Nz) + (idx)*(d->Ny)*(d->Nz) + (jdx)*(d->Nz) + (kdx))
11 
12 
14 
49 class Data
50 {
51  public:
52  int
54  nx, ny, nz;
55 
56  double
59  ymin, ymax,
60  zmin, zmax,
62  endTime,
63  cfl;
64  int Ng;
65  double
67  sigma;
68  int
70  bcsSet,
71 
72  Ncons, Nprims, Naux;
73 
74  double
75  cp,
76 
77  mu1, mu2;
78 
79  int
81  int
83  bool
85  double
86  gam;
87  double
89  *cons, *prims, *aux,
90  *f, *fnet,
91  *source,
94 
95  *x, *y, *z;
96 
97  double
100 
101  t=-1,
102  dt,
103 
104  dx, dy, dz;
105 
106  int
108 
109  Nx, Ny, Nz, Ntot;
110 
111  std::vector<std::string>
114  primsLabels,
115  auxLabels;
117  int
119 
120  is, js, ks,
121  ie, je, ke;
122 
123  std::vector<double>
125  std::vector<std::string>
127  int
129 
130 
132 
142  int id(int var, int i, int j, int k) {
143  return var * this->Nx * this->Ny * this->Nz + i * this->Ny * this->Nz + j * this->Nz + k;
144  }
145 
146 
148 
164  double sigmaFunc(double * cons, double * prims, double * aux, int i=-1, int j=-1, int k=-1);
165 
167 
175  void initData(PlatformEnv *env, int nOptionalSimArgs=0, std::vector<double> optionalSimArgs=std::vector<double>(), std::vector<std::string> optionalSimArgNames=std::vector<std::string>());
176 
177 
179 
205  Data(int nx, int ny, int nz,
206  double xmin, double xmax,
207  double ymin, double ymax,
208  double zmin, double zmax,
209  double endTime,
210  PlatformEnv *env,
211  double cfl=0.5, int Ng=4,
212  double gamma=5.0/3.0,
213  double sigma=1e3,
214  double cp=0.1,
215  double mu1=-1.0e4, double mu2=1.0e4,
216  int frameskip=10,
217  int reportItersPeriod=1,
218  bool funtionalSigma=false, double gam=12);
219 
221 
229  Data(DataArgsBase args, PlatformEnv *env);
230 
231  ~Data() {};
232 
233 };
234 
235 #endif
double * y
Specified coordinate location of the center of the compute cells (incl ghost cells) ...
Definition: simData.h:89
int reportItersPeriod
Period with which time step data is reported to screen during program execution.
Definition: simData.h:82
double dx
Witdth of specified spatial step.
Definition: simData.h:101
int is
Cell IDs for interior grid points.
Definition: simData.h:118
int js
Cell IDs for interior grid points.
Definition: simData.h:118
int ny
Number of physical cells in specified direction.
Definition: simData.h:54
int iters
Number of iterations that have been completed.
Definition: simData.h:107
int memSet
Indicator that memory has been allocated for state vectors.
Definition: simData.h:69
double dt
Width of current timestep.
Definition: simData.h:101
int dims
Number of dimensions of simulation.
Definition: simData.h:118
double * prims
Pointer to specified work array.
Definition: simData.h:89
Data(int nx, int ny, int nz, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double endTime, PlatformEnv *env, double cfl=0.5, int Ng=4, double gamma=5.0/3.0, double sigma=1e3, double cp=0.1, double mu1=-1.0e4, double mu2=1.0e4, int frameskip=10, int reportItersPeriod=1, bool funtionalSigma=false, double gam=12)
Constructor – all vars specified by comma separated list.
double * sourceExtension
Pointer to specified work array.
Definition: simData.h:89
std::vector< std::string > auxLabels
Vector of labels for the specified variables.
Definition: simData.h:113
double dy
Witdth of specified spatial step.
Definition: simData.h:101
double * source
Pointer to specified work array.
Definition: simData.h:89
PlatformEnv
Definition: platformEnv.h:16
int Ny
Total number of compute cells in domain in the specified direction.
Definition: simData.h:107
double t
Current time.
Definition: simData.h:101
int frameSkip
Number of timesteps per file output.
Definition: simData.h:80
int Ng
Number of ghost cells.
Definition: simData.h:64
double * x
Specified coordinate location of the center of the compute cells (incl ghost cells) ...
Definition: simData.h:89
double sigmaFunc(double *cons, double *prims, double *aux, int i=-1, int j=-1, int k=-1)
General form of conductivity.
std::vector< std::string > consLabels
Vector of labels for the specified variables.
Definition: simData.h:113
int id(int var, int i, int j, int k)
Element ID function.
Definition: simData.h:142
double * aux
Pointer to specified work array.
Definition: simData.h:89
std::vector< double > optionalSimArgs
Array of optional arguments that depend on the simulation being run.
Definition: simData.h:124
double zmax
Positional limits of domain in specified direction.
Definition: simData.h:58
double mu1
Charge mass ratio of specified fluid species, q/m (for two fluid model)
Definition: simData.h:75
int ks
Cell IDs for interior grid points.
Definition: simData.h:118
double mu2
Charge mass ratio of specified fluid species, q/m (for two fluid model)
Definition: simData.h:75
int Ntot
Total number of compute cells in domain in the specified direction.
Definition: simData.h:107
int Nz
Total number of compute cells in domain in the specified direction.
Definition: simData.h:107
double zmin
Positional limits of domain in specified direction.
Definition: simData.h:58
int nz
Number of physical cells in specified direction.
Definition: simData.h:54
double alphaY
Max wave speed in specified direction. As we are evolving EM fields, this is always the speed of ligh...
Definition: simData.h:99
double * f
Pointer to specified work array.
Definition: simData.h:89
std::vector< std::string > primsLabels
Vector of labels for the specified variables.
Definition: simData.h:113
int bcsSet
Indicator that boundary conditions have been created (before this information about the domain decomp...
Definition: simData.h:69
double alphaX
Max wave speed in specified direction. As we are evolving EM fields, this is always the speed of ligh...
Definition: simData.h:99
~Data()
Definition: simData.h:231
double ymax
Positional limits of domain in specified direction.
Definition: simData.h:58
double endTime
End time of simulation.
Definition: simData.h:58
int nOptionalSimArgs
Number of elements to include in optionalSimArgs array.
Definition: simData.h:128
double * cons
Pointer to specified work array.
Definition: simData.h:89
double sigma
Resistivity.
Definition: simData.h:66
double xmax
Positional limits of domain in specified direction.
Definition: simData.h:58
int je
Cell IDs for interior grid points.
Definition: simData.h:118
int ke
Cell IDs for interior grid points.
Definition: simData.h:118
std::vector< std::string > optionalSimArgNames
Names of optionalSimArgs array elements.
Definition: simData.h:126
int Naux
Number of specified variables.
Definition: simData.h:69
int Nprims
Number of specified variables.
Definition: simData.h:69
double xmin
Positional limits of domain in specified direction.
Definition: simData.h:58
double gamma
Adiabatic index.
Definition: simData.h:66
double * z
Specified coordinate location of the center of the compute cells (incl ghost cells) ...
Definition: simData.h:89
double cp
Constant divergence cleaning term.
Definition: simData.h:75
double gam
Exponent in the functional conductivity.
Definition: simData.h:86
Data object
Definition: simData.h:49
int ie
Cell IDs for interior grid points.
Definition: simData.h:118
double cfl
Courant factor.
Definition: simData.h:58
double ymin
Positional limits of domain in specified direction.
Definition: simData.h:58
double dz
Witdth of specified spatial step.
Definition: simData.h:101
bool functionalSigma
Are we using a functional (vs homogeneous) conductivity?
Definition: simData.h:84
int nx
Number of physical cells in specified direction.
Definition: simData.h:54
double alphaZ
Max wave speed in specified direction. As we are evolving EM fields, this is always the speed of ligh...
Definition: simData.h:99
int Nx
Total number of compute cells in domain in the specified direction.
Definition: simData.h:107
Object containing parameters required to populate Data, including from a restart file ...
Definition: dataArgs.h:20
int Ncons
Number of specified variables.
Definition: simData.h:69
void initData(PlatformEnv *env, int nOptionalSimArgs=0, std::vector< double > optionalSimArgs=std::vector< double >(), std::vector< std::string > optionalSimArgNames=std::vector< std::string >())
Initialiser.
double * fnet
Pointer to specified work array.
Definition: simData.h:89