Loading...
Searching...
No Matches
ITHACAparameters.C
Go to the documentation of this file.
1#include "ITHACAparameters.H"
2
4
5ITHACAparameters::ITHACAparameters(fvMesh& mesh, Time& localTime)
6 :
7 runTime(localTime),
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 debug = ITHACAdict->lookupOrDefault<bool>("debug", 0);
40 warnings = ITHACAdict->lookupOrDefault<bool>("warnings", 0);
41}
42
44 Time& localTime)
45{
46 if (instance == nullptr)
47 {
48 instance = new ITHACAparameters(mesh, localTime);
49 }
50
51 return instance;
52}
53
55{
56 M_Assert(instance != nullptr,
57 "ITHACAparameters needs to be initialized, call ITHACAparameters::getInstance(mesh, runTime) first");
58 return instance;
59}
Foam::fvMesh & mesh
Definition createMesh.H:47
Foam::Time & runTime
Definition createTime.H:33
#define M_Assert(Expr, Msg)
Class for the definition of some general parameters, the parameters must be defined from the file ITH...
Time & runTime
runTime defined locally
ITHACAparameters(fvMesh &mesh, Time &localTime)
static ITHACAparameters * instance
Pointer to the ITHACAparameters class.
word eigensolver
type of eigensolver used in the eigenvalue decomposition can be either be eigen or spectra
label precision
precision of the output Market Matrix objects (i.e. reduced matrices, eigenvalues,...
IOdictionary * ITHACAdict
Dictionary for input objects from file.
fvMesh & mesh
Mesh object defined locally.
static ITHACAparameters * getInstance()
Gets an instance of ITHACAparameters, to be used if the instance is already existing.
std::_Ios_Fmtflags outytpe
type of output format can be fixed or scientific