Nektar++
Functions
LinearElasticSolver.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 43 of file LinearElasticSolver.cpp.

44{
47 string vDriverModule;
49
50 try
51 {
52 // Create session reader.
53 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
54
55 // Create MeshGraph
56 graph = SpatialDomains::MeshGraphIO::Read(session);
57
58 // Create driver
59 session->LoadSolverInfo("Driver", vDriverModule, "Standard");
60 drv = GetDriverFactory().CreateInstance(vDriverModule, session, graph);
61
62 // Execute driver
63 drv->Execute();
64
65 // Finalise session
66 session->Finalise();
67 }
68 catch (const std::runtime_error &e)
69 {
70 return 1;
71 }
72 catch (const std::string &eStr)
73 {
74 cout << "Error: " << eStr << endl;
75 }
76
77 return 0;
78}
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().