Nektar++
Functions
MMFSolver.cpp File Reference
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <SolverUtils/Driver.h>
#include <SpatialDomains/MeshGraphIO.h>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 42 of file MMFSolver.cpp.

43{
46 std::string vDriverModule;
48
49 try
50 {
51 // Create session reader.
52 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
53
54 // Create MeshGraph
55 graph = SpatialDomains::MeshGraphIO::Read(session);
56
57 // Create driver
58 session->LoadSolverInfo("Driver", vDriverModule, "Standard");
59 drv = GetDriverFactory().CreateInstance(vDriverModule, session, graph);
60
61 // Execute driver
62 drv->Execute();
63
64 // Finalise session
65 session->Finalise();
66 }
67 catch (const std::runtime_error &e)
68 {
69 return 1;
70 }
71 catch (const std::string &eStr)
72 {
73 std::cout << "Error: " << eStr << std::endl;
74 }
75
76 return 0;
77}
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< Driver > DriverSharedPtr
A shared pointer to a Driver object.
Definition: Driver.h:52
DriverFactory & GetDriverFactory()
Definition: Driver.cpp:66
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174

References Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), and Nektar::SolverUtils::GetDriverFactory().