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

46{
49 string vDriverModule;
51
52 try
53 {
54 // Create session reader.
55 session = LibUtilities::SessionReader::CreateInstance(argc, argv);
56
57 // Create MeshGraph.
58 graph = SpatialDomains::MeshGraphIO::Read(session);
59
60 // Create driver
61 session->LoadSolverInfo("Driver", vDriverModule, "Standard");
62 drv = GetDriverFactory().CreateInstance(vDriverModule, session, graph);
63
65 timer.Start();
66 // Execute driver
67 drv->Execute();
68 timer.Stop();
69 timer.AccumulateRegion("Execute");
70 // Print out timings
71 int iolevel = 0;
72
73 session->LoadParameter("IO_Timer_Level", iolevel, 0);
74
75 // Print out timings
76 LibUtilities::Timer::PrintElapsedRegions(
77 session->GetComm()->GetSpaceComm(), std::cout, iolevel);
78 // Finalise communications
79 session->Finalise();
80 }
81 catch (const std::runtime_error &)
82 {
83 return 1;
84 }
85 catch (const std::string &eStr)
86 {
87 cout << "Error: " << eStr << endl;
88 }
89
90 return 0;
91}
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().