Nektar++
Classes | Functions
TimeIntegrationSchemeOperators.cpp File Reference
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <LibUtilities/TimeIntegration/TimeIntegrationSchemeOperators.h>

Go to the source code of this file.

Classes

struct  CallbackHolderT1
 Helper class for holding a reference to a Python function to act as a wrapper for TimeIntegrationScheme::FunctorType1. More...
 
struct  CallbackHolderT2
 Helper class for holding a reference to a Python function to act as a wrapper for TimeIntegrationScheme::FunctorType1. More...
 

Functions

py::list ArrayOneDToPyList (const Array< OneD, const Array< OneD, NekDouble > > &in)
 
void TimeIntegrationSchemeOperators_DefineOdeRhs (TimeIntegrationSchemeOperatorsSharedPtr op, py::object callback)
 
void TimeIntegrationSchemeOperators_DefineProjection (TimeIntegrationSchemeOperatorsSharedPtr op, py::object callback)
 
void TimeIntegrationSchemeOperators_DefineImplicitSolve (TimeIntegrationSchemeOperatorsSharedPtr op, py::object callback)
 
void export_TimeIntegrationSchemeOperators ()
 

Function Documentation

◆ ArrayOneDToPyList()

py::list ArrayOneDToPyList ( const Array< OneD, const Array< OneD, NekDouble > > &  in)
inline

Definition at line 43 of file TimeIntegrationSchemeOperators.cpp.

45{
46 py::list ret;
47
48 for (int i = 0; i < in.size(); ++i)
49 {
50 ret.append(py::object(in[i]));
51 }
52
53 return ret;
54}

◆ export_TimeIntegrationSchemeOperators()

void export_TimeIntegrationSchemeOperators ( )

Definition at line 151 of file TimeIntegrationSchemeOperators.cpp.

152{
154 std::shared_ptr<TimeIntegrationSchemeOperators>,
155 boost::noncopyable>("TimeIntegrationSchemeOperators",
156 py::init<>())
158 .def("DefineProjection",
160 .def("DefineImplicitSolve",
162}
void TimeIntegrationSchemeOperators_DefineOdeRhs(TimeIntegrationSchemeOperatorsSharedPtr op, py::object callback)
void TimeIntegrationSchemeOperators_DefineImplicitSolve(TimeIntegrationSchemeOperatorsSharedPtr op, py::object callback)
void TimeIntegrationSchemeOperators_DefineProjection(TimeIntegrationSchemeOperatorsSharedPtr op, py::object callback)
Binds a set of functions for use by time integration schemes.

References TimeIntegrationSchemeOperators_DefineImplicitSolve(), TimeIntegrationSchemeOperators_DefineOdeRhs(), and TimeIntegrationSchemeOperators_DefineProjection().

Referenced by BOOST_PYTHON_MODULE().

◆ TimeIntegrationSchemeOperators_DefineImplicitSolve()

void TimeIntegrationSchemeOperators_DefineImplicitSolve ( TimeIntegrationSchemeOperatorsSharedPtr  op,
py::object  callback 
)

Definition at line 143 of file TimeIntegrationSchemeOperators.cpp.

145{
146 CallbackHolderT2 *cb = new CallbackHolderT2(callback);
147
148 op->DefineImplicitSolve(&CallbackHolderT2::call, cb);
149}
Helper class for holding a reference to a Python function to act as a wrapper for TimeIntegrationSche...
void call(TimeIntegrationSchemeOperators::InArrayType &in, TimeIntegrationSchemeOperators::OutArrayType &out, const NekDouble time, const NekDouble lambda)
C++ callback function to invoke Python function stored in m_cb.

References CallbackHolderT2::call().

Referenced by export_TimeIntegrationSchemeOperators().

◆ TimeIntegrationSchemeOperators_DefineOdeRhs()

void TimeIntegrationSchemeOperators_DefineOdeRhs ( TimeIntegrationSchemeOperatorsSharedPtr  op,
py::object  callback 
)

Definition at line 127 of file TimeIntegrationSchemeOperators.cpp.

129{
130 CallbackHolderT1 *cb = new CallbackHolderT1(callback);
131
132 op->DefineOdeRhs(&CallbackHolderT1::call, cb);
133}
Helper class for holding a reference to a Python function to act as a wrapper for TimeIntegrationSche...
void call(TimeIntegrationSchemeOperators::InArrayType &in, TimeIntegrationSchemeOperators::OutArrayType &out, const NekDouble time)
C++ callback function to invoke Python function stored in m_cb.

References CallbackHolderT1::call().

Referenced by export_TimeIntegrationSchemeOperators().

◆ TimeIntegrationSchemeOperators_DefineProjection()

void TimeIntegrationSchemeOperators_DefineProjection ( TimeIntegrationSchemeOperatorsSharedPtr  op,
py::object  callback 
)

Definition at line 135 of file TimeIntegrationSchemeOperators.cpp.

137{
138 CallbackHolderT1 *cb = new CallbackHolderT1(callback);
139
140 op->DefineProjection(&CallbackHolderT1::call, cb);
141}

References CallbackHolderT1::call().

Referenced by export_TimeIntegrationSchemeOperators().