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 73 of file Python/Foundations/Points.cpp.

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

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 48 of file Python/Foundations/Points.cpp.

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

References Nektar::LibUtilities::PointsManager().

Referenced by export_Points().

◆ Points_GetD()

MatrixSharedPtrType Points_GetD ( PointsSharedPtr  pts)

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

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

Referenced by export_Points().

◆ Points_GetD2()

MatrixSharedPtrType Points_GetD2 ( PointsSharedPtr  pts,
Direction  dir 
)

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

65 {
66  return pts->GetD(dir);
67 }

Referenced by export_Points().

◆ Points_GetZW()

py::tuple Points_GetZW ( PointsSharedPtr  pts)

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

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

Referenced by export_Points().