75 : m_comm(pSession->GetComm()), m_session(pSession), m_graph(pGraph)
88 "EqType SolverInfo tag must be defined.");
89 std::string vEquation =
m_session->GetSolverInfo(
"EqType");
90 if (
m_session->DefinesSolverInfo(
"SolverType"))
92 vEquation =
m_session->GetSolverInfo(
"SolverType");
98 "EquationSystem '" + vEquation +
100 "Ensure equation name is correct and module is compiled.\n");
106 "EvolutionOperator");
119 m_session->SetTag(
"AdvectiveType",
"Convective");
124 m_session->SetTag(
"AdvectiveType",
"Linearised");
129 m_session->SetTag(
"AdvectiveType",
"Adjoint");
135 m_session->SetTag(
"AdvectiveType",
"Linearised");
140 m_session->SetTag(
"AdvectiveType",
"Adjoint");
145 m_session->SetTag(
"AdvectiveType",
"SkewSymmetric");
153 m_session->DefinesCmdLineArgument(
"use-opt-file");
154 std::string optfilename =
155 useOptFile ?
m_session->GetFilenames()[0] :
"";
157 char *argv[] = {
const_cast<char *
>(
"IncNavierStokesSolver"),
158 const_cast<char *
>(
"--use-opt-file"),
159 const_cast<char *
>(optfilename.c_str()),
162 size_t argc = useOptFile ? 3 : 1;
164 std::vector<std::string> LinNSFilename;
165 if (
m_comm->GetSize() == 1)
168 LinNSFilename.push_back(
m_session->GetSessionName() +
174 LinNSFilename.push_back(
m_session->GetSessionName() +
177 LinNSFilename.push_back(
m_session->GetSessionName() +
181 argc, argv, LinNSFilename,
m_comm);
193 m_session->SetTag(
"AdvectiveType",
"Convective");
199 ASSERTL0(
false,
"Unrecognised evolution operator.");
204 ASSERTL0(e == -1,
"No such class class defined.");
205 out <<
"An error occurred during driver initialisation." << std::endl;
#define ASSERTL0(condition, msg)
Provides a generic Factory class.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static std::string RegisterEnumValue(std::string pEnum, std::string pString, int pEnumValue)
Registers an enumeration value.
static SessionReaderSharedPtr CreateInstance(int argc, char *argv[])
Creates an instance of the SessionReader class.
static std::string RegisterDefaultSolverInfo(const std::string &pName, const std::string &pValue)
Registers the default string value of a solver info property.
LibUtilities::SessionReaderSharedPtr session_LinNS
Coupling between SFD and arnoldi.
LibUtilities::SessionReaderSharedPtr m_session
Session reader object.
virtual SOLVER_UTILS_EXPORT void v_InitObject(std::ostream &out=std::cout)
Virtual function for initialisation implementation.
static std::string evolutionOperatorLookupIds[]
Driver(const LibUtilities::SessionReaderSharedPtr pSession, const SpatialDomains::MeshGraphSharedPtr pGraph)
Initialises EquationSystem class members.
LibUtilities::CommSharedPtr m_comm
Communication object.
SpatialDomains::MeshGraphSharedPtr m_graph
MeshGraph object.
enum EvolutionOperatorType m_EvolutionOperator
Evolution Operator.
Array< OneD, EquationSystemSharedPtr > m_equ
Equation system to solve.
static std::string driverDefault
int m_nequ
number of equations
static std::string evolutionOperatorDef
static MeshGraphSharedPtr Read(const LibUtilities::SessionReaderSharedPtr pSession, LibUtilities::DomainRangeShPtr rng=LibUtilities::NullDomainRangeShPtr, bool fillGraph=true, SpatialDomains::MeshGraphSharedPtr partitionedGraph=nullptr)
std::shared_ptr< SessionReader > SessionReaderSharedPtr
DriverFactory & GetDriverFactory()
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr