Nektar++
Functions
MultiRegions.cpp File Reference
#include <LibUtilities/Python/NekPyConfig.hpp>

Go to the source code of this file.

Functions

void export_ExpList ()
 
void export_ExpList2D ()
 
void export_DisContField ()
 
void export_ContField ()
 
 BOOST_PYTHON_MODULE (_MultiRegions)
 

Function Documentation

◆ BOOST_PYTHON_MODULE()

BOOST_PYTHON_MODULE ( _MultiRegions  )

Definition at line 42 of file MultiRegions.cpp.

References export_ContField(), export_DisContField(), export_ExpList(), and export_ExpList2D().

43 {
44  np::initialize();
45 
50 }
void export_ExpList()
void export_ContField()
Definition: ContField.cpp:70
void export_DisContField()
void export_ExpList2D()

◆ export_ContField()

void export_ContField ( )

Definition at line 70 of file ContField.cpp.

References CreateContField1D(), CreateContField2D(), CreateContField3D(), and NEKPY_SHPTR_FIX.

Referenced by BOOST_PYTHON_MODULE().

71 {
72  py::class_<ContField1D, py::bases<ExpList1D>, std::shared_ptr<ContField1D>>(
73  "ContField1D", py::no_init)
74  .def("__init__", py::make_constructor(
76  py::default_call_policies(),
77  (py::arg("session"), py::arg("graph"), py::arg("var"))));
78 
82 
83  py::class_<ContField2D, py::bases<ExpList2D>, std::shared_ptr<ContField2D>>(
84  "ContField2D", py::no_init)
85  .def("__init__", py::make_constructor(
87  py::default_call_policies(),
88  (py::arg("session"), py::arg("graph"), py::arg("var"),
89  py::arg("checkSingular") = true)));
90 
94 
95  py::class_<ContField3D, py::bases<ExpList3D>, std::shared_ptr<ContField3D>>(
96  "ContField3D", py::no_init)
97  .def("__init__", py::make_constructor(
99  py::default_call_policies(),
100  (py::arg("session"), py::arg("graph"), py::arg("var"),
101  py::arg("checkSingular") = true)));
102 
106 }
std::shared_ptr< ContField1D > CreateContField1D(const LibUtilities::SessionReaderSharedPtr &session, const SpatialDomains::MeshGraphSharedPtr &graph, const std::string &var)
Definition: ContField.cpp:43
std::shared_ptr< ContField3D > CreateContField3D(const LibUtilities::SessionReaderSharedPtr &session, const SpatialDomains::MeshGraphSharedPtr &graph, const std::string &var, const bool checkSingular)
Definition: ContField.cpp:61
std::shared_ptr< ContField2D > CreateContField2D(const LibUtilities::SessionReaderSharedPtr &session, const SpatialDomains::MeshGraphSharedPtr &graph, const std::string &var, const bool checkSingular)
Definition: ContField.cpp:51
#define NEKPY_SHPTR_FIX(SOURCE, TARGET)
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:103
This class is the abstraction of a global continuous two- dimensional spectral/hp element expansion w...
Definition: ContField2D.h:55
Abstraction of a global continuous one-dimensional spectral/hp element expansion which approximates t...
Definition: ContField1D.h:55
This class is the abstraction of a global discontinuous two- dimensional spectral/hp element expansio...
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
Definition: ExpList1D.h:58
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Definition: ExpList2D.h:57
Abstraction of a three-dimensional multi-elemental expansion which is merely a collection of local ex...
Definition: ExpList3D.h:48

◆ export_DisContField()

void export_DisContField ( )

Definition at line 67 of file DisContField.cpp.

Referenced by BOOST_PYTHON_MODULE().

68 {
69  export_DisContField_Helper<DisContField1D, ExpList1D>("DisContField1D");
70  export_DisContField_Helper<DisContField2D, ExpList2D>("DisContField2D");
71  export_DisContField_Helper<DisContField3D, ExpList3D>("DisContField3D");
72 }

◆ export_ExpList()

void export_ExpList ( )

Definition at line 230 of file Python/ExpList.cpp.

References ExpList_BwdTrans(), ExpList_FwdTrans(), ExpList_GetCoords(), ExpList_GetExp(), ExpList_GetPhys(), ExpList_GetPhysAddress(), ExpList_HelmSolve(), ExpList_IProductWRTBase(), ExpList_L2(), ExpList_L2_Error(), ExpList_Linf(), ExpList_Linf_Error(), ExpList_MultiplyByInvMassMatrix(), ExpList_PhysIntegral(), ExpList_ResetManagers(), ExpList_SetPhys(), ExpList_SetPhysArray(), ExpList_WriteVTK(), Nektar::MultiRegions::ExpList::GetCoeff_Offset(), Nektar::MultiRegions::ExpList::GetExpSize(), Nektar::MultiRegions::ExpList::GetNcoeffs(), Nektar::MultiRegions::ExpList::GetNpoints(), Nektar::MultiRegions::ExpList::GetPhys_Offset(), Nektar::MultiRegions::ExpList::GetPhysState(), Nektar::MultiRegions::ExpList::PhysEvaluate(), and Nektar::MultiRegions::ExpList::SetPhysState().

Referenced by BOOST_PYTHON_MODULE().

231 {
232  int (ExpList::*GetNcoeffs)() const = &ExpList::GetNcoeffs;
233 
234  py::class_<ExpList,
235  std::shared_ptr<ExpList>,
236  boost::noncopyable>(
237  "ExpList", py::no_init)
238 
239  // Expansions
240  .def("GetExp", ExpList_GetExp)
241  .def("GetExpSize", &ExpList::GetExpSize)
242 
243  // Query points and offset information
244  .def("GetNpoints", &ExpList::GetNpoints)
245  .def("GetNcoeffs", GetNcoeffs)
246  .def("GetCoords", &ExpList_GetCoords)
247  .def("GetPhys_Offset", &ExpList::GetPhys_Offset)
248  .def("GetCoeff_Offset", &ExpList::GetCoeff_Offset)
249 
250  // Evaluations
251  .def("PhysEvaluate", &ExpList::PhysEvaluate)
252 
253  // Operators
254  .def("FwdTrans", &ExpList_FwdTrans)
255  .def("BwdTrans", &ExpList_BwdTrans)
256  .def("IProductWRTBase", &ExpList_IProductWRTBase)
257  .def("MultiplyByInvMassMatrix", &ExpList_MultiplyByInvMassMatrix)
258  .def("HelmSolve", &ExpList_HelmSolve, (
259  py::arg("in"),
260  py::arg("constFactorMap") = py::object(),
261  py::arg("varCoeffMap") = py::object()
262  ))
263 
264  // Error norms
265  .def("L2", &ExpList_L2)
266  .def("L2", &ExpList_L2_Error)
267  .def("Linf", &ExpList_Linf)
268  .def("Linf", &ExpList_Linf_Error)
269 
270  // Storage setups
271  .def("SetPhysArray", &ExpList_SetPhysArray)
272  .def("SetPhys", &ExpList_SetPhys)
273  .def("GetPhys", &ExpList_GetPhys)
274  .def("SetPhysState", &ExpList::SetPhysState)
275  .def("GetPhysState", &ExpList::GetPhysState)
276  .def("PhysIntegral", &ExpList_PhysIntegral)
277  .def("GetPhysAddress", &ExpList_GetPhysAddress)
278 
279  // Misc functions
280  .def("WriteVTK", &ExpList_WriteVTK)
281  .def("ResetManagers", &ExpList_ResetManagers)
282  ;
283 }
Array< OneD, NekDouble > ExpList_MultiplyByInvMassMatrix(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
Array< OneD, NekDouble > ExpList_FwdTrans(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
Array< OneD, NekDouble > ExpList_HelmSolve(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in, const py::object constFactorMap, const py::object varCoeffMap)
NekDouble ExpList_L2(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
NekDouble ExpList_Linf_Error(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in, const Array< OneD, const NekDouble > &err)
ExpansionSharedPtr ExpList_GetExp(ExpListSharedPtr exp, int i)
void ExpList_ResetManagers(ExpListSharedPtr exp)
std::string ExpList_GetPhysAddress(ExpListSharedPtr exp)
void ExpList_SetPhys(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &inarray)
NekDouble ExpList_L2_Error(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in, const Array< OneD, const NekDouble > &err)
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:103
NekDouble ExpList_PhysIntegral(ExpListSharedPtr exp)
const Array< OneD, const NekDouble > ExpList_GetPhys(ExpListSharedPtr exp)
py::tuple ExpList_GetCoords(ExpListSharedPtr exp)
Array< OneD, NekDouble > ExpList_IProductWRTBase(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
Array< OneD, NekDouble > ExpList_BwdTrans(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)
void ExpList_WriteVTK(ExpListSharedPtr exp, std::string filename)
void ExpList_SetPhysArray(ExpListSharedPtr exp, Array< OneD, NekDouble > inarray)
NekDouble ExpList_Linf(ExpListSharedPtr exp, const Array< OneD, const NekDouble > &in)

◆ export_ExpList2D()

void export_ExpList2D ( )

Definition at line 43 of file Python/ExpList2D.cpp.

References NEKPY_SHPTR_FIX.

Referenced by BOOST_PYTHON_MODULE().

44 {
45  py::class_<ExpList1D, py::bases<ExpList>,
46  std::shared_ptr<ExpList1D> >(
47  "ExpList1D", py::init<
50  py::class_<ExpList2D, py::bases<ExpList>,
51  std::shared_ptr<ExpList2D> >(
52  "ExpList2D", py::init<
55  py::class_<ExpList3D, py::bases<ExpList>,
56  std::shared_ptr<ExpList3D> >(
57  "ExpList3D", py::init<
60 
64 }
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:163
#define NEKPY_SHPTR_FIX(SOURCE, TARGET)
Base class for all multi-elemental spectral/hp expansions.
Definition: ExpList.h:103
This class is the abstraction of a one-dimensional multi-elemental expansions which is merely a colle...
Definition: ExpList1D.h:58
Abstraction of a two-dimensional multi-elemental expansion which is merely a collection of local expa...
Definition: ExpList2D.h:57
Abstraction of a three-dimensional multi-elemental expansion which is merely a collection of local ex...
Definition: ExpList3D.h:48
std::shared_ptr< SessionReader > SessionReaderSharedPtr