Loading...
Searching...
No Matches
ITHACAparameters.C
1#include "ITHACAparameters.H"
2
4
5ITHACAparameters::ITHACAparameters(const fvMesh& mesh, Time& localTime)
6 :
7 runTime(localTime),
8 mesh(mesh)
9{
10 ITHACAdict = new IOdictionary
11 (
12 IOobject
13 (
14 "ITHACAdict",
15 runTime.system(),
16 runTime,
17 IOobject::MUST_READ_IF_MODIFIED,
18 IOobject::NO_WRITE,
19 true
20 )
21 );
22 precision = ITHACAdict->lookupOrDefault<label>("OutPrecision", 10);
23 word typeout = ITHACAdict->lookupOrDefault<word>("OutType", "fixed");
24
25 if (typeout == "fixed")
26 {
27 outytpe = std::ios_base::fixed;
28 }
29
30 if (typeout == "scientific")
31 {
32 outytpe = std::ios_base::scientific;
33 }
34
35 eigensolver = ITHACAdict->lookupOrDefault<word>("EigenSolver", "spectra");
36 exportPython = ITHACAdict->lookupOrDefault<bool>("exportPython", 0);
37 exportMatlab = ITHACAdict->lookupOrDefault<bool>("exportMatlab", 0);
38 exportTxt = ITHACAdict->lookupOrDefault<bool>("exportTxt", 0);
39 exportNpy = ITHACAdict->lookupOrDefault<bool>("exportNpy", 0);
40 debug = ITHACAdict->lookupOrDefault<bool>("debug", 0);
41 warnings = ITHACAdict->lookupOrDefault<bool>("warnings", 0);
42 correctBC = ITHACAdict->lookupOrDefault<bool>("correctBC", 1);
43}
44
45ITHACAparameters* ITHACAparameters::getInstance(const fvMesh& mesh,
46 Time& localTime)
47{
48 if (instance == nullptr)
49 {
50 instance = new ITHACAparameters(mesh, localTime);
51 }
52
53 return instance;
54}
55
57{
58 M_Assert(instance != nullptr,
59 "ITHACAparameters needs to be initialized, call ITHACAparameters::getInstance(mesh, runTime) first");
60 return instance;
61}
Class for the definition of some general parameters, the parameters must be defined from the file ITH...
static ITHACAparameters * instance
Pointer to the ITHACAparameters class.
const fvMesh & mesh
Mesh object defined locally.
static ITHACAparameters * getInstance()
Gets an instance of ITHACAparameters, to be used if the instance is already existing.