Nektar++
Functions
MMFSolver.cpp File Reference
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <SolverUtils/Driver.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 41 of file MMFSolver.cpp.

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

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