Nektar++
Functions
Python/StdMatrixKey.cpp File Reference
#include <LibUtilities/Python/NekPyConfig.hpp>
#include <StdRegions/StdExpansion.h>
#include <StdRegions/StdMatrixKey.h>
#include <vector>
#include <boost/python/suite/indexing/map_indexing_suite.hpp>

Go to the source code of this file.

Functions

StdMatrixKeyStdMatrixKey_Init (const MatrixType matType, const LibUtilities::ShapeType shapeType, const StdExpansionSharedPtr exp, const py::object &constFactorMap, const py::object &varCoeffMap)
 
void export_StdMatrixKey ()
 Export for StdMatrixKey enumeration. More...
 

Function Documentation

◆ 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().

◆ StdMatrixKey_Init()

StdMatrixKey * StdMatrixKey_Init ( const MatrixType  matType,
const LibUtilities::ShapeType  shapeType,
const StdExpansionSharedPtr  exp,
const py::object &  constFactorMap,
const py::object &  varCoeffMap 
)

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

50{
53
54 if (!constFactorMap.is_none())
55 {
56 tmp = py::extract<ConstFactorMap>(constFactorMap);
57 }
58
59 if (!varCoeffMap.is_none())
60 {
61 tmp2 = py::extract<VarCoeffMap>(varCoeffMap);
62 }
63
64 return new StdMatrixKey(matType, shapeType, *exp, tmp, tmp2);
65}
std::map< ConstFactorType, NekDouble > ConstFactorMap
Definition: StdRegions.hpp:402
static ConstFactorMap NullConstFactorMap
Definition: StdRegions.hpp:403
static VarCoeffMap NullVarCoeffMap
Definition: StdRegions.hpp:347
std::map< StdRegions::VarCoeffType, VarCoeffEntry > VarCoeffMap
Definition: StdRegions.hpp:346

References Nektar::StdRegions::NullConstFactorMap, and Nektar::StdRegions::NullVarCoeffMap.

Referenced by export_StdMatrixKey().