Nektar++
Typedefs | Functions
Python/Foundations/Points.cpp File Reference
#include <LibUtilities/Foundations/ManagerAccess.h>
#include <LibUtilities/Foundations/Points.h>
#include <LibUtilities/Foundations/PointsType.h>
#include <LibUtilities/Python/NekPyConfig.hpp>

Go to the source code of this file.

Typedefs

typedef std::shared_ptr< Points< double > > PointsSharedPtr
 
typedef std::shared_ptr< NekMatrix< NekDouble > > MatrixSharedPtrType
 

Functions

PointsSharedPtr Points_Create (const PointsKey &pts)
 
py::tuple Points_GetZW (PointsSharedPtr pts)
 
MatrixSharedPtrType Points_GetD (PointsSharedPtr pts)
 
MatrixSharedPtrType Points_GetD2 (PointsSharedPtr pts, Direction dir)
 
void export_Points ()
 Points exports. More...
 

Typedef Documentation

◆ MatrixSharedPtrType

typedef std::shared_ptr<NekMatrix<NekDouble> > MatrixSharedPtrType

Definition at line 45 of file Python/Foundations/Points.cpp.

◆ PointsSharedPtr

typedef std::shared_ptr<Points<double> > PointsSharedPtr

Definition at line 44 of file Python/Foundations/Points.cpp.

Function Documentation

◆ export_Points()

void export_Points ( )

Points exports.

Definition at line 70 of file Python/Foundations/Points.cpp.

71 {
74  "Characterise the type of points.\n"
75  "\n"
76  "Sample usage: PointsType.GaussLobattoLegendre\n"
77  "\n"
78  "Available point types:\n"
79  "\tNoPointsType: No points type.\n"
80  "\tGaussGaussLegendre: 1D Gauss-Gauss-Legendre quadrature points.\n"
81  "\tGaussRadauMLegendre: 1D Gauss-Radau-Legendre quadrature points,\n"
82  "\t\tpinned at x=-1.\n"
83  "\tGaussRadauPLegendre: 1D Gauss-Radau-Legendre quadrature points,\n"
84  "\t\tpinned at x=1.\n"
85  "\tGaussLobattoLegendre: 1D Gauss-Lobatto-Legendre quadrature points.\n"
86  "\tGaussGaussChebyshev: 1D Gauss-Gauss-Chebyshev quadrature points.\n"
87  "\tGaussRadauMChebyshev: 1D Gauss-Radau-Chebyshev quadrature points,\n"
88  "\t\tpinned at x=-1.\n"
89  "\tGaussRadauPChebyshev: 1D Gauss-Radau-Chebyshev quadrature points,\n"
90  "\t\tpinned at x=1.\n"
91  "\tGaussLobattoChebyshev: 1D Gauss-Lobatto-Legendre quadrature points\n"
92  "\tGaussRadauMAlpha0Beta1: Gauss Radau pinned at x=-1,\n"
93  "\t\talpha = 0, beta = 1\n"
94  "\tGaussRadauMAlpha0Beta2: Gauss Radau pinned at x=-1,\n"
95  "\t\talpha = 0, beta = 2\n"
96  "\tGaussRadauMAlpha1Beta0: Gauss Radau pinned at x=-1,\n"
97  "\t\talpha = 1, beta = 0\n"
98  "\tGaussRadauMAlpha2Beta0: Gauss Radau pinned at x=-1,\n"
99  "\t\talpha = 2, beta = 0\n"
100  "\tGaussKronrodLegendre: 1D Gauss-Kronrod-Legendre quadrature points.\n"
101  "\tGaussRadauKronrodMLegendre: 1D Gauss-Radau-Kronrod-Legendre "
102  "quadrature\n"
103  "\t\tpoints, pinned at x=-1.\n"
104  "\tGaussRadauKronrodMAlpha1Beta0: 1D Gauss-Radau-Kronrod-Legendre\n"
105  "\t\tpinned at x=-1, alpha = 1, beta = 0\n"
106  "\tGaussLobattoKronrodLegendre: 1D Lobatto Kronrod quadrature points.\n"
107  "\tPolyEvenlySpaced: 1D Evenly-spaced points using Lagrange "
108  "polynomial.\n"
109  "\tFourierEvenlySpaced: 1D Evenly-spaced points using Fourier Fit.\n"
110  "\tFourierSingleModeSpaced: 1D Non Evenly-spaced points for Single "
111  "Mode\n"
112  "\t\tanalysis.\n"
113  "\tBoundaryLayerPoints: 1D power law distribution for boundary layer "
114  "points.\n"
115  "\tBoundaryLayerPointsRev: 1D power law distribution for boundary "
116  "layer\n"
117  "\t\tpoints.\n"
118  "\tNodalTriElec: 2D Nodal Electrostatic Points on a Triangle.\n"
119  "\tNodalTriFekete: 2D Nodal Fekete Points on a Triangle.\n"
120  "\tNodalTriEvenlySpaced: 2D Evenly-spaced points on a Triangle.\n"
121  "\tNodalTetEvenlySpaced: 3D Evenly-spaced points on a Tetrahedron.\n"
122  "\tNodalTetElec: 3D Nodal Electrostatic Points on a Tetrahedron.\n"
123  "\tNodalPrismEvenlySpaced: 3D Evenly-spaced points on a Prism.\n"
124  "\tNodalPrismElec: 3D electrostatically spaced points on a Prism.\n"
125  "\tNodalTriSPI: 2D Nodal Symmetric positive internal triangle\n"
126  "\t\t(Whitherden, Vincent).\n"
127  "\tNodalTetSPI: 3D Nodal Symmetric positive internal tet\n"
128  "\t\t(Whitherden, Vincent).\n"
129  "\tNodalPrismSPI: 3D prism SPI.\n"
130  "\tNodalQuadElec: 2D GLL for quad.\n"
131  "\tNodalHexElec: 3D GLL for hex");
132 
133  py::class_<PointsKey>(
134  "PointsKey",
135  "Create a PointsKey which uniquely defines quadrature points.\n"
136  "\n"
137  "Args:\n"
138  "\tnQuadPoints (integer): The number of quadrature points.\n"
139  "\tpointsType (PointsType object): The type of quadrature points.",
140  py::init<const int, const PointsType &>())
141 
142  .def("GetNumPoints", &PointsKey::GetNumPoints,
143  "Get the number of quadrature points in PointsKey.\n"
144  "\n"
145  "Args:\n"
146  "\tNone\n"
147  "Returns:\n"
148  "\tInteger defining the number of quadrature points in PointsKey.")
149  .def("GetPointsType", &PointsKey::GetPointsType,
150  "Get the type of points in PointsKey.\n"
151  "\n"
152  "Args:\n"
153  "\tNone\n"
154  "Returns:\n"
155  "\tPointsType object specifying the type of points in PointsKey.")
156  .def("GetPointsDim", &PointsKey::GetPointsDim,
157  "Get the dimension of the PointsKey.\n"
158  "\n"
159  "Args:\n"
160  "\tNone\n"
161  "Returns:\n"
162  "\tInteger characterising the dimension of the PointsKey (e.g. 2\n"
163  "\tfor 2D PointsKey).")
164  .def("GetTotNumPoints", &PointsKey::GetTotNumPoints,
165  "Get the total number of points in PointsKey.\n"
166  "\n"
167  "Args:\n"
168  "\tNone\n"
169  "Returns:\n"
170  "\tInteger defining the total number of points in PointsKey.");
171 
172  py::class_<Points<double>, std::shared_ptr<Points<double>>,
173  boost::noncopyable>(
174  "Points",
175  "Create a set of points which can be used to calculate\n"
176  "quadrature zeros, weights etc."
177  "\n"
178  "Args:\n"
179  "\tNone",
180  py::no_init)
181  .def("Create", &Points_Create,
182  "Create a Points object using PointsKey.\n"
183  "\n"
184  "Args:\n"
185  "\tpointsKey (PointsKey object): The PointsKey to be used to\n"
186  "\tcreate points.\n"
187  "Returns:\n"
188  "\tPoints object created with the given PointsKey.")
189  .staticmethod("Create")
190 
191  .def("Initialise", &Points<double>::Initialize,
192  "Initialise Points object by calculating points, weights\n"
193  "and differentiation matrix.\n"
194  "\n"
195  "Args:\n"
196  "\tNone\n"
197  "Returns:\n"
198  "\tNone")
199  .def("GetPointsDim", &Points<double>::GetPointsDim,
200  "Get the dimension of the Points object.\n"
201  "\n"
202  "Args:\n"
203  "\tNone\n"
204  "Returns:\n"
205  "\tInteger characterising the dimension of the Points object\n"
206  "\t(e.g. 2 for 2D Points object).")
207  .def("GetPointsType", &Points<double>::GetPointsType,
208  "Get the type of points in Points object.\n"
209  "\n"
210  "Args:\n"
211  "\tNone\n"
212  "Returns:\n"
213  "\tPointsType object specifying the type of points in Points\n"
214  "\tobject.")
215  .def("GetNumPoints", &Points<double>::GetNumPoints,
216  "Get the number of quadrature points in Points object.\n"
217  "\n"
218  "Args:\n"
219  "\tNone\n"
220  "Returns:\n"
221  "\tInteger defining the number of quadrature points in Points\n"
222  "\tobject.")
223  .def("GetTotNumPoints", &Points<double>::GetTotNumPoints,
224  "Get the total number of points in Points object.\n"
225  "\n"
226  "Args:\n"
227  "\tNone\n"
228  "Returns:\n"
229  "\tInteger defining the total number of points in Points\n"
230  "\tobject.")
231 
232  .def("GetZ", &Points<double>::GetZ,
233  py::return_value_policy<py::copy_const_reference>(),
234  "Get quadrature zeros.\n"
235  "\n"
236  "Args:\n"
237  "\tNone\n"
238  "Returns:\n"
239  "\tNumPy ndarray of length equal to the number of quadrature\n"
240  "\tpoints, containing quadrature zeros.")
241  .def("GetW", &Points<double>::GetW,
242  py::return_value_policy<py::copy_const_reference>(),
243  "Get quadrature weights.\n"
244  "\n"
245  "Args:\n"
246  "\tNone\n"
247  "Returns:\n"
248  "\tNumPy ndarray of length equal to the number of quadrature\n"
249  "\tpoints, containing quadrature weights.")
250  .def("GetZW", &Points_GetZW,
251  "Get quadrature zeros and weights.\n"
252  "\n"
253  "Args:\n"
254  "\tNone\n"
255  "Returns:\n"
256  "\tTuple containing the quadrature zeros and quadrature weights,\n"
257  "\ti.e. (Points.GetZ(), Points.GetW()).")
258  .def("GetD", &Points_GetD,
259  "Get the differentiation matrix.\n"
260  "\n"
261  "Args:\n"
262  "\tNone\n"
263  "Returns:\n"
264  "\tNumPy ndarray of n x n dimensions, where n is equal to\n"
265  "\tthe number of quadrature points, containing the\n"
266  "\tdifferentiation matrix.")
267  .def("GetD", &Points_GetD2,
268  "Get the differentiation matrix.\n"
269  "\n"
270  "Args:\n"
271  "\tdir (Direction object): The direction of the desired\n"
272  "\tdifferentiation matrix.\n"
273  "Returns:\n"
274  "\tNumPy ndarray of n x n dimensions, where n is equal to\n"
275  "\tthe number of quadrature points containing the\n"
276  "\tdifferentiation matrix.");
277 }
#define NEKPY_WRAP_ENUM_STRING_DOCS(ENUMNAME, MAPNAME, DOCSTRING)
py::tuple Points_GetZW(PointsSharedPtr pts)
MatrixSharedPtrType Points_GetD(PointsSharedPtr pts)
PointsSharedPtr Points_Create(const PointsKey &pts)
MatrixSharedPtrType Points_GetD2(PointsSharedPtr pts, Direction dir)
Stores a set of points of datatype DataT, defined by a PointKey.
Definition: Points.h:254
const std::string kPointsTypeStr[]
Definition: Foundations.hpp:54

References Nektar::LibUtilities::PointsKey::GetNumPoints(), Nektar::LibUtilities::PointsKey::GetPointsDim(), Nektar::LibUtilities::PointsKey::GetPointsType(), Nektar::LibUtilities::PointsKey::GetTotNumPoints(), Nektar::LibUtilities::kPointsTypeStr, NEKPY_WRAP_ENUM_STRING_DOCS, Points_Create(), Points_GetD(), Points_GetD2(), and Points_GetZW().

Referenced by BOOST_PYTHON_MODULE().

◆ Points_Create()

PointsSharedPtr Points_Create ( const PointsKey pts)

Definition at line 47 of file Python/Foundations/Points.cpp.

48 {
49  return PointsManager()[pts];
50 }
PointsManagerT & PointsManager(void)

References Nektar::LibUtilities::PointsManager().

Referenced by export_Points().

◆ Points_GetD()

MatrixSharedPtrType Points_GetD ( PointsSharedPtr  pts)

Definition at line 57 of file Python/Foundations/Points.cpp.

58 {
59  return pts->GetD();
60 }

Referenced by export_Points().

◆ Points_GetD2()

MatrixSharedPtrType Points_GetD2 ( PointsSharedPtr  pts,
Direction  dir 
)

Definition at line 62 of file Python/Foundations/Points.cpp.

63 {
64  return pts->GetD(dir);
65 }

Referenced by export_Points().

◆ Points_GetZW()

py::tuple Points_GetZW ( PointsSharedPtr  pts)

Definition at line 52 of file Python/Foundations/Points.cpp.

53 {
54  return py::make_tuple(pts->GetZ(), pts->GetW());
55 }

Referenced by export_Points().