21 : m_mpiComm(comm), m_noDim(read_nDim()), m_solverId(solverId) {
26 MPI_Comm_rank(mpiComm(), &m_domainId);
27 MPI_Comm_size(mpiComm(), &m_noDomains);
35 MString solverAlias = std::to_string(m_solverId);
36 solverAlias = Context::getSolverProperty<MString>(
"solverAlias", m_solverId, AT_, &solverAlias);
37 m_aliases[m_solverId] = solverAlias;
42 m_testcaseDir = Context::getSolverProperty<MString>(
"testcaseDir", m_solverId, AT_, &testcaseDir);
43 m_outputDir = Context::getSolverProperty<MString>(
"outputDir", m_solverId, AT_, &testcaseDir);
44 m_restartDir = Context::getSolverProperty<MString>(
"restartDir", m_solverId, AT_, &m_outputDir);
46 Context::getSolverProperty<MString>(
"solutionOutput", m_solverId, AT_, &m_outputDir);
48 m_outputDir = testcaseDir + m_outputDir;
49 m_restartDir = testcaseDir + m_restartDir;
50 m_solutionOutput = testcaseDir + m_solutionOutput;
63 m_restartFile =
false;
64 m_restartFile = Context::getSolverProperty<MBool>(
"restartFile", m_solverId, AT_, &m_restartFile);
78 m_restart = Context::getSolverProperty<MBool>(
"restartFile", m_solverId, AT_, &m_restart);
91 m_residualInterval = Context::getSolverProperty<MInt>(
"residualInterval", m_solverId, AT_);
103 m_restartInterval = -1;
104 m_restartInterval = Context::getSolverProperty<MInt>(
"restartInterval", m_solverId, AT_, &m_restartInterval);
117 m_restartOffset = Context::getSolverProperty<MInt>(
"restartOffset", m_solverId, AT_, &m_restartOffset);
119 m_useNonSpecifiedRestartFile =
false;
120 m_useNonSpecifiedRestartFile =
121 Context::getSolverProperty<MBool>(
"useNonSpecifiedRestartFile", m_solverId, AT_, &m_useNonSpecifiedRestartFile);
134 m_initFromRestartFile =
false;
135 m_initFromRestartFile =
136 Context::getSolverProperty<MBool>(
"initFromRestartFile", m_solverId, AT_, &m_initFromRestartFile);
138 if(!m_restart && !m_initFromRestartFile) {
139 m_restartTimeStep = 0;
141 if(!m_useNonSpecifiedRestartFile) {
142 m_restartTimeStep = Context::getSolverProperty<MInt>(
"restartTimeStep", m_solverId, AT_);
144 m_restartTimeStep = 0;
148 m_solutionInterval = Context::getSolverProperty<MInt>(
"solutionInterval", m_solverId, AT_);
160 m_solverType = Context::getSolverProperty<MString>(
"solvertype", m_solverId, AT_);
162 MString solverMethod =
"defaultMethod";
163 m_solverMethod = Context::getSolverProperty<MString>(
"solverMethod", m_solverId, AT_, &solverMethod);
169 MString propName =
"samplingVariables";
172 propName += featureName;
180 for(
MInt i = 0; i < noVars; i++) {
181 const MString samplingVarName = Context::getSolverProperty<MString>(propName,
solverId(), AT_, i);
182 varNames.push_back(samplingVarName);
191 }
else if(useSolverId) {
192 return preString + std::to_string(
m_solverId) + postString;
static MInt propertyLength(const MString &name, MInt solverId=m_noSolvers)
Returns the number of elements of a property.
static MBool solverPropertyExists(const MString &name, MInt solver)
Checks existence of a solver property details This function returns true, if the solver property with...
static MBool propertyExists(const MString &name, MInt solver=m_noSolvers)
This function checks if a property exists in general.
MInt readSolverSamplingVarNames(std::vector< MString > &varNames, const MString featureName="") const
Read sampling variables names, store in vector and return the number of sampling variables.
static std::map< MInt, MString > m_aliases
MInt solverId() const
Return the solverId.
MString getIdentifier(const MBool useSolverId=false, const MString preString="", const MString postString="_")
const MInt m_solverId
a unique solver identifier
Solver(const MInt solverId, const MPI_Comm comm, const MBool isActive=true)
std::basic_string< char > MString