Nektar++
Public Member Functions | List of all members
EquationSystemWrap< T > Struct Template Reference

EquationSystem wrapper to handle virtual function calls in EquationSystem and its subclasses. More...

#include <EquationSystem.h>

Inheritance diagram for EquationSystemWrap< T >:
[legend]

Public Member Functions

 EquationSystemWrap (LibUtilities::SessionReaderSharedPtr session, SpatialDomains::MeshGraphSharedPtr graph)
 Constructor, which is identical to Filter. More...
 
void v_InitObject (bool declareField) override
 
void Default_v_InitObject (bool declareField)
 
void v_DoInitialise (bool dumpInitialConditions) override
 
void Default_v_DoInitialise (bool dumpInitialConditions)
 
void v_DoSolve () override
 
void Default_v_DoSolve ()
 
void v_SetInitialConditions (NekDouble initialtime, bool dumpInitialConditions, const int domain) override
 
void Default_v_SetInitialConditions (NekDouble initialtime, bool dumpInitialConditions, const int domain)
 
Array< OneD, NekDoublev_EvaluateExactSolution (unsigned int field, const NekDouble time)
 
Array< OneD, NekDoubleDefault_v_EvaluateExactSolution (unsigned int field, const NekDouble time)
 
NekDouble v_LinfError (unsigned int field)
 
NekDouble Default_v_LinfError (unsigned int field)
 
NekDouble v_L2Error (unsigned int field)
 
NekDouble Default_v_L2Error (unsigned int field)
 

Detailed Description

template<class T>
struct EquationSystemWrap< T >

EquationSystem wrapper to handle virtual function calls in EquationSystem and its subclasses.

Definition at line 48 of file Python/EquationSystem.h.

Constructor & Destructor Documentation

◆ EquationSystemWrap()

Constructor, which is identical to Filter.

Parameters
fieldInput field.

Definition at line 55 of file Python/EquationSystem.h.

57 : T(session, graph), py::wrapper<T>()
58 {
59 }

Member Function Documentation

◆ Default_v_DoInitialise()

template<class T >
void EquationSystemWrap< T >::Default_v_DoInitialise ( bool  dumpInitialConditions)
inline

Definition at line 90 of file Python/EquationSystem.h.

91 {
92 this->T::v_DoInitialise(dumpInitialConditions);
93 }

◆ Default_v_DoSolve()

template<class T >
void EquationSystemWrap< T >::Default_v_DoSolve ( )
inline

Definition at line 107 of file Python/EquationSystem.h.

108 {
109 this->T::v_DoSolve();
110 }

◆ Default_v_EvaluateExactSolution()

template<class T >
Array< OneD, NekDouble > EquationSystemWrap< T >::Default_v_EvaluateExactSolution ( unsigned int  field,
const NekDouble  time 
)
inline

Definition at line 154 of file Python/EquationSystem.h.

156 {
157 Array<OneD, NekDouble> outfield(this->m_fields[field]->GetNpoints());
158 this->T::v_EvaluateExactSolution(field, outfield, time);
159 return outfield;
160 }

References FilterPython_Function::field.

◆ Default_v_InitObject()

template<class T >
void EquationSystemWrap< T >::Default_v_InitObject ( bool  declareField)
inline

Definition at line 73 of file Python/EquationSystem.h.

74 {
75 return this->T::v_InitObject(declareField);
76 }

◆ Default_v_L2Error()

template<class T >
NekDouble EquationSystemWrap< T >::Default_v_L2Error ( unsigned int  field)
inline

Definition at line 187 of file Python/EquationSystem.h.

188 {
189 return this->T::v_L2Error(field);
190 }

References FilterPython_Function::field.

◆ Default_v_LinfError()

template<class T >
NekDouble EquationSystemWrap< T >::Default_v_LinfError ( unsigned int  field)
inline

Definition at line 172 of file Python/EquationSystem.h.

173 {
174 return this->T::v_LinfError(field);
175 }

References FilterPython_Function::field.

◆ Default_v_SetInitialConditions()

template<class T >
void EquationSystemWrap< T >::Default_v_SetInitialConditions ( NekDouble  initialtime,
bool  dumpInitialConditions,
const int  domain 
)
inline

Definition at line 127 of file Python/EquationSystem.h.

130 {
131 this->T::v_SetInitialConditions(initialtime, dumpInitialConditions,
132 domain);
133 }

◆ v_DoInitialise()

template<class T >
void EquationSystemWrap< T >::v_DoInitialise ( bool  dumpInitialConditions)
inlineoverride

Definition at line 78 of file Python/EquationSystem.h.

79 {
80 if (py::override f = this->get_override("DoInitialise"))
81 {
82 f(dumpInitialConditions);
83 }
84 else
85 {
86 T::v_DoInitialise(dumpInitialConditions);
87 }
88 }

◆ v_DoSolve()

template<class T >
void EquationSystemWrap< T >::v_DoSolve ( void  )
inlineoverride

Definition at line 95 of file Python/EquationSystem.h.

96 {
97 if (py::override f = this->get_override("DoSolve"))
98 {
99 f();
100 }
101 else
102 {
103 T::v_DoSolve();
104 }
105 }

◆ v_EvaluateExactSolution()

template<class T >
Array< OneD, NekDouble > EquationSystemWrap< T >::v_EvaluateExactSolution ( unsigned int  field,
const NekDouble  time 
)
inline

Definition at line 135 of file Python/EquationSystem.h.

137 {
138 if (py::override f = this->get_override("EvaluateExactSolution"))
139 {
140 py::object tmpPy = f(field, time);
142 py::extract<Array<OneD, NekDouble>>(tmpPy);
143 return tmp;
144 }
145 else
146 {
147 Array<OneD, NekDouble> outfield(
148 this->m_fields[field]->GetNpoints());
149 T::v_EvaluateExactSolution(field, outfield, time);
150 return outfield;
151 }
152 }

References FilterPython_Function::field.

◆ v_InitObject()

template<class T >
void EquationSystemWrap< T >::v_InitObject ( bool  declareField)
inlineoverride

Definition at line 61 of file Python/EquationSystem.h.

62 {
63 if (py::override f = this->get_override("InitObject")(declareField))
64 {
65 f();
66 }
67 else
68 {
69 T::v_InitObject();
70 }
71 }

◆ v_L2Error()

template<class T >
NekDouble EquationSystemWrap< T >::v_L2Error ( unsigned int  field)
inline

Definition at line 177 of file Python/EquationSystem.h.

178 {
179 if (py::override f = this->get_override("L2Error"))
180 {
181 return f(field);
182 }
183
184 return T::v_L2Error(field);
185 }

References FilterPython_Function::field.

◆ v_LinfError()

template<class T >
NekDouble EquationSystemWrap< T >::v_LinfError ( unsigned int  field)
inline

Definition at line 162 of file Python/EquationSystem.h.

163 {
164 if (py::override f = this->get_override("LinfError"))
165 {
166 return f(field);
167 }
168
169 return T::v_LinfError(field);
170 }

References FilterPython_Function::field.

◆ v_SetInitialConditions()

template<class T >
void EquationSystemWrap< T >::v_SetInitialConditions ( NekDouble  initialtime,
bool  dumpInitialConditions,
const int  domain 
)
inlineoverride

Definition at line 112 of file Python/EquationSystem.h.

115 {
116 if (py::override f = this->get_override("SetInitialConditions"))
117 {
118 f(initialtime, dumpInitialConditions, domain);
119 }
120 else
121 {
122 T::v_SetInitialConditions(initialtime, dumpInitialConditions,
123 domain);
124 }
125 }