G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsQuasiInterpolate.h
Go to the documentation of this file.
1
16#pragma once
17
19
20namespace gismo {
21
35template <class T>
37{
38
39 /*
40 enum method
41 {
42 Taylor = 1, ///< Taylor
43 Schoenberg = 2, ///< Schoenberg
44 EvalBased = 3
45 };
46
47 switch(type)
48 {
49 case(1): gsQuasiInterpolate<T>::Schoenberg(*basis, fun, coefs); expConvRate = 2.0; break;
50 case(2): gsQuasiInterpolate<T>::Taylor(*basis, fun, deg, coefs); expConvRate = (deg+1); break;
51 case(3): gsQuasiInterpolate<T>::EvalBased(*basis, fun, true, coefs); expConvRate = (deg+1); break;
52 case(0): gsQuasiInterpolate<T>::EvalBased(*basis, fun, false, coefs); expConvRate = (deg+1); break;
53 default: GISMO_ERROR("invalid option");
54 }
55 */
56
57 static gsMatrix<T> localIntpl(const gsBasis<T> &b,
58 const gsFunction<T> &fun,
59 index_t i,
60 const gsMatrix<T> &ab);
61
62 static gsMatrix<T> localIntpl(const gsBasis<T> &b,
63 const gsFunction<T> &fun,
64 index_t i);
65
66 template<short_t d>
67 static gsMatrix<T> localIntpl(const gsHTensorBasis<d,T> &b,
68 const gsFunction<T> &fun,
69 index_t i);
70
71
72 static void localIntpl(const gsBasis<T> &b,
73 const gsFunction<T> &fun,
74 gsMatrix<T> &result);
75
76
96 static void Taylor(const gsBasis<T> &bb, const gsFunction<T> &fun, const int &r, gsMatrix<T> &result);
97
98
106 static void Schoenberg(const gsBasis<T> &b, const gsFunction<T> &fun,
107 gsMatrix<T> &result);
108
109 static gsMatrix<T> Schoenberg(const gsBasis<T> &b, const gsFunction<T> &fun, index_t i);
110
111
163 static void EvalBased(const gsBasis<T> &bb, const gsFunction<T> &fun, const bool specialCase, gsMatrix<T> &result);
164
165
166 /*
167 static void qiCwiseData(const gsTensorBSplineBasis<T,2> & tbsp,
168 const gsVector<index_t> & ind,
169 std::vector<gsMatrix<T> > & qiNodes,
170 std::vector<gsMatrix<T> > & qiWeights);
171
172 static void compute(const gsTensorBSplineBasis<T,2> & tbsp,
173 const gsFunction<T> & fun,
174 gsTensorBSpline<T> & res);
175 */
176
177protected:
178
187 static T derivProd(const std::vector<T> &zeros, const int &order, const T &x);
188
189
198 static void distributePoints(T a, T b, int n, gsMatrix<T> &points);
199
200
212 static void computeWeights(const gsMatrix<T> &points, const gsKnotVector<T> &knots, const int &pos, gsMatrix<T> &weights);
213
214
224 static gsMatrix<T> computeControlPoints(const gsMatrix<T> &weights, const gsFunction<T> &fun, const gsMatrix<T> &xik);
225
233 static int greatestSubInterval(const gsKnotVector<T> &knots, const int &posStart, const int &posEnd);
234
235
236}; //struct
237
238} // gismo
239
240#ifndef GISMO_BUILD_LIB
241#include GISMO_HPP_HEADER(gsQuasiInterpolate.hpp)
242#endif
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
Class representing a (scalar) hierarchical tensor basis of functions .
Definition gsHTensorBasis.h:75
Class for representing a knot vector.
Definition gsKnotVector.h:80
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
#define index_t
Definition gsConfig.h:32
Provides forward declarations of types and structs.
The G+Smo namespace, containing all definitions for the library.
Quasi-interpolation operators.
Definition gsQuasiInterpolate.h:37
static void EvalBased(const gsBasis< T > &bb, const gsFunction< T > &fun, const bool specialCase, gsMatrix< T > &result)
A quasi-interpolation scheme based on the evaluation of the function at certain points....
Definition gsQuasiInterpolate.hpp:156
static gsMatrix< T > computeControlPoints(const gsMatrix< T > &weights, const gsFunction< T > &fun, const gsMatrix< T > &xik)
The quasi-interpolant is a spline function, in particular a linear combination of some controlpoints ...
Definition gsQuasiInterpolate.hpp:367
static void Schoenberg(const gsBasis< T > &b, const gsFunction< T > &fun, gsMatrix< T > &result)
A quasi-interpolation scheme based on Schoenberg Variation Diminishing Spline Approximation....
Definition gsQuasiInterpolate.hpp:414
static T derivProd(const std::vector< T > &zeros, const int &order, const T &x)
Compute the derivative of a certain order of a normalized polynomial (leading coefficient is 1) defin...
Definition gsQuasiInterpolate.hpp:276
static void distributePoints(T a, T b, int n, gsMatrix< T > &points)
Compute a number of equally distributed points in a given interval . You get a list of points .
Definition gsQuasiInterpolate.hpp:311
static void computeWeights(const gsMatrix< T > &points, const gsKnotVector< T > &knots, const int &pos, gsMatrix< T > &weights)
To compute the control points of the quasi-interpolant one uses the function computeControlPoints....
Definition gsQuasiInterpolate.hpp:320
static void Taylor(const gsBasis< T > &bb, const gsFunction< T > &fun, const int &r, gsMatrix< T > &result)
A quasi-interpolation scheme based on the tayor expansion of the function to approximate....
Definition gsQuasiInterpolate.hpp:103
static int greatestSubInterval(const gsKnotVector< T > &knots, const int &posStart, const int &posEnd)
This function finds the greatest knot interval in a given range in a knot vector.
Definition gsQuasiInterpolate.hpp:376