18#include <structmember.h>
22#include <boost/python.hpp>
28#include "PyOpal/ExceptionTranslation.h"
35namespace py = boost::python;
39 boost::python::list values,
42 int gLength = py::len(values);
43 std::vector<std::vector<double> > valuesVec(gLength);
44 for (
int i = 0; i < gLength; ++i) {
45 int lineLength = py::len(values[i]);
46 valuesVec[i] = std::vector<double>(lineLength);
47 for (
int j = 0; j < lineLength; ++j) {
48 valuesVec[i][j] = py::extract<double>(values[i][j]);
56 polyPatchOrder).
solve();
63 if (py::len(point) != pointDim) {
66 std::vector<double> pointVec(pointDim);
67 for (
int i = 0; i < pointDim; ++i) {
68 pointVec[i] = py::extract<double>(point[i]);
70 std::vector<double> valueVec(valueDim);
71 patch->
function(&pointVec[0], &valueVec[0]);
72 py::list value = py::list();
73 for (
int i = 0; i < valueDim; ++i) {
74 value.append(valueVec[i]);
84 py::class_<PolynomialPatch, boost::noncopyable>(
"PolynomialPatch")
86 py::return_value_policy<py::manage_new_object>())
87 .staticmethod(
"initialise_from_solve_factory")
void registerExceptions()
Register exception translations with boost.
const char * module_docstring
BOOST_PYTHON_MODULE(polynomial_patch)
PolynomialPatch * initialiseFromSolveFactory(NDGrid *points, boost::python::list values, int polyPatchOrder, int smoothingOrder)
py::list function(PolynomialPatch *patch, py::list point)
Base class for meshing routines.
NDGrid holds grid information for a rectilinear grid in some arbitrary dimensional space.
NDGrid * clone()
Inheritable copy constructor.
Patches together many SquarePolynomialVectors to make a multidimensional polynomial spline.
unsigned int getPointDimension() const
Get the point dimension (length of the ordinate)
virtual void function(const double *point, double *value) const
Get the value at a given point.
unsigned int getValueDimension() const
Get the value dimension (length of the abscissa)
PPSolveFactory solves the system of linear equations to interpolate from a grid of points using highe...
PolynomialPatch * solve()
Solve the system of equations to generate a PolynomialPatch object.