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

Go to the source code of this file.

Functions

void export_StdExpansion (py::module &m)
 
void export_StdMatrixKey (py::module &m)
 Export for StdMatrixKey enumeration.
 
void export_StdElements (py::module &m)
 
 PYBIND11_MODULE (_StdRegions, m)
 

Function Documentation

◆ export_StdElements()

void export_StdElements ( py::module &  m)

Definition at line 51 of file StdElements.cpp.

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

Referenced by PYBIND11_MODULE().

◆ export_StdExpansion()

void export_StdExpansion ( py::module &  m)

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

171{
172 py::class_<StdExpansion, std::shared_ptr<StdExpansion>>(m, "StdExpansion")
173
174 .def("GetNcoeffs", &StdExpansion::GetNcoeffs)
175 .def("GetTotPoints", &StdExpansion::GetTotPoints)
176 .def("GetBasisType", &StdExpansion::GetBasisType)
177 .def("GetPointsType", &StdExpansion::GetPointsType)
178 .def("GetNverts", &StdExpansion::GetNverts)
179 .def("GetNtraces", &StdExpansion::GetNtraces)
180 .def("DetShapeType", &StdExpansion::DetShapeType)
181 .def("GetShapeDimension", &StdExpansion::GetShapeDimension)
182 .def("Integral", &StdExpansion::Integral)
183
184 .def("GetBasis", &StdExpansion::GetBasis)
185
186 .def("GenMatrix", &StdExpansion_GenMatrix)
187 .def("GetStdMatrix", &StdExpansion_GetStdMatrix)
188
189 .def("FwdTrans", &StdExpansion_FwdTrans)
190 .def("BwdTrans", &StdExpansion_BwdTrans)
191 .def("IProductWRTBase", &StdExpansion_IProductWRTBase)
192
193 .def("PhysEvaluate", &StdExpansion_PhysEvaluate)
194 .def("L2", &StdExpansion_L2)
195 .def("L2", &StdExpansion_L2_Error)
196
197 .def("GetCoords", &StdExpansion_GetCoords)
198
199 .def("PhysDeriv", &StdExpansion_PhysDeriv);
200}
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)
py::array StdExpansion_GetStdMatrix(std::shared_ptr< StdExpansion > &stdExp, const StdMatrixKey &mkey)
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)
py::array StdExpansion_GenMatrix(std::shared_ptr< StdExpansion > &stdExp, const StdMatrixKey &mkey)
Array< OneD, NekDouble > StdExpansion_IProductWRTBase(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in)
const LibUtilities::BasisSharedPtr & GetBasis(int dir) const
This function gets the shared point to basis in the dir direction.
int GetNcoeffs(void) const
This function returns the total number of coefficients used in the expansion.
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
LibUtilities::BasisType GetBasisType(const int dir) const
This function returns the type of basis used in the dir direction.
int GetNtraces() const
Returns the number of trace elements connected to this element.
int GetNverts() const
This function returns the number of vertices of the expansion domain.
LibUtilities::ShapeType DetShapeType() const
This function returns the shape of the expansion domain.
LibUtilities::PointsType GetPointsType(const int dir) const
This function returns the type of quadrature points used in the dir direction.
NekDouble Integral(const Array< OneD, const NekDouble > &inarray)
This function integrates the specified function over the domain.

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::StdExpansion::GetBasis(), Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetNtraces(), Nektar::StdRegions::StdExpansion::GetNverts(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::GetShapeDimension(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdExpansion::Integral(), StdExpansion_BwdTrans(), StdExpansion_FwdTrans(), StdExpansion_GenMatrix(), StdExpansion_GetCoords(), StdExpansion_GetStdMatrix(), StdExpansion_IProductWRTBase(), StdExpansion_L2(), StdExpansion_L2_Error(), StdExpansion_PhysDeriv(), and StdExpansion_PhysEvaluate().

Referenced by PYBIND11_MODULE().

◆ export_StdMatrixKey()

void export_StdMatrixKey ( py::module &  m)

Export for StdMatrixKey enumeration.

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

62{
66
67 // Wrapper for constant factor map.
68 py::bind_map<ConstFactorMap>(m, "ConstFactorMap");
69
70 // Wrapper for variable coefficients map.
71 py::bind_map<VarCoeffMap>(m, "VarCoeffMap");
72
73 py::class_<StdMatrixKey>(m, "StdMatrixKey")
74 .def(py::init(&StdMatrixKey_Init), py::arg("matType"),
75 py::arg("shapeType"), py::arg("exp"),
76 py::arg("constFactorMap") = NullConstFactorMap,
77 py::arg("varCoeffMap") = NullVarCoeffMap)
78
79 .def("GetMatrixType", &StdMatrixKey::GetMatrixType)
80 .def("GetShapeType", &StdMatrixKey::GetShapeType)
81 .def("GetNcoeffs", &StdMatrixKey::GetNcoeffs)
82 .def("GetBasis", &StdMatrixKey::GetBasis);
83}
#define NEKPY_WRAP_ENUM(MOD, ENUMNAME, MAPNAME)
std::unique_ptr< StdMatrixKey > StdMatrixKey_Init(const MatrixType matType, const LibUtilities::ShapeType shapeType, const StdExpansionSharedPtr exp, const ConstFactorMap &constFactorMap, const VarCoeffMap &varCoeffMap)
LibUtilities::ShapeType GetShapeType() const
MatrixType GetMatrixType() const
const LibUtilities::BasisSharedPtr GetBasis(int dir) const
const char *const VarCoeffTypeMap[]
const char *const ConstFactorTypeMap[]
const char *const MatrixTypeMap[]
static ConstFactorMap NullConstFactorMap
static VarCoeffMap NullVarCoeffMap

References Nektar::StdRegions::ConstFactorTypeMap, Nektar::StdRegions::StdMatrixKey::GetBasis(), Nektar::StdRegions::StdMatrixKey::GetMatrixType(), Nektar::StdRegions::StdMatrixKey::GetNcoeffs(), Nektar::StdRegions::StdMatrixKey::GetShapeType(), Nektar::StdRegions::MatrixTypeMap, NEKPY_WRAP_ENUM, Nektar::StdRegions::NullConstFactorMap, Nektar::StdRegions::NullVarCoeffMap, StdMatrixKey_Init(), and Nektar::StdRegions::VarCoeffTypeMap.

Referenced by PYBIND11_MODULE().

◆ PYBIND11_MODULE()

PYBIND11_MODULE ( _StdRegions  ,
 
)

Definition at line 41 of file StdRegions.cpp.

42{
46}
void export_StdExpansion(py::module &m)
void export_StdMatrixKey(py::module &m)
Export for StdMatrixKey enumeration.
void export_StdElements(py::module &m)

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