82 EquationSystem::v_InitObject(DeclareField);
84 for (
int i = 0; i <
m_fields.size(); ++i)
91 for (
int j = 0; j < nq; ++j)
93 m_fields[i]->UpdatePhys()[j] = sin(x[j]) * sin(y[j]);
118 return eqSys->UpdateFields();
123 eqSys->PrintSummary(std::cout);
129 return eqSys->GetFunction(
name);
141 eqSys->WriteFld(
name);
146 eqSys->Checkpoint_Output(n);
156 py::class_<EqSysWrap, std::shared_ptr<EqSysWrap>, boost::noncopyable>(
161 .def(
"InitObject", &EquationSystem::InitObject,
162 &EqSysWrap::Default_v_InitObject)
163 .def(
"DoInitialise", &EquationSystem::DoInitialise,
164 &EqSysWrap::Default_v_DoInitialise)
165 .def(
"DoSolve", &EquationSystem::DoSolve, &EqSysWrap::Default_v_DoSolve)
166 .def(
"SetInitialConditions", &EquationSystem::SetInitialConditions,
167 &EqSysWrap::Default_v_SetInitialConditions)
168 .def(
"EvaluateExactSolution", &EqSysWrap::v_EvaluateExactSolution,
169 &EqSysWrap::Default_v_EvaluateExactSolution)
170 .def(
"LinfError", &EqSysWrap::v_LinfError,
171 &EqSysWrap::Default_v_LinfError)
172 .def(
"L2Error", &EqSysWrap::v_L2Error, &EqSysWrap::Default_v_L2Error)
179 .def(
"GetNvariables", &EquationSystem::GetNvariables)
180 .def(
"GetVariable", &EquationSystem::GetVariable)
181 .def(
"GetNpoints", &EquationSystem::GetNpoints)
182 .def(
"SetInitialStep", &EquationSystem::SetInitialStep)
183 .def(
"ZeroPhysFields", &EquationSystem::ZeroPhysFields)
186 .def(
"GetTime", &EquationSystem::GetTime)
187 .def(
"SetTime", &EquationSystem::SetTime)
188 .add_property(
"time", &EquationSystem::GetTime,
189 &EquationSystem::SetTime)
192 .def(
"GetTimeStep", &EquationSystem::GetTimeStep)
193 .def(
"SetTimeStep", &EquationSystem::SetTimeStep)
194 .add_property(
"timestep", &EquationSystem::GetTimeStep,
195 &EquationSystem::SetTimeStep)
198 .def(
"GetSteps", &EquationSystem::GetSteps)
199 .def(
"SetSteps", &EquationSystem::SetSteps)
200 .add_property(
"steps", &EquationSystem::GetSteps,
201 &EquationSystem::SetSteps)
216 .staticmethod(
"Create")
217 .def(
"Register", [](std::string
const &filterName,
218 py::object &obj) { fac(filterName, obj); })
219 .staticmethod(
"Register");
void EquationSystem_Checkpoint_Output(EquationSystemSharedPtr eqSys, int n)
std::shared_ptr< SessionFunction > EquationSystem_GetFunction1(EquationSystemSharedPtr eqSys, std::string name)
void EquationSystem_WriteFld(EquationSystemSharedPtr eqSys, std::string name)
EquationSystemSharedPtr EquationSystem_Create(std::string eqnSysName, LibUtilities::SessionReaderSharedPtr session, SpatialDomains::MeshGraphSharedPtr mesh)
Array< OneD, MultiRegions::ExpListSharedPtr > EquationSystem_GetFields(EquationSystemSharedPtr eqSys)
void export_EquationSystem()
void EquationSystem_PrintSummary(EquationSystemSharedPtr eqSys)
std::shared_ptr< SessionFunction > EquationSystem_GetFunction2(EquationSystemSharedPtr eqSys, std::string name, MultiRegions::ExpListSharedPtr field)
Dummy equation system that can be used for Python testing.
void v_InitObject(bool DeclareField) override
Initialisation object for EquationSystem.
DummyEquationSystem(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
static std::string className
Name of class.
static SolverUtils::EquationSystemSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession, const SpatialDomains::MeshGraphSharedPtr &pGraph)
Creates an instance of this class.
~DummyEquationSystem() override
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
A base class for describing how to solve specific equations.
Array< OneD, MultiRegions::ExpListSharedPtr > m_fields
Array holding all dependent variables.
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< EquationSystem > EquationSystemSharedPtr
A shared pointer to an EquationSystem object.
EquationSystemFactory & GetEquationSystemFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::vector< double > z(NPUPPER)
EquationSystem wrapper to handle virtual function calls in EquationSystem and its subclasses.
A helper class that for factory-based classes allows std::shared_ptr<T> as something that boost::pyth...