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 ()
 
 BOOST_PYTHON_MODULE (_StdRegions)
 

Function Documentation

◆ BOOST_PYTHON_MODULE()

BOOST_PYTHON_MODULE ( _StdRegions  )

Definition at line 41 of file StdRegions.cpp.

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

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

◆ export_StdElements()

void export_StdElements ( )

Definition at line 49 of file StdElements.cpp.

References NEKPY_SHPTR_FIX.

Referenced by BOOST_PYTHON_MODULE().

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>,
55  std::shared_ptr<StdSegExp> >(
56  "StdSegExp", py::init<const LibUtilities::BasisKey&>());
57  py::class_<StdQuadExp, py::bases<StdExpansion>,
58  std::shared_ptr<StdQuadExp> >(
59  "StdQuadExp", py::init<const LibUtilities::BasisKey&,
60  const LibUtilities::BasisKey&>());
61  py::class_<StdTriExp, py::bases<StdExpansion>,
62  std::shared_ptr<StdTriExp> >(
63  "StdTriExp", py::init<const LibUtilities::BasisKey&,
64  const LibUtilities::BasisKey&>());
65  py::class_<StdTetExp, py::bases<StdExpansion>,
66  std::shared_ptr<StdTetExp> >(
67  "StdTetExp", py::init<const LibUtilities::BasisKey&,
69  const LibUtilities::BasisKey&>());
70  py::class_<StdPrismExp, py::bases<StdExpansion>,
71  std::shared_ptr<StdPrismExp> >(
72  "StdPrismExp", py::init<const LibUtilities::BasisKey&,
74  const LibUtilities::BasisKey&>());
75  py::class_<StdPyrExp, py::bases<StdExpansion>,
76  std::shared_ptr<StdPyrExp> >(
77  "StdPyrExp", py::init<const LibUtilities::BasisKey&,
79  const LibUtilities::BasisKey&>());
80  py::class_<StdHexExp, py::bases<StdExpansion>,
81  std::shared_ptr<StdHexExp> >(
82  "StdHexExp", py::init<const LibUtilities::BasisKey&,
84  const LibUtilities::BasisKey&>());
85 
93 }
#define NEKPY_SHPTR_FIX(SOURCE, TARGET)
Class representing a segment element in reference space.
Definition: StdSegExp.h:53
The base class for all shapes.
Definition: StdExpansion.h:68
Class representing a hexehedral element in reference space.
Definition: StdHexExp.h:47
Class representing a prismatic element in reference space.
Definition: StdPrismExp.h:48
Describes the specification for a Basis.
Definition: Basis.h:49

◆ export_StdExpansion()

void export_StdExpansion ( )

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

References Nektar::StdRegions::StdExpansion::DetShapeType(), Nektar::StdRegions::StdExpansion::GenMatrix(), Nektar::StdRegions::StdExpansion::GetBasis(), Nektar::StdRegions::StdExpansion::GetBasisType(), Nektar::StdRegions::StdExpansion::GetNcoeffs(), Nektar::StdRegions::StdExpansion::GetNedges(), Nektar::StdRegions::StdExpansion::GetNfaces(), Nektar::StdRegions::StdExpansion::GetNverts(), Nektar::StdRegions::StdExpansion::GetPointsType(), Nektar::StdRegions::StdExpansion::GetShapeDimension(), Nektar::StdRegions::StdExpansion::GetStdMatrix(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::StdRegions::StdExpansion::Integral(), StdExpansion_BwdTrans(), StdExpansion_FwdTrans(), StdExpansion_GetCoords(), StdExpansion_IProductWRTBase(), StdExpansion_L2(), StdExpansion_L2_Error(), StdExpansion_PhysDeriv(), and StdExpansion_PhysEvaluate().

Referenced by BOOST_PYTHON_MODULE().

153 {
154  py::class_<StdExpansion,
155  std::shared_ptr<StdExpansion>,
156  boost::noncopyable>(
157  "StdExpansion", py::no_init)
158 
159  .def("GetNcoeffs", &StdExpansion::GetNcoeffs)
160  .def("GetTotPoints", &StdExpansion::GetTotPoints)
161  .def("GetBasisType", &StdExpansion::GetBasisType)
162  .def("GetPointsType", &StdExpansion::GetPointsType)
163  .def("GetNverts", &StdExpansion::GetNverts)
164  .def("GetNedges", &StdExpansion::GetNedges)
165  .def("GetNfaces", &StdExpansion::GetNfaces)
166  .def("DetShapeType", &StdExpansion::DetShapeType)
167  .def("GetShapeDimension", &StdExpansion::GetShapeDimension)
168  .def("Integral", &StdExpansion::Integral)
169 
170  .def("GetBasis", &StdExpansion::GetBasis,
171  py::return_value_policy<py::copy_const_reference>())
172 
173  .def("GenMatrix", &StdExpansion::GenMatrix)
174  .def("GetStdMatrix", &StdExpansion::GetStdMatrix)
175 
176  .def("FwdTrans", &StdExpansion_FwdTrans)
177  .def("BwdTrans", &StdExpansion_BwdTrans)
178  .def("IProductWRTBase", &StdExpansion_IProductWRTBase)
179 
180  .def("PhysEvaluate", &StdExpansion_PhysEvaluate)
181  .def("L2", &StdExpansion_L2)
182  .def("L2", &StdExpansion_L2_Error)
183 
184  .def("GetCoords", &StdExpansion_GetCoords)
185 
186  .def("PhysDeriv", &StdExpansion_PhysDeriv)
187  ;
188 }
Array< OneD, NekDouble > StdExpansion_FwdTrans(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in)
The base class for all shapes.
Definition: StdExpansion.h:68
NekDouble StdExpansion_L2_Error(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in, const Array< OneD, const NekDouble > &err)
py::tuple StdExpansion_GetCoords(StdExpansionSharedPtr exp)
py::tuple StdExpansion_PhysDeriv(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &inarray)
Array< OneD, NekDouble > StdExpansion_BwdTrans(StdExpansionSharedPtr exp, const Array< OneD, const NekDouble > &in)
NekDouble StdExpansion_L2(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)

◆ export_StdMatrixKey()

void export_StdMatrixKey ( )

Export for StdMatrixKey enumeration.

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

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, StdMatrixKey_Init(), and Nektar::StdRegions::VarCoeffTypeMap.

Referenced by BOOST_PYTHON_MODULE().

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>());
83 
84  py::class_<StdMatrixKey>("StdMatrixKey", py::no_init)
85  .def("__init__", py::make_constructor(
86  &StdMatrixKey_Init, py::default_call_policies(),
87  (py::arg("matType"), py::arg("shapeType"), py::arg("exp"),
88  py::arg("constFactorMap") = py::object(),
89  py::arg("varCoeffMap") = py::object())))
90 
91  .def("GetMatrixType", &StdMatrixKey::GetMatrixType)
92  .def("GetShapeType", &StdMatrixKey::GetShapeType)
93  .def("GetNcoeffs", &StdMatrixKey::GetNcoeffs)
94  .def("GetBasis", &StdMatrixKey::GetBasis)
95  ;
96 }
StdMatrixKey * StdMatrixKey_Init(const MatrixType matType, const LibUtilities::ShapeType shapeType, const StdExpansionSharedPtr exp, const py::object &constFactorMap, const py::object &varCoeffMap)
const char *const ConstFactorTypeMap[]
Definition: StdRegions.hpp:282
const char *const MatrixTypeMap[]
Definition: StdRegions.hpp:149
const char *const VarCoeffTypeMap[]
Definition: StdRegions.hpp:232
#define NEKPY_WRAP_ENUM(ENUMNAME, MAPNAME)
Definition: NekPyConfig.hpp:56