Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Attributes | Friends | List of all members
Nektar::SolverUtils::DriverStandard Class Reference

Base class for the development of solvers. More...

#include <DriverStandard.h>

Inheritance diagram for Nektar::SolverUtils::DriverStandard:
Inheritance graph
[legend]
Collaboration diagram for Nektar::SolverUtils::DriverStandard:
Collaboration graph
[legend]

Static Public Member Functions

static DriverSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession)
 Creates an instance of this class.

Static Public Attributes

static std::string className = GetDriverFactory().RegisterCreatorFunction("Standard", DriverStandard::create)
 Name of the class.

Protected Member Functions

SOLVER_UTILS_EXPORT DriverStandard (const LibUtilities::SessionReaderSharedPtr pSession)
 Constructor.
virtual SOLVER_UTILS_EXPORT ~DriverStandard ()
 Destructor.
virtual SOLVER_UTILS_EXPORT void v_InitObject (ostream &out=cout)
 Second-stage initialisation.
virtual SOLVER_UTILS_EXPORT void v_Execute (ostream &out=cout)
 Virtual function for solve implementation.
- Protected Member Functions inherited from Nektar::SolverUtils::Driver
 Driver (const LibUtilities::SessionReaderSharedPtr pSession)
 Initialises EquationSystem class members.
virtual SOLVER_UTILS_EXPORT
Array< OneD, NekDouble
v_GetRealEvl (void)
virtual SOLVER_UTILS_EXPORT
Array< OneD, NekDouble
v_GetImagEvl (void)

Static Protected Attributes

static std::string driverLookupId = LibUtilities::SessionReader::RegisterEnumValue("Driver","Standard",0)
- Static Protected Attributes inherited from Nektar::SolverUtils::Driver
static std::string evolutionOperatorLookupIds []
static std::string evolutionOperatorDef = LibUtilities::SessionReader::RegisterDefaultSolverInfo("EvolutionOperator","Nonlinear")
static std::string driverDefault = LibUtilities::SessionReader::RegisterDefaultSolverInfo("Driver","Standard")

Friends

class MemoryManager< DriverStandard >

Additional Inherited Members

- Public Member Functions inherited from Nektar::SolverUtils::Driver
virtual ~Driver ()
 Destructor.
SOLVER_UTILS_EXPORT void InitObject (ostream &out=cout)
 Initialise Object.
SOLVER_UTILS_EXPORT void Execute (ostream &out=cout)
 Execute driver.
SOLVER_UTILS_EXPORT Array
< OneD,
EquationSystemSharedPtr
GetEqu ()
SOLVER_UTILS_EXPORT Array
< OneD, NekDouble
GetRealEvl (void)
SOLVER_UTILS_EXPORT Array
< OneD, NekDouble
GetImagEvl (void)
- Protected Attributes inherited from Nektar::SolverUtils::Driver
LibUtilities::CommSharedPtr m_comm
 Communication object.
LibUtilities::SessionReaderSharedPtr m_session
 Session reader object.
Array< OneD,
EquationSystemSharedPtr
m_equ
 Equation system to solve.
int m_nequ
 number of equations
enum EvolutionOperatorType m_EvolutionOperator
 Evolution Operator.

Detailed Description

Base class for the development of solvers.

Definition at line 46 of file DriverStandard.h.

Constructor & Destructor Documentation

Nektar::SolverUtils::DriverStandard::DriverStandard ( const LibUtilities::SessionReaderSharedPtr  pSession)
protected

Constructor.

Definition at line 50 of file DriverStandard.cpp.

: Driver(pSession)
{
}
Nektar::SolverUtils::DriverStandard::~DriverStandard ( )
protectedvirtual

Destructor.

Definition at line 59 of file DriverStandard.cpp.

{
}

Member Function Documentation

static DriverSharedPtr Nektar::SolverUtils::DriverStandard::create ( const LibUtilities::SessionReaderSharedPtr pSession)
inlinestatic

Creates an instance of this class.

Definition at line 52 of file DriverStandard.h.

{
p->InitObject();
return p;
}
void Nektar::SolverUtils::DriverStandard::v_Execute ( ostream &  out = cout)
protectedvirtual

Virtual function for solve implementation.

Implements Nektar::SolverUtils::Driver.

Definition at line 73 of file DriverStandard.cpp.

References Nektar::SolverUtils::Driver::m_comm, and Nektar::SolverUtils::Driver::m_equ.

{
time_t starttime, endtime;
NekDouble CPUtime;
m_equ[0]->PrintSummary(out);
time(&starttime);
m_equ[0]->DoInitialise();
m_equ[0]->DoSolve();
time(&endtime);
m_equ[0]->Output();
if (m_comm->GetRank() == 0)
{
CPUtime = difftime(endtime, starttime);
cout << "-------------------------------------------" << endl;
cout << "Total Computation Time = " << CPUtime << "s" << endl;
cout << "-------------------------------------------" << endl;
}
// Evaluate and output computation time and solution accuracy.
// The specific format of the error output is essential for the
// regression tests to work.
// Evaluate L2 Error
for(int i = 0; i < m_equ[0]->GetNvariables(); ++i)
{
Array<OneD, NekDouble> exactsoln(m_equ[0]->GetTotPoints(), 0.0);
// Evaluate "ExactSolution" function, or zero array
m_equ[0]->EvaluateExactSolution(i, exactsoln,
m_equ[0]->GetFinalTime());
NekDouble vL2Error = m_equ[0]->L2Error (i, exactsoln);
NekDouble vLinfError = m_equ[0]->LinfError(i, exactsoln);
if (m_comm->GetRank() == 0)
{
out << "L 2 error (variable " << m_equ[0]->GetVariable(i)
<< ") : " << vL2Error << endl;
out << "L inf error (variable " << m_equ[0]->GetVariable(i)
<< ") : " << vLinfError << endl;
}
}
}
void Nektar::SolverUtils::DriverStandard::v_InitObject ( ostream &  out = cout)
protectedvirtual

Second-stage initialisation.

Reimplemented from Nektar::SolverUtils::Driver.

Definition at line 67 of file DriverStandard.cpp.

Friends And Related Function Documentation

friend class MemoryManager< DriverStandard >
friend

Definition at line 49 of file DriverStandard.h.

Member Data Documentation

string Nektar::SolverUtils::DriverStandard::className = GetDriverFactory().RegisterCreatorFunction("Standard", DriverStandard::create)
static

Name of the class.

Definition at line 59 of file DriverStandard.h.

string Nektar::SolverUtils::DriverStandard::driverLookupId = LibUtilities::SessionReader::RegisterEnumValue("Driver","Standard",0)
staticprotected

Definition at line 74 of file DriverStandard.h.