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

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

43 {
46  string vDriverModule;
47  DriverSharedPtr drv;
48 
49  try
50  {
51  // Create session reader.
52  session = LibUtilities::SessionReader::CreateInstance(argc, argv);
53 
54  // Create MeshGraph.
55  graph = SpatialDomains::MeshGraph::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  cout << "Error: " << eStr << endl;
74  }
75 
76  return 0;
77 }
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
std::shared_ptr< Driver > DriverSharedPtr
A shared pointer to a Driver object.
Definition: Driver.h:51
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:144
DriverFactory & GetDriverFactory()
Definition: Driver.cpp:65
std::shared_ptr< SessionReader > SessionReaderSharedPtr