Nektar++
Functions
CompressibleFlowSolver.cpp File Reference
#include <LibUtilities/BasicUtils/SessionReader.h>
#include <SolverUtils/Driver.h>
#include <SolverUtils/EquationSystem.h>
#include <SpatialDomains/MeshGraphIO.h>
#include <LibUtilities/BasicUtils/Timer.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 46 of file CompressibleFlowSolver.cpp.

47{
50 string vDriverModule;
52
53 try
54 {
55 // Create session reader.
56 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
57
58 // Create MeshGraph.
59 graph = SpatialDomains::MeshGraphIO::Read(session);
60
61 // Create driver
62 session->LoadSolverInfo("Driver", vDriverModule, "Standard");
63 drv = GetDriverFactory().CreateInstance(vDriverModule, session, graph);
64
66 timer.Start();
67
68 // Execute driver
69 drv->Execute();
70
71 timer.Stop();
72 timer.AccumulateRegion("Execute");
73
74 // Print out timings
75 int iolevel = 0;
76
77 session->LoadParameter("IO_Timer_Level", iolevel, -1);
78
79 LibUtilities::Timer::PrintElapsedRegions(
80 session->GetComm()->GetSpaceComm(), std::cout, iolevel);
81
82 // Finalise communications
83 session->Finalise();
84 }
85 catch (const std::runtime_error &)
86 {
87 return 1;
88 }
89 catch (const std::string &eStr)
90 {
91 cout << "Error: " << eStr << endl;
92 }
93
94 return 0;
95}
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
void AccumulateRegion(std::string, int iolevel=0)
Accumulate elapsed time for a region.
Definition: Timer.cpp:70
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::Timer::AccumulateRegion(), Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::SolverUtils::GetDriverFactory(), Nektar::LibUtilities::Timer::Start(), and Nektar::LibUtilities::Timer::Stop().