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

Go to the source code of this file.

Functions

void export_StdExpansion ()
 
void export_StdMatrixKey ()
 Export for StdMatrixKey enumeration. More...
 
void export_StdElements ()
 
void export_VarCoeffEntry ()
 
 BOOST_PYTHON_MODULE (_StdRegions)
 

Function Documentation

◆ BOOST_PYTHON_MODULE()

BOOST_PYTHON_MODULE ( _StdRegions  )

Definition at line 42 of file StdRegions.cpp.

43{
44 np::initialize();
45
50}
void export_VarCoeffEntry()
void export_StdMatrixKey()
Export for StdMatrixKey enumeration.
void export_StdElements()
Definition: StdElements.cpp:49
void export_StdExpansion()

References export_StdElements(), export_StdExpansion(), export_StdMatrixKey(), and export_VarCoeffEntry().

◆ export_StdElements()

void export_StdElements ( )

Definition at line 49 of file StdElements.cpp.

50{
51 py::class_<StdPointExp, py::bases<StdExpansion>,
52 std::shared_ptr<StdPointExp>>(
53 "StdPointExp", py::init<const LibUtilities::BasisKey &>());
54 py::class_<StdSegExp, py::bases<StdExpansion>, std::shared_ptr<StdSegExp>>(
55 "StdSegExp", py::init<const LibUtilities::BasisKey &>());
56 py::class_<StdQuadExp, py::bases<StdExpansion>,
57 std::shared_ptr<StdQuadExp>>(
58 "StdQuadExp", py::init<const LibUtilities::BasisKey &,
59 const LibUtilities::BasisKey &>());
60 py::class_<StdTriExp, py::bases<StdExpansion>, std::shared_ptr<StdTriExp>>(
61 "StdTriExp", py::init<const LibUtilities::BasisKey &,
62 const LibUtilities::BasisKey &>());
63 py::class_<StdTetExp, py::bases<StdExpansion>, std::shared_ptr<StdTetExp>>(
64 "StdTetExp",
65 py::init<const LibUtilities::BasisKey &, const LibUtilities::BasisKey &,
66 const LibUtilities::BasisKey &>());
67 py::class_<StdPrismExp, py::bases<StdExpansion>,
68 std::shared_ptr<StdPrismExp>>(
69 "StdPrismExp",
70 py::init<const LibUtilities::BasisKey &, const LibUtilities::BasisKey &,
71 const LibUtilities::BasisKey &>());
72 py::class_<StdPyrExp, py::bases<StdExpansion>, std::shared_ptr<StdPyrExp>>(
73 "StdPyrExp",
74 py::init<const LibUtilities::BasisKey &, const LibUtilities::BasisKey &,
75 const LibUtilities::BasisKey &>());
76 py::class_<StdHexExp, py::bases<StdExpansion>, std::shared_ptr<StdHexExp>>(
77 "StdHexExp",
78 py::init<const LibUtilities::BasisKey &, const LibUtilities::BasisKey &,
79 const LibUtilities::BasisKey &>());
80}
Describes the specification for a Basis.
Definition: Basis.h:45

Referenced by BOOST_PYTHON_MODULE().

◆ export_StdExpansion()

void export_StdExpansion ( )

Definition at line 146 of file Python/StdExpansion.cpp.

147{
148 py::class_<StdExpansion, std::shared_ptr<StdExpansion>, boost::noncopyable>(
149 "StdExpansion", py::no_init)
150
151 .def("GetNcoeffs", &StdExpansion::GetNcoeffs)
152 .def("GetTotPoints", &StdExpansion::GetTotPoints)
153 .def("GetBasisType", &StdExpansion::GetBasisType)
154 .def("GetPointsType", &StdExpansion::GetPointsType)
155 .def("GetNverts", &StdExpansion::GetNverts)
156 .def("GetNtraces", &StdExpansion::GetNtraces)
157 .def("DetShapeType", &StdExpansion::DetShapeType)
158 .def("GetShapeDimension", &StdExpansion::GetShapeDimension)
159 .def("Integral", &StdExpansion::Integral)
160
161 .def("GetBasis", &StdExpansion::GetBasis,
162 py::return_value_policy<py::copy_const_reference>())
163
164 .def("GenMatrix", &StdExpansion::GenMatrix)
165 .def("GetStdMatrix", &StdExpansion::GetStdMatrix)
166
167 .def("FwdTrans", &StdExpansion_FwdTrans)
168 .def("BwdTrans", &StdExpansion_BwdTrans)
169 .def("IProductWRTBase", &StdExpansion_IProductWRTBase)
170
171 .def("PhysEvaluate", &StdExpansion_PhysEvaluate)
172 .def("L2", &StdExpansion_L2)
173 .def("L2", &StdExpansion_L2_Error)
174
175 .def("GetCoords", &StdExpansion_GetCoords)
176
177 .def("PhysDeriv", &StdExpansion_PhysDeriv);
178}
NekDouble StdExpansion_L2_Error(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in, const Array< OneD, const NekDouble > &err)
py::tuple StdExpansion_PhysDeriv(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &inarray)
Array< OneD, NekDouble > StdExpansion_FwdTrans(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in)
NekDouble StdExpansion_L2(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in)
py::tuple StdExpansion_GetCoords(StdExpansionSharedPtr exp)
Array< OneD, NekDouble > StdExpansion_BwdTrans(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in)
NekDouble StdExpansion_PhysEvaluate(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &coords, const Array< OneD, const NekDouble > &physvals)
Array< OneD, NekDouble > StdExpansion_IProductWRTBase(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in)

References StdExpansion_BwdTrans(), StdExpansion_FwdTrans(), StdExpansion_GetCoords(), StdExpansion_IProductWRTBase(), StdExpansion_L2(), StdExpansion_L2_Error(), StdExpansion_PhysDeriv(), and StdExpansion_PhysEvaluate().

Referenced by BOOST_PYTHON_MODULE().

◆ export_StdMatrixKey()

void export_StdMatrixKey ( )

Export for StdMatrixKey enumeration.

Definition at line 70 of file Python/StdMatrixKey.cpp.

71{
75
76 // Wrapper for constant factor map.
77 py::class_<ConstFactorMap>("ConstFactorMap")
78 .def(py::map_indexing_suite<ConstFactorMap>());
79
80 // Wrapper for variable coefficients map.
81 py::class_<VarCoeffMap>("VarCoeffMap")
82 .def(py::map_indexing_suite<VarCoeffMap, true>());
83
84 py::class_<StdMatrixKey>("StdMatrixKey", py::no_init)
85 .def("__init__",
86 py::make_constructor(
87 &StdMatrixKey_Init, py::default_call_policies(),
88 (py::arg("matType"), py::arg("shapeType"), py::arg("exp"),
89 py::arg("constFactorMap") = py::object(),
90 py::arg("varCoeffMap") = py::object())))
91
92 .def("GetMatrixType", &StdMatrixKey::GetMatrixType)
93 .def("GetShapeType", &StdMatrixKey::GetShapeType)
94 .def("GetNcoeffs", &StdMatrixKey::GetNcoeffs)
95 .def("GetBasis", &StdMatrixKey::GetBasis);
96}
#define NEKPY_WRAP_ENUM(ENUMNAME, MAPNAME)
Definition: NekPyConfig.hpp:69
StdMatrixKey * StdMatrixKey_Init(const MatrixType matType, const LibUtilities::ShapeType shapeType, const StdExpansionSharedPtr exp, const py::object &constFactorMap, const py::object &varCoeffMap)
const char *const VarCoeffTypeMap[]
Definition: StdRegions.hpp:234
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:385
const char *const MatrixTypeMap[]
Definition: StdRegions.hpp:139

References Nektar::StdRegions::ConstFactorTypeMap, Nektar::StdRegions::MatrixTypeMap, NEKPY_WRAP_ENUM, StdMatrixKey_Init(), and Nektar::StdRegions::VarCoeffTypeMap.

Referenced by BOOST_PYTHON_MODULE().

◆ export_VarCoeffEntry()

void export_VarCoeffEntry ( )

Definition at line 156 of file VarCoeffEntry.cpp.

157{
158 py::to_python_converter<VarCoeffEntry, VarCoeffEntryToPython>();
160}

Referenced by BOOST_PYTHON_MODULE().