METHOD
dataArgs.h
Go to the documentation of this file.
1 #ifndef DATAARGS_H
2 #define DATAARGS_H
3 
4 #include <vector>
5 #include <string>
6 #include "platformEnv.h"
7 
8 
10 
21 {
22  public:
23 
24  // The following Args are written to a checkpoint restart file and can therefore be initialised from file
25  // if one is provided. They can also be manually set by the user.
26  // -------------------------------------------------------------------------
27 
28  int
30  nx, ny, nz;
31 
32  double
35  ymin, ymax,
36  zmin, zmax,
38  frameSkip=10,
39  endTime,
40  cfl=0.5;
41  int Ng=4;
42  double
43  gamma=5.0/3.0,
44  sigma=1e3;
45  int
48 
49  double
50  cp=0.1;
51  double
52  t=0,
53  dt;
54  int
56  Nx, Ny, Nz;
57 
58 
59  // The following Args are never written to a restart file and therefore must always be manually set by the user
60  // in all cases.
61  // -------------------------------------------------------------------------
62  double mu1=-1.0e4, mu2=1.0e4;
63  int
65  bool
67  double
68  gam=12;
69 
70  std::vector<double>
72  std::vector<std::string>
74  int
76 
79  };
80 
81 };
82 
84 
90 class DataArgs : public DataArgsBase
91 {
92  public:
93 
95 
99  DataArgs(int nx, int ny, int nz,
100  double xmin, double xmax,
101  double ymin, double ymax,
102  double zmin, double zmax,
103  double endTime) {
104  this->nx = nx; this->ny = ny; this->nz = nz;
105  this->xmin = xmin; this->ymin = ymin; this->zmin = zmin;
106  this->xmax = xmax; this->ymax = ymax; this->zmax = zmax;
107  this->endTime = endTime;
108  };
109 
110  DataArgs& sCfl(double cfl) {
111  this->cfl = cfl; return *this;
112  }
113 
114  DataArgs& sNg(double Ng) {
115  this->Ng = Ng; return *this;
116  }
117 
118  DataArgs& sGamma(double gamma) {
119  this->gamma = gamma; return *this;
120  }
121 
122  DataArgs& sSigma(double sigma) {
123  this->sigma = sigma; return *this;
124  }
125 
126  DataArgs& sCp(double cp) {
127  this->cp = cp; return *this;
128  }
129 
130  DataArgs& sMu1(double mu1) {
131  this->mu1 = mu1; return *this;
132  }
133 
134  DataArgs& sMu2(double mu2) {
135  this->mu2 = mu2; return *this;
136  }
137 
139  this->reportItersPeriod = reportItersPeriod; return *this;
140  }
141 
143  this->functionalSigma = functionalSigma; return *this;
144  }
145 
146  DataArgs& sGam(double gam) {
147  this->gam = gam; return *this;
148  }
149 
151  this->frameSkip = frameSkip; return *this;
152  }
153 
154  // input arrays are copied to memory on this object. The input arrays are unchanged and their memory remains allocated
155  // if optionalSimArgs and optionalSimArgNames have already been defined on this object, they are overwritten
156  DataArgs& sOptionalSimArgs(std::vector<double> optionalSimArgs, std::vector<std::string> optionalSimArgNames, int nOptionalSimArgs) {
157  this->nOptionalSimArgs = nOptionalSimArgs;
158  this->optionalSimArgs = optionalSimArgs;
159  this->optionalSimArgNames = optionalSimArgNames;
160  return *this;
161  }
162 
163 };
164 
165 #endif
int Ny
Total number of compute cells in domain in the specified direction.
Definition: dataArgs.h:56
int Nz
Total number of compute cells in domain in the specified direction.
Definition: dataArgs.h:56
int Ng
Number of ghost cells.
Definition: dataArgs.h:41
int Nx
Total number of compute cells in domain in the specified direction.
Definition: dataArgs.h:56
double sigma
Resistivity.
Definition: dataArgs.h:44
DataArgs & sMu2(double mu2)
Definition: dataArgs.h:134
DataArgs & sMu1(double mu1)
Definition: dataArgs.h:130
DataArgs & sOptionalSimArgs(std::vector< double > optionalSimArgs, std::vector< std::string > optionalSimArgNames, int nOptionalSimArgs)
Definition: dataArgs.h:156
DataArgs & sSigma(double sigma)
Definition: dataArgs.h:122
double xmax
Positional limits of domain in specified direction.
Definition: dataArgs.h:34
DataArgs & sNg(double Ng)
Definition: dataArgs.h:114
int ny
Number of physical cells in specified direction.
Definition: dataArgs.h:30
double cfl
Courant factor.
Definition: dataArgs.h:40
int nz
Number of physical cells in specified direction.
Definition: dataArgs.h:30
DataArgs & sfunctionalSigma(bool functionalSigma)
Definition: dataArgs.h:142
int nx
Number of physical cells in specified direction.
Definition: dataArgs.h:30
DataArgs(int nx, int ny, int nz, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax, double endTime)
Constructor.
Definition: dataArgs.h:99
DataArgs & sReportItersPeriod(int reportItersPeriod)
Definition: dataArgs.h:138
double zmin
Positional limits of domain in specified direction.
Definition: dataArgs.h:34
double t
Current time.
Definition: dataArgs.h:52
double endTime
End time of simulation.
Definition: dataArgs.h:38
int reportItersPeriod
Period with which time step data is reported to screen during program execution.
Definition: dataArgs.h:64
double ymax
Positional limits of domain in specified direction.
Definition: dataArgs.h:34
int Ncons
Number of specified variables.
Definition: dataArgs.h:47
DataArgs & sGam(double gam)
Definition: dataArgs.h:146
double mu1
Definition: dataArgs.h:62
double frameSkip
Number of timesteps per file output.
Definition: dataArgs.h:38
std::vector< std::string > optionalSimArgNames
Names of optionalSimArgs array elements.
Definition: dataArgs.h:73
bool functionalSigma
Are we using a functional (vs homogeneous) conductivity?
Definition: dataArgs.h:66
int Naux
Number of specified variables.
Definition: dataArgs.h:47
double xmin
Positional limits of domain in specified direction.
Definition: dataArgs.h:34
DataArgs & sCfl(double cfl)
Definition: dataArgs.h:110
std::vector< double > optionalSimArgs
Array of optional arguments that depend on the simulation being run.
Definition: dataArgs.h:71
double cp
Constant divergence cleaning term.
Definition: dataArgs.h:50
DataArgsBase()
Constructor.
Definition: dataArgs.h:78
double gamma
Adiabatic index.
Definition: dataArgs.h:43
double gam
Exponent in the functional conductivity.
Definition: dataArgs.h:68
DataArgs & sGamma(double gamma)
Definition: dataArgs.h:118
int nOptionalSimArgs
Number of elements to include in optionalSimArgs array.
Definition: dataArgs.h:75
double zmax
Positional limits of domain in specified direction.
Definition: dataArgs.h:34
double mu2
Charge mass ratio of specified fluid species, q/m (for two fluid model)
Definition: dataArgs.h:62
int Nprims
Number of specified variables.
Definition: dataArgs.h:47
double dt
Width of current timestep.
Definition: dataArgs.h:52
Object containing parameters required to populate Data manually (as opposed to from a restart file) ...
Definition: dataArgs.h:90
double ymin
Positional limits of domain in specified direction.
Definition: dataArgs.h:34
Object containing parameters required to populate Data, including from a restart file ...
Definition: dataArgs.h:20
DataArgs & sFrameSkip(double frameSkip)
Definition: dataArgs.h:150
DataArgs & sCp(double cp)
Definition: dataArgs.h:126