Spline.hpp
Go to the documentation of this file.
106 };
536 throw std::runtime_error("Spline type "+std::to_string(int(splineType))+" not supported at this place");
575 throw std::runtime_error("Spline type "+std::to_string(int(splineType))+" not supported at this place");
618 throw std::runtime_error("Spline type "+std::to_string(int(splineType))+" not supported at this place");
661 throw std::runtime_error("Spline type "+std::to_string(int(splineType))+" not supported at this place");
704 throw std::runtime_error("Spline type "+std::to_string(int(splineType))+" not supported at this place");
772 throw std::runtime_error("The sampling points given to a spline must be sorted by their x value!");
865 throw NumericalIssue("Tried to evaluate the second derivative of a spline outside of its range");
888 throw NumericalIssue("Tried to evaluate the third derivative of a spline outside of its range");
937 throw std::runtime_error("Spline has more than one intersection"); //<<a<<"x^3 + "<<b<"x^2 + "<<c<"x + "<<d);
942 throw std::runtime_error("Spline has no intersection"); //<<a<"x^3 + " <<b<"x^2 + "<<c<"x + "<<d<<"!");
Provides the opm-material specific exception classes. Provides free functions to invert polynomials of degree 1, 2 and 3. Definition: Exceptions.hpp:46 size_t numSamples() const Return the number of (x, y) values. Definition: Spline.hpp:717 void makeFullSystem_(Matrix &M, Vector &d, Scalar m0, Scalar m1) Make the linear system of equations Mx = d which results in the moments of the full spline. Definition: Spline.hpp:1260 Evaluation h11_prime2_(const Evaluation &t) const Definition: Spline.hpp:1611 void setArrayOfPoints(size_t nSamples, const PointArray &points, SplineType splineType=Natural, bool sortInputs=true) Set the sampling points of a natural spline using a C-style array. Definition: Spline.hpp:591 void setXYArrays(size_t nSamples, const ScalarArrayX &x, const ScalarArrayY &y, Scalar m0, Scalar m1, bool sortInputs=true) Set the sampling points and the boundary slopes of a full spline using C-style arrays. Definition: Spline.hpp:322 Scalar valueAt(size_t sampleIdx) const Return the x value of a given sampling point. Definition: Spline.hpp:729 void makeNaturalSpline_() Create a natural spline from the already set sampling points. Definition: Spline.hpp:1118 void sortInput_() Sort the sample points in ascending order of their x value. Definition: Spline.hpp:1044 Spline(size_t nSamples, const ScalarArrayX &x, const ScalarArrayY &y, SplineType splineType=Natural, bool sortInputs=true) Convenience constructor for a natural or a periodic spline. Definition: Spline.hpp:140 Spline(const PointContainer &points, Scalar m0, Scalar m1, bool sortInputs=true) Convenience constructor for a full spline. Definition: Spline.hpp:249 void setSlopesFromMoments_(SlopeVector &slopes, const MomentsVector &moments) Convert the moments at the sample points to slopes. Definition: Spline.hpp:1441 void setContainerOfTuples(const XYContainer &points, Scalar m0, Scalar m1, bool sortInputs=true) Set the sampling points and the boundary slopes of a full spline using a STL-compatible container of ... Definition: Spline.hpp:469 void makePeriodicSystem_(Matrix &M, Vector &d) Make the linear system of equations Mx = d which results in the moments of the periodic spline. Definition: Spline.hpp:1330 int monotonic(Scalar x0, Scalar x1, bool extrapolate=false) const Returns 1 if the spline is monotonically increasing, -1 if the spline is mononously decreasing and 0 ... Definition: Spline.hpp:955 bool applies(const Evaluation &x) const Return true iff the given x is in range [x1, xn]. Definition: Spline.hpp:711 Evaluation evalDerivative3_(const Evaluation &x, size_t i) const Definition: Spline.hpp:1548 void assignFromArrayList_(DestVector &destX, DestVector &destY, const ListIterator &srcBegin, const ListIterator &srcEnd, unsigned nSamples) Definition: Spline.hpp:1192 Spline(const ScalarContainer &x, const ScalarContainer &y, SplineType splineType=Natural, bool sortInputs=true) Convenience constructor for a natural or a periodic spline. Definition: Spline.hpp:169 Spline(Scalar x0, Scalar x1, Scalar y0, Scalar y1, Scalar m0, Scalar m1) Convenience constructor for a full spline with just two sampling points. Definition: Spline.hpp:126 Evaluation intersect(const Evaluation &a, const Evaluation &b, const Evaluation &c, const Evaluation &d) const Find the intersections of the spline with a cubic polynomial in the whole interval,... Definition: Spline.hpp:902 Scalar y_(size_t i) const Returns the y coordinate of the i-th sampling point. Definition: Spline.hpp:1771 int monotonic_(size_t i, Scalar x0, Scalar x1, int &r) const Definition: Spline.hpp:1639 Evaluation evalDerivative(const Evaluation &x, bool extrapolate=false) const Evaluate the spline's derivative at a given position. Definition: Spline.hpp:833 Spline(const PointContainer &points, SplineType splineType=Natural, bool sortInputs=true) Convenience constructor for a natural or a periodic spline. Definition: Spline.hpp:182 void makeNaturalSystem_(Matrix &M, Vector &d) Make the linear system of equations Mx = d which results in the moments of the natural spline. Definition: Spline.hpp:1284 void set(Scalar x0, Scalar x1, Scalar y0, Scalar y1, Scalar m0, Scalar m1) Set the sampling points and the boundary slopes of the spline with two sampling points. Definition: Spline.hpp:266 Spline(const ScalarContainerX &x, const ScalarContainerY &y, Scalar m0, Scalar m1, bool sortInputs=true) Convenience constructor for a full spline. Definition: Spline.hpp:233 void setContainerOfPoints(const XYContainer &points, SplineType splineType=Natural, bool sortInputs=true) Set the sampling points of a natural spline using a STL-compatible container of array-like objects. Definition: Spline.hpp:633 Evaluation evalThirdDerivative(const Evaluation &x, bool extrapolate=false) const Evaluate the spline's third derivative at a given position. Definition: Spline.hpp:885 void printCSV(Scalar xi0, Scalar xi1, size_t k, std::ostream &os=std::cout) const Prints k tuples of the format (x, y, dx/dy, isMonotonic) to stdout. Definition: Spline.hpp:749 Spline(size_t nSamples, const ScalarArray &x, const ScalarArray &y, Scalar m0, Scalar m1, bool sortInputs=true) Convenience constructor for a full spline. Definition: Spline.hpp:198 void assignSamplingPoints_(DestVector &destX, DestVector &destY, const SourceVector &srcX, const SourceVector &srcY, unsigned nSamples) Set the sampling point vectors. Definition: Spline.hpp:1172 Scalar xAt(size_t sampleIdx) const Return the x value of a given sampling point. Definition: Spline.hpp:723 int monotonic() const Same as monotonic(x0, x1), but with the entire range of the spline as interval. Definition: Spline.hpp:1022 Evaluation h00_prime2_(const Evaluation &t) const Definition: Spline.hpp:1599 void assignFromTupleList_(DestVector &destX, DestVector &destY, ListIterator srcBegin, ListIterator srcEnd, unsigned nSamples) Set the sampling points. Definition: Spline.hpp:1226 Evaluation h01_prime2_(const Evaluation &t) const Definition: Spline.hpp:1607 Spline(size_t nSamples, const PointArray &points, Scalar m0, Scalar m1, bool sortInputs=true) Convenience constructor for a full spline. Definition: Spline.hpp:216 Scalar slope_(size_t i) const Returns the slope (i.e. first derivative) of the spline at the i-th sampling point. Definition: Spline.hpp:1778 Evaluation eval(const Evaluation &x, bool extrapolate=false) const Evaluate the spline at a given position. Definition: Spline.hpp:797 Evaluation evalDerivative2_(const Evaluation &x, size_t i) const Definition: Spline.hpp:1530 size_t intersectSegment_(Evaluation *sol, size_t segIdx, const Evaluation &a, const Evaluation &b, const Evaluation &c, const Evaluation &d, Scalar x0=-1e30, Scalar x1=1e30) const Find all the intersections of a segment of the spline with a cubic polynomial within a specified inte... Definition: Spline.hpp:1707 Scalar x_(size_t i) const Returns the y coordinate of the i-th sampling point. Definition: Spline.hpp:1765 Evaluation evalDerivative_(const Evaluation &x, size_t i) const Definition: Spline.hpp:1512 void setArrayOfPoints(size_t nSamples, const PointArray &points, Scalar m0, Scalar m1, bool sortInputs=true) Set the sampling points and the boundary slopes of a full spline using a C-style array. Definition: Spline.hpp:390 void makeFullSpline_(Scalar m0, Scalar m1) Create a natural spline from the already set sampling points. Definition: Spline.hpp:1097 Evaluation evalSecondDerivative(const Evaluation &x, bool extrapolate=false) const Evaluate the spline's second derivative at a given position. Definition: Spline.hpp:862 void makeMonotonicSpline_(Vector &slopes) Create a monotonic spline from the already set sampling points. Definition: Spline.hpp:1392 void setNumSamples_(size_t nSamples) Resizes the internal vectors to store the sample points. Definition: Spline.hpp:1085 void setXYArrays(size_t nSamples, const ScalarArrayX &x, const ScalarArrayY &y, SplineType splineType=Natural, bool sortInputs=true) Set the sampling points natural spline using C-style arrays. Definition: Spline.hpp:510 Evaluation h10_prime2_(const Evaluation &t) const Definition: Spline.hpp:1603 void reverseSamplingPoints_() Reverse order of the elements in the arrays which contain the sampling points. Definition: Spline.hpp:1072 void setContainerOfTuples(const XYContainer &points, SplineType splineType=Natural, bool sortInputs=true) Set the sampling points of a natural spline using a STL-compatible container of tuple-like objects. Definition: Spline.hpp:679 void setXYContainers(const ScalarContainerX &x, const ScalarContainerY &y, SplineType splineType=Natural, bool sortInputs=true) Set the sampling points of a natural spline using STL-compatible containers. Definition: Spline.hpp:551 void setXYContainers(const ScalarContainerX &x, const ScalarContainerY &y, Scalar m0, Scalar m1, bool sortInputs=true) Set the sampling points and the boundary slopes of a full spline using STL-compatible containers. Definition: Spline.hpp:356 void makePeriodicSpline_() Create a periodic spline from the already set sampling points. Definition: Spline.hpp:1139 void setContainerOfPoints(const XYContainer &points, Scalar m0, Scalar m1, bool sortInputs=true) Set the sampling points and the boundary slopes of a full spline using a STL-compatible container of ... Definition: Spline.hpp:427 Evaluation intersectInterval(Scalar x0, Scalar x1, const Evaluation &a, const Evaluation &b, const Evaluation &c, const Evaluation &d) const Find the intersections of the spline with a cubic polynomial in a sub-interval of the spline,... Definition: Spline.hpp:917 Spline(size_t nSamples, const PointArray &points, SplineType splineType=Natural, bool sortInputs=true) Convenience constructor for a natural or a periodic spline. Definition: Spline.hpp:155 Provides a tridiagonal matrix that also supports non-zero entries in the upper right and lower left. Definition: TridiagonalMatrix.hpp:51 size_t rows() const Return the number of rows of the matrix. Definition: TridiagonalMatrix.hpp:140 void solve(XVector &x, const BVector &b) const Calculate the solution for a linear system of equations. Definition: TridiagonalMatrix.hpp:714 Definition: Air_Mesitylene.hpp:34 ReturnEval_< Evaluation1, Evaluation2 >::type min(const Evaluation1 &arg1, const Evaluation2 &arg2) Definition: MathToolbox.hpp:346 ReturnEval_< Evaluation1, Evaluation2 >::type max(const Evaluation1 &arg1, const Evaluation2 &arg2) Definition: MathToolbox.hpp:341 auto scalarValue(const Evaluation &val) -> decltype(MathToolbox< Evaluation >::scalarValue(val)) Definition: MathToolbox.hpp:335 unsigned invertCubicPolynomial(SolContainer *sol, Scalar a, Scalar b, Scalar c, Scalar d) Invert a cubic polynomial analytically. Definition: PolynomialUtils.hpp:148 Helper class needed to sort the input sampling points. Definition: Spline.hpp:1030 ComparatorX_(const std::vector< Scalar > &x) Definition: Spline.hpp:1031 bool operator()(unsigned idxA, unsigned idxB) const Definition: Spline.hpp:1035 |