G+Smo
24.08.0
Geometry + Simulation Modules
|
A univariate Lagrange basis.
T | coefficient type |
Public Types | |
typedef gsLagrangeBasis< T > | BoundaryBasisType |
Associated Boundary basis type. | |
typedef gsLagrangePoly< T > | GeometryType |
Associated geometry type. | |
typedef memory::shared_ptr < gsLagrangeBasis > | Ptr |
Shared pointer for gsLagrangeBasis. | |
typedef T | Scalar_t |
Coefficient type. | |
typedef memory::unique_ptr < gsLagrangeBasis > | uPtr |
Unique pointer for gsLagrangeBasis. | |
Public Member Functions | |
gsMatrix< index_t > | active (const gsMatrix< T > &u) const |
Returns the indices of active (nonzero) functions at points u, as a list of indices. More... | |
void | active_into (const gsMatrix< T > &u, gsMatrix< index_t > &result) const |
Returns the indices of active (non zero) basis functions at points (columns of) u, as a list of indices, in result. | |
virtual gsMatrix< index_t > | allBoundary () const |
Returns the indices of the basis functions that are nonzero at the domain boundary. | |
void | anchor_into (index_t i, gsMatrix< T > &result) const |
Returns the anchor point for member i of the basis. | |
gsMatrix< T > | anchors () const |
Returns the anchor points that represent the members of the basis. There is exactly one anchor point per basis function. More... | |
void | anchors_into (gsMatrix< T > &result) const |
Returns the anchors (greville points) of the basis. | |
const gsBasis< T > & | basis (const index_t k) const |
Helper which casts and returns the k-th piece of this function set as a gsBasis. | |
gsMatrix< index_t > | boundary () const |
Returns the indices of the basis functions that touch the domain boundary. | |
gsMatrix< index_t > | boundary (boundary::side const &s) const |
Returns the indices of the basis functions that touch the domain boundary. | |
gsMatrix< index_t > | boundary (boxSide const &s) const |
Returns the indices of the basis functions that are nonzero at the domain boundary as single-column-matrix. | |
gsBasis< T >::uPtr | boundaryBasis (boxSide const &s) |
Returns the boundary basis for side s. | |
virtual gsMatrix< index_t > | boundaryOffset (boxSide const &s, index_t offset) const |
bool | check () const |
Check the LagrangeBasis for consistency. | |
uPtr | clone () |
Clone methode. Produceds a deep copy inside a uPtr. | |
gsSparseMatrix< T > | collocationMatrix (gsMatrix< T > const &u) const |
Computes the collocation matrix w.r.t. points u. More... | |
gsLagrangeBasis< T > & | component (index_t i) const |
Returns the same basis for i=0, error otherwise. | |
virtual const gsBasis< T > & | component (short_t i) const |
For a tensor product basis, return the (const) 1-d basis for the i-th parameter component. | |
virtual gsBasis< T > & | component (short_t i) |
For a tensor product basis, return the 1-d basis for the i-th parameter component. | |
virtual uPtr | componentBasis (boxComponent b) const |
Returns the basis that corresponds to the component. | |
virtual uPtr | componentBasis_withIndices (boxComponent b, gsMatrix< index_t > &indices, bool noBoundary=true) const |
Returns the basis that corresponds to the component. More... | |
virtual void | compute (const gsMatrix< T > &in, gsFuncData< T > &out) const |
Computes function data. More... | |
virtual void | connectivity (const gsMatrix< T > &nodes, gsMesh< T > &mesh) const |
virtual void | connectivityAtAnchors (gsMesh< T > &mesh) const |
virtual gsBasis::uPtr | create () const |
Create an empty basis of the derived type and return a pointer to it. | |
short_t | degree () const |
Returns the polynomial degree. | |
virtual short_t | degree (short_t i) const |
Degree with respect to the i-th variable. If the basis is a tensor product of (piecewise) polynomial bases, then this function returns the polynomial degree of the i-th component. | |
virtual void | degreeDecrease (short_t const &i=1, short_t const dir=-1) |
Lower the degree of the basis by the given amount, preserving knots multiplicity. | |
virtual void | degreeElevate (short_t const &i=1, short_t const dir=-1) |
Elevate the degree of the basis by the given amount, preserve smoothness. | |
virtual void | degreeIncrease (short_t const &i=1, short_t const dir=-1) |
Elevate the degree of the basis by the given amount, preserve knots multiplicity. | |
virtual void | degreeReduce (short_t const &i=1, short_t const dir=-1) |
Reduce the degree of the basis by the given amount, preserve smoothness. | |
gsMatrix< T > | deriv (const gsMatrix< T > &u) const |
Evaluate the derivatives,. More... | |
gsMatrix< T > | deriv2 (const gsMatrix< T > &u) const |
Evaluates the second derivatives of active (i.e., non-zero) functions at points u. More... | |
void | deriv2_into (const gsMatrix< T > &u, gsMatrix< T > &result) const |
Evaluates the (partial) derivatives of the nonzero basis functions at points u into result. | |
void | deriv2Single_into (index_t i, const gsMatrix< T > &u, gsMatrix< T > &result) const |
Evaluate the (partial) derivatives of the i-th basis function at points u into result. | |
void | deriv_into (const gsMatrix< T > &u, gsMatrix< T > &result) const |
Evaluates the (partial) derivatives of non-zero basis functions at (the columns of) u. | |
void | derivSingle_into (index_t i, const gsMatrix< T > &u, gsMatrix< T > &result) const |
Evaluates the (partial)derivatives of the i-th basis function at (the columns of) u. | |
std::string | detail () const |
Prints the object as a string with extended details. | |
gsDomain< T > * | domain () const |
short_t | domainDim () const |
Returns the dimension d of the parameter space. | |
virtual size_t | elementIndex (const gsVector< T > &u) const |
Returns an index for the element which contains point u. | |
virtual gsMatrix< T > | elementInSupportOf (index_t j) const |
Returns (the coordinates of) an element in the support of basis function j. | |
virtual void | elevateContinuity (int const &i=1) |
Elevates the continuity of the basis along element boundaries. | |
gsMatrix< T > | eval (const gsMatrix< T > &u) const |
Evaluate the function,. More... | |
void | eval_into (const gsMatrix< T > &u, gsMatrix< T > &result) const |
Evaluates the non-zero basis functions at value u. | |
std::vector< gsMatrix< T > > | evalAllDers (const gsMatrix< T > &u, int n, bool sameElement=false) const |
Evaluate all derivatives upto order n,. More... | |
void | evalAllDers_into (const gsMatrix< T > &u, int n, gsMatrix< T > &result) const |
Evaluate the nonzero basis functions and their derivatives up to order n at points u into result. | |
virtual void | evalAllDers_into (const gsMatrix< T > &u, int n, std::vector< gsMatrix< T > > &result, bool sameElement=false) const |
Evaluate the nonzero functions and their derivatives up to order n at points u into result. More... | |
void | evalAllDersSingle_into (index_t i, const gsMatrix< T > &u, int n, gsMatrix< T > &result) const |
Evaluate the basis function i and its derivatives up to order n at points u into result. | |
void | evalDerSingle_into (index_t i, const gsMatrix< T > &u, int n, gsMatrix< T > &result) const |
Evaluate the (partial) derivative(s) of order n the i-th basis function at points u into result. | |
void | evalSingle_into (index_t i, const gsMatrix< T > &u, gsMatrix< T > &result) const |
Evaluates i-th basis functions at value u. | |
gsBasisFun< T > | function (index_t i) const |
Returns the i-th basis function as a gsFunction. More... | |
const std::vector< T > * | get_m_breaks () const |
Returns the breaks vector of this basis. | |
T | get_m_end () const |
Returns the end of the parameter interval. | |
short_t | get_m_p () const |
Returns the degree of this basis. | |
T | get_m_start () const |
Returns the start of the parameter interval. | |
virtual T | getMaxCellLength () const |
Get the maximum mesh size, as expected for approximation error estimates. | |
virtual T | getMinCellLength () const |
Get the minimum mesh size, as expected for inverse inequalities. | |
void | getTransformationLagrangeBezier (gsMatrix< T > &result) const |
gsLagrangeBasis () | |
Default empty constructor. | |
gsLagrangeBasis (const std::vector< T > &pars, const T &start, const T &end) | |
Construct Lagrange basis along the parameter pars and Interval [start,end]. | |
gsLagrangeBasis (const T &start, const T &end, int amount_of_inner_breaks) | |
Construct Lagrange basis with equidistant breaks in the Interval [start,end]. | |
virtual memory::unique_ptr < gsGeometry< T > > | interpolateAtAnchors (gsMatrix< T > const &vals) const |
Applies interpolation of values pts using the anchors as parameter points. May be reimplemented in derived classes with more efficient algorithms. (by default uses interpolateData(pts,vals) | |
memory::unique_ptr< gsGeometry < T > > | interpolateData (gsMatrix< T > const &vals, gsMatrix< T > const &pts) const |
Applies interpolation given the parameter values pts and values vals. | |
gsGeometry< T > * | interpolateParameters (gsMatrix< T > const &pts, gsMatrix< T > const &vals) const |
Applies interpolation given the parameter values pts and values vals. May be reimplemented in derived classes. | |
virtual bool | isRational () const |
Returns false, since all bases that inherit from gsBasis are not rational. | |
virtual domainIter | makeDomainIterator () const |
Create a domain iterator for the computational mesh of this basis, that points to the first element of the domain. | |
virtual domainIter | makeDomainIterator (const boxSide &s) const |
Create a boundary domain iterator for the computational mesh this basis, that points to the first element on the boundary of the domain. | |
virtual memory::unique_ptr < gsGeometry< T > > | makeGeometry (gsMatrix< T > coefs) const =0 |
Create a gsGeometry of proper type for this basis with the given coefficient matrix. | |
virtual memory::unique_ptr < gsBasis< T > > | makeNonRational () const |
virtual void | matchWith (const boundaryInterface &bi, const gsBasis< T > &other, gsMatrix< index_t > &bndThis, gsMatrix< index_t > &bndOther, index_t offset=0) const |
Computes the indices of DoFs that match on the interface bi. The interface is assumed to be a common face between this patch and other, with an offset offset. The output is two lists of indices bndThis and bndOther, with indices that match one-to-one on the boundary bi. More... | |
short_t | maxDegree () const |
Returns the polynomial degree. | |
short_t | minDegree () const |
Returns the polynomial degree. | |
virtual index_t | nPieces () const |
Number of pieces in the domain of definition. | |
void | numActive_into (const gsMatrix< T > &u, gsVector< index_t > &result) const |
Returns the number of active (nonzero) basis functions at points u in result. | |
virtual size_t | numElements (boxSide const &s=0) const |
The number of elements on side s. | |
const gsBasis< T > & | piece (const index_t k) const |
Returns the piece(s) of the function(s) at subdomain k. | |
GISMO_MAKE_GEOMETRY_NEW std::ostream & | print (std::ostream &os) const |
Prints the object as a string. | |
virtual void | reduceContinuity (int const &i=1) |
Reduces the continuity of the basis along element boundaries. | |
virtual void | refine (gsMatrix< T > const &boxes, int refExt=0) |
Refine the basis on the area defined by the matrix boxes. More... | |
virtual void | refineElements (std::vector< index_t > const &boxes) |
Refinement function, with different sytax for different basis. More... | |
virtual void | refineElements_withCoefs (gsMatrix< T > &coefs, std::vector< index_t > const &boxes) |
Refine basis and geometry coefficients to levels. More... | |
void | reparameterizeToZeroOne () |
Changes the basis so the curve is defined in the interval [0,1]. | |
virtual void | reverse () |
Reverse the basis. | |
void | setDegree (short_t const &i) |
Set the degree of the basis (either elevate or reduce) in order to have degree equal to i wrt to each variable. | |
void | setDegreePreservingMultiplicity (short_t const &i) |
Set the degree of the basis (either increase or decrecee) in order to have degree equal to i. | |
short_t | size () const |
Returns the number of basis functions in the basis. | |
virtual const gsBasis & | source () const |
virtual gsBasis & | source () |
gsMatrix< T > | support () const |
Returns the boundary basis for side s. More... | |
gsMatrix< T > | support (const index_t &i) const |
Returns a bounding box for the basis' domain. | |
gsMatrix< T > | supportInterval (index_t dir) const |
Returns an interval that contains the parameter values in direction \ dir. More... | |
virtual short_t | targetDim () const |
Dimension of the target space. More... | |
virtual gsBasis::uPtr | tensorize (const gsBasis &other) const |
Return a tensor basis of this and other. | |
virtual short_t | totalDegree () const |
If the basis is of polynomial or piecewise polynomial type, then this function returns the total polynomial degree. | |
virtual void | uniformCoarsen (int numKnots=1) |
Coarsen the basis uniformly by removing groups of numKnots consecutive knots, each knot removed mul times. More... | |
virtual void | uniformCoarsen_withCoefs (gsMatrix< T > &coefs, int numKnots=1) |
Coarsen the basis uniformly. More... | |
virtual void | uniformCoarsen_withTransfer (gsSparseMatrix< T, RowMajor > &transfer, int numKnots=1) |
Coarsen the basis uniformly and produce a sparse matrix which maps coarse coefficient vectors to refined ones. More... | |
virtual void | uniformRefine (int numKnots=1, int mul=1, int dir=-1) |
Refine the basis uniformly by inserting numKnots new knots with multiplicity mul on each knot span. | |
virtual void | uniformRefine_withCoefs (gsMatrix< T > &coefs, int numKnots=1, int mul=1, int dir=-1) |
Refine the basis uniformly. More... | |
virtual void | uniformRefine_withTransfer (gsSparseMatrix< T, RowMajor > &transfer, int numKnots=1, int mul=1) |
Refine the basis uniformly. More... | |
virtual const gsMatrix< T > & | weights () const |
Only for compatibility reasons, with gsRationalBasis. It returns an empty matrix. | |
virtual gsMatrix< T > & | weights () |
Only for compatibility reasons, with gsRationalBasis. It returns an empty matrix. | |
Evaluation functions | |
gsMatrix< T > | evalSingle (index_t i, const gsMatrix< T > &u) const |
Evaluate a single basis function i at points u. | |
gsMatrix< T > | derivSingle (index_t i, const gsMatrix< T > &u) const |
Evaluate a single basis function i derivative at points u. | |
gsMatrix< T > | deriv2Single (index_t i, const gsMatrix< T > &u) const |
Evaluate the second derivative of a single basis function i at points u. | |
gsVector< index_t > | numActive (const gsMatrix< T > &u) const |
Number of active basis functions at an arbitrary parameter value. More... | |
virtual bool | isActive (const index_t i, const gsVector< T > &u) const |
Returns true if there the point u with non-zero value or derivatives when evaluated at the basis function i. | |
virtual void | activeCoefs_into (const gsVector< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const |
Returns the matrix result of active coefficients at points u, each row being one coefficient. The order of the rows is the same as active_into and eval_into functions. More... | |
virtual gsMatrix< T > | laplacian (const gsMatrix< T > &u) const |
Compute the Laplacian of all nonzero basis functions at points u. | |
Static Public Attributes | |
static const short_t | Dim |
Dimension of the parameter domain. | |
Private Member Functions | |
T | _getFactor (int i) const |
Returns the denominator of the ith basis function. | |
void | _getTransformationLagrangeMonomial (gsMatrix< T > &result) const |
void | _getTransformationMonomialBezier (gsMatrix< T > &result) const |
bool | _nextPoint (std::vector< int > &vec, int end) const |
Geometry evaluation functions | |
These functions evaluate not the individual basis functions of the basis, but a geometry object which is represented by a coefficient matrix w.r.t. this basis object. For the format of the coefficient matrix, see gsGeometry. These functions have default implementations which simply compute the basis function values and perform linear combination, but they may be overridden in derived classes if a higher-performance implementation is possible. | |
gsMatrix< T > | evalFunc (const gsMatrix< T > &u, const gsMatrix< T > &coefs) const |
Evaluate the function described by coefs at points u. More... | |
virtual void | evalFunc_into (const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const |
Evaluate the function described by coefs at points u, i.e., evaluates a linear combination of coefs x BasisFunctions, into result. More... | |
gsMatrix< T > | derivFunc (const gsMatrix< T > &u, const gsMatrix< T > &coefs) const |
Evaluate the derivatives of the function described by coefs at points u. More... | |
virtual void | derivFunc_into (const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const |
Evaluate the derivatives of the function described by coefs at points u. More... | |
virtual void | jacobianFunc_into (const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const |
Evaluate the Jacobian of the function described by coefs at points u. Jacobian matrices are stacked in blocks. | |
gsMatrix< T > | deriv2Func (const gsMatrix< T > &u, const gsMatrix< T > &coefs) const |
Evaluates the second derivatives of the function described by coefs at points u. More... | |
virtual void | deriv2Func_into (const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const |
Evaluates the second derivatives of the function described by coefs at points u. More... | |
virtual void | evalAllDersFunc_into (const gsMatrix< T > &u, const gsMatrix< T > &coefs, const unsigned n, std::vector< gsMatrix< T > > &result, bool sameElement=false) const |
Evaluates all derivatives up to order n of the function described by coefs at points u. More... | |
static void | linearCombination_into (const gsMatrix< T > &coefs, const gsMatrix< index_t > &actives, const gsMatrix< T > &values, gsMatrix< T > &result, bool sameElement=false) |
Computes the linear combination coefs * values( actives ) More... | |
|
private |
Stores a Matrix in result, which can be multiplied with the coefficients to get the coefficient of the Monomial representation.
|
private |
Stores a Matrix in result, which can be multiplied with the coefficients to get the coefficient of the Bezier representation from Monomial coefficients.
|
private |
takes a vector and changes it in place so it resembles the next point in the sequence. gives all the possibilities of vec.size() elements out of end. example with vec.size() = 3 and end = 4 (starting at [0,1,2]): [0,1,2] => [0,1,3] => [0,1,4] => [0,2,3] => [0,3,4] => [1,2,3] => [1,2,4] => [1,3,4] => [2,3,4] returns true for new element, or false if the end of sequence is reached.
Returns the indices of active (nonzero) functions at points u, as a list of indices.
|
virtualinherited |
Returns the matrix result of active coefficients at points u, each row being one coefficient. The order of the rows is the same as active_into and eval_into functions.
|
inlineinherited |
Returns the anchor points that represent the members of the basis. There is exactly one anchor point per basis function.
The exact definition of the anchor points depends on the particular basis. For instance, for a Bspline basis these are the Greville abscissae. In general, evaluating a function at the anchor points should provide enough information to interpolate that function using this basis.
Returns the indices of the basis functions that are nonzero at the domain boundary. If an offset is provided (the default is zero), it will return the indizes of the basis functions having this offset to the provided boxSide. Note that the offset cannot be bigger than the size of the basis in the direction orthogonal to boxSide.
Reimplemented in gsHTensorBasis< d, T >, gsMappedSingleBasis< d, T >, gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, gsTensorBasis< 1, T >, gsRationalBasis< SrcT >, gsRationalBasis< gsBSplineTraits< d, T >::Basis >, gsRationalBasis< gsBSplineBasis< T > >, and gsTHBSplineBasis< d, T >.
|
inlineinherited |
Computes the collocation matrix w.r.t. points u.
The collocation matrix is a sparse matrix with u.cols rows and size() columns. The entry (i,j) is the value of basis function j at evaluation point i.
|
virtualinherited |
Returns the basis that corresponds to the component.
b | The component |
indices | The row vector where the indices are stored to |
noBoundary | If true, the transfer matrix does not include parts belonging to lower-order components (i.e., edges without corners or faces without corners and edges) |
|
virtualinherited |
Computes function data.
This function evaluates the functions and their derivatives at the points in and writes them in the corresponding fields of out. Which field to write (and what to compute) is controlled by the out.flags (see also gsFuncData).
The input points in are expected to be compatible with the implementation/representation of the function, i.e. they should be points inside the domain of definitition of the function
[in] | in | |
[out] | out |
Reimplemented in gsGeometry< T >, and gsConstantFunction< T >.
Returns the connectivity structure of the basis The returned mesh has vertices the rows of matrix nodes
Reimplemented in gsHTensorBasis< d, T >, gsRationalBasis< SrcT >, gsTensorBasis< d, T >, gsTensorBasis< 1, T >, gsTensorBSplineBasis< 1, T >, and gsMappedSingleBasis< d, T >.
|
inlinevirtualinherited |
Returns the connectivity structure of the basis The returned mesh has the anchor points as vertices
Evaluate the derivatives,.
Evaluates the second derivatives of active (i.e., non-zero) functions at points u.
See documentation for deriv2_into() (the one without input parameter coefs) for details.
[in] | u | Evaluation points in columns. |
|
inlineinherited |
Evaluates the second derivatives of the function described by coefs at points u.
See documentation for deriv2_into() (the one with input parameter coefs) for details.
[in] | u | Evaluation points in columns. |
[in] | coefs | Coefficient matrix describing the geometry in this basis. |
|
virtualinherited |
Evaluates the second derivatives of the function described by coefs at points u.
...i.e., evaluates a linear combination of coefs * (2nd derivatives of basis functions), into result.
Evaluation points u are given as gsMatrix of size d x N, where
d is the dimension of the parameter domain and
N is the number of evaluation points.
Each column of u corresponds to the coordinates of one evaluation point.
The coefficients coefs are given as gsMatrix of size N x n, where
N is the number of points = number of basis functions and
n is the dimension of the physical domain.
Each row of coefs corresponds to the coordinates of one control point.
Let the function \( f: \mathbb R^3 \to \mathbb R^3\) be given by
\[ f = ( f_1, f_2, f_3)^T = \sum_{i=1}^N c_i B_i(x,y,z), \]
where \( B_i(x,y,z)\) are scalar basis functions and \(c_i\) are the corresponding (m-dimensional) control points. Then, for each column in u, the corresponding column in result represents
\[ ( \partial_{xx}\ f_1, \partial_{yy}\ f_1, \partial_{zz}\ f_1, \partial_{xy}\ f_1, \partial_{xz}\ f_1, \partial_{yz}\ f_1, \partial_{xx}\ f_2, \partial_{yy}\ f_2, \ldots , \partial_{xz}\ f_3, \partial_{yz}\ f_3)^T. \]
at the respective evaluation point.
[in] | u | Evaluation points in columns (see above for format). |
[in] | coefs | Coefficient matrix describing the geometry in this basis. |
[out] | result | For every column of u, a column containing the second derivatives at the respective point in the format described above. |
This function has a default implementation that may be overridden in derived classes for higher performance.
See also deriv2() (the one with input parameter coefs).
|
inlineinherited |
Evaluate the derivatives of the function described by coefs at points u.
u | evaluation points as N column vectors |
coefs | coefficient matrix describing the geometry in this basis, n columns |
|
virtualinherited |
Evaluate the derivatives of the function described by coefs at points u.
Evaluates a linear combination of coefs*BasisFunctionDerivatives, into result.
This function has a default implementation that may be overridden in derived classes for higher performance.
Let the function \(f: \mathbb R^d \to \mathbb R^m \) be described by the coefficients coefs, i.e.,
each evaluation point is in \(\mathbb R^d\), and
each coefficient is a point in \(\mathbb R^m\).
The N evaluation points u are given in a gsMatrix of size d x N. Each column of u represents one evaluation point.
The K coefficients coefs are given as a gsMatrix of size K x m. Each row of coefs represents one coefficient in \(\mathbb R^m\).
The gsMatrix result contains the following data:
For every column of u, the corresponding column in the matrix result contains the gradients of the m components of the function above each other. Hence, the size of result is (d*m) x N.
Example 1:
Let \(f(s,t)\) be a bivariate scalar function, \(f:\mathbb R^2 \to \mathbb R\) (i.e., d=2, m=1), and let the evaluation point \( u_i\) be represented by the i-th column of u.
Then, result has the form
\[ \left( \begin{array}{cccc} \partial_s f(u_1) & \partial_s f(u_2) & \ldots & \partial_t f(u_{N}) \\ \partial_t f(u_1) & \partial_t f(u_2) & \ldots & \partial_t f(u_{N}) \end{array} \right) \]
Example 2:
Let \(f(s,t) = ( f_1(s,t), f_2(s,t), f_3(s,t) )\) represent a surface in space, \(f:\mathbb R^2 \to \mathbb R^3\) (i.e., d=2, m=3), and let the evaluation point \( u_i\) be represented by the i-th column of u.
Then, result has the form
\[ \left( \begin{array}{ccccccc} \partial_s f_1(u_1) & \partial_s f_1(u_2) & \ldots & \partial_s f_1(u_N) \\ \partial_t f_1(u_1) & \partial_t f_1(u_2) & \ldots & \partial_t f_1(u_N) \\ \partial_s f_2(u_1) & \partial_s f_2(u_2) & \ldots & \partial_s f_2(u_N) \\ \partial_t f_2(u_1) & \partial_t f_2(u_2) & \ldots & \partial_t f_2(u_N) \\ \partial_s f_3(u_1) & \partial_s f_3(u_2) & \ldots & \partial_s f_3(u_N) \\ \partial_t f_3(u_1) & \partial_t f_3(u_2) & \ldots & \partial_t f_3(u_N) \\ \end{array} \right) \]
[in] | u | Evaluation points as d x N-matrix. |
[in] | coefs | Coefficient matrix describing the geometry in this basis as K x m-matrix. K should equal the size() of the basis, i.e., the number basis functions. |
[in,out] | result | gsMatrix of size d*m x N, see above for format. |
where
d is the dimension of the parameter domain
m is the dimension of the physical domain
N is the number of evaluation points
K is the number of coefficients
|
inlinevirtual |
Return the gsDomain which represents the parameter domain of this basis. Currently unused.
Reimplemented from gsBasis< T >.
Evaluate the function,.
|
inherited |
Evaluate all derivatives upto order n,.
|
virtualinherited |
Evaluate the nonzero functions and their derivatives up to order n at points u into result.
The derivatives (the 0-th derivative is the function value) are stored in a result. result is a std::vector, where result[i] is a gsMatrix which contains the i-th derivatives.
The entries in result[0], result[1], and result[2] are ordered as in eval_into(), deriv_into(), and deriv2_into(), respectively. For i > 2, the derivatives are stored in lexicographical order, e.g. for order i = 3 and dimension 2 the derivatives are stored as follows: \( \partial_{xxx}, \, \partial_{xxy}, \, \partial_{xyy}, \, \partial_{yyy}.\, \)
[in] | u | Evaluation points, each column corresponds to one evaluation point. |
[in] | n | All derivatives up to order n are computed and stored in result. |
[in,out] | result | See above for format. |
Reimplemented in gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, gsTensorBasis< 1, T >, gsGeometry< T >, gsMappedSingleBasis< d, T >, gsConstantFunction< T >, gsTHBSplineBasis< d, T >, gsMappedSingleSpline< d, T >, and gsSquaredDistance< T >.
|
virtualinherited |
Evaluates all derivatives up to order n of the function described by coefs at points u.
Evaluation points u are given as gsMatrix of size d x N, where
d is the dimension of the parameter domain and
N is the number of evaluation points.
Each column of u corresponds to the coordinates of one evaluation point.
The coefficients coefs are given as gsMatrix of size K x n, where
K is the number of (active) basis functions (=size()) and
n is the dimension of the physical domain.
Each row of coefs corresponds to the coordinates of one control point.
result is a std::vector, where the entry result[i] contains the gsMatrix corresponding to the i-th derivatives. The format of the respective entry is as in
evalFunc_into()
derivFunc_into()
deriv2Func_into()
[in] | u | |
[in] | coefs | |
[in] | n | |
[out] | result |
Evaluate the function described by coefs at points u.
This function has a default implementation that may be overridden in derived classes for higher performance.
u | evaluation points as m column vectors |
coefs | coefficient matrix describing the geometry in this basis, n columns |
|
virtualinherited |
Evaluate the function described by coefs at points u, i.e., evaluates a linear combination of coefs x BasisFunctions, into result.
This function has a default implementation that may be overridden in derived classes for higher performance.
u | evaluation points as N column vectors | |
coefs | coefficient matrix describing the geometry in this basis, n columns | |
[out] | result | a matrix of size n x N with one function value as a column vector per evaluation point |
Reimplemented in gsRationalBasis< SrcT >, gsTensorBSplineBasis< 1, T >, and gsMonomialBasis< T >.
|
inherited |
Returns the i-th basis function as a gsFunction.
Note that the gsBasisFun object only holds a reference to the current basis, so it is invalidated when the basis is destroyed.
|
inline |
Stores a Matrix in result, which can be multiplied with the coefficients to get the coefficient of the Bezier representation.
|
staticinherited |
Computes the linear combination coefs * values( actives )
|
inlinevirtualinherited |
Clone the source of this basis in case of rational basis, same as clone() otherwise
Reimplemented in gsRationalBasis< SrcT >, gsRationalBasis< gsBSplineTraits< d, T >::Basis >, and gsRationalBasis< gsBSplineBasis< T > >.
|
virtualinherited |
Computes the indices of DoFs that match on the interface bi. The interface is assumed to be a common face between this patch and other, with an offset offset. The output is two lists of indices bndThis and bndOther, with indices that match one-to-one on the boundary bi.
NOTE: bndThis will have offset but bndOther will NOT have an offset (hence offset 0)
Reimplemented in gsHTensorBasis< d, T >, gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, gsTensorBasis< 1, T >, and gsRationalBasis< SrcT >.
Number of active basis functions at an arbitrary parameter value.
Usually, this is used for getting the active functions on one element, assuming that this number doesn't change for different parameters inside the element.
|
virtualinherited |
Refine the basis on the area defined by the matrix boxes.
boxes is a d x n-matrix (n even), where d is the dimension of the parameter domain.
n must be even, and every 2 successive columns in the matrix define a box in the parameter domain (the first column represents the coordinates of the lower corner, the second column the coordinates of the upper corner).
Example: The input of the matrix
\[ \left[\begin{array}{cccc} 0 & 0.2 & 0.8 & 1 \\ 0.4 & 0.6 & 0.2 & 0.4 \end{array} \right] \]
results in refinement of the two boxes \([0,0.2]\times[0.4,0.6]\) and \([0.8,1]\times[0.2,0.4]\).
[in] | boxes | gsMatrix of size d x n, see above for description of size and meaning. |
[in] | refExt | Extension to be applied to the refinement boxes |
Reimplemented in gsHTensorBasis< d, T >, gsTensorBSplineBasis< d, T >, and gsTensorBSplineBasis< domainDim+1, T >.
|
virtualinherited |
Refinement function, with different sytax for different basis.
See documentation of
gsTensorBasis::refineElements()
gsHTensorBasis::refineElements()
Reimplemented in gsHTensorBasis< d, T >, gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, gsTensorBasis< 1, T >, gsRationalBasis< SrcT >, gsRationalBasis< gsBSplineTraits< d, T >::Basis >, and gsRationalBasis< gsBSplineBasis< T > >.
|
virtualinherited |
Refine basis and geometry coefficients to levels.
Refines the basis as well as the coefficients. The refinement and the format of the input depend on the implementation of refineElements().
Reimplemented in gsHTensorBasis< d, T >, and gsRationalBasis< SrcT >.
|
inlinevirtualinherited |
Applicable for rational bases: returns the underlying "source" (non-rational) basis
Reimplemented in gsRationalBasis< SrcT >, gsRationalBasis< gsBSplineTraits< d, T >::Basis >, and gsRationalBasis< gsBSplineBasis< T > >.
|
inlinevirtualinherited |
Applicable for rational bases: returns the underlying "source" (non-rational) basis
Reimplemented in gsRationalBasis< SrcT >, gsRationalBasis< gsBSplineTraits< d, T >::Basis >, and gsRationalBasis< gsBSplineBasis< T > >.
|
inlinevirtual |
Returns the boundary basis for side s.
Returns a bounding box for the basis' domain
Reimplemented from gsBasis< T >.
Returns an interval that contains the parameter values in direction \ dir.
Returns a 1x2 matrix, containing the two endpoints of the interval.
|
inlinevirtualinherited |
Dimension of the target space.
Reimplemented in gsPatchIdField< T >, gsGeometry< T >, gsParamField< T >, gsNormalField< T >, gsMultiBasis< T >, gsMultiBasis< real_t >, gsMultiPatch< T >, gsMultiPatch< real_t >, gsFsiLoad< T >, gsMaterialMatrixEvalSingle< T, out >, gsMaterialMatrixIntegrateSingle< T, out >, gsFunctionExpr< T >, gsJacDetField< T >, gsDetFunction< T >, gsConstantFunction< T >, gsShellStressFunction< T >, gsGradientField< T >, gsPiecewiseFunction< T >, gsSquaredDistance< T >, gsAffineFunction< T >, gsPreCICEFunction< T >, gsMappedSingleSpline< d, T >, gsBasisFun< T >, gsAbsError< T >, gsGeometrySlice< T >, gsGeometryTransform< T >, gsFuncCoordinate< T >, and gsCauchyStressFunction< T >.
|
virtualinherited |
Coarsen the basis uniformly by removing groups of numKnots consecutive knots, each knot removed mul times.
This function is the oposite of gsBasis::uniformRefine
The execution of
results in no overall change in "basis". However,
is not guaranteed to keep "basis" unchanged.
Reimplemented in gsHTensorBasis< d, T >, gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, and gsTensorBasis< 1, T >.
|
virtualinherited |
Coarsen the basis uniformly.
The function simultainously updates the vector coefs, representing a function in the bases, such that its new version represents the same function.
This function is equivalent to
Reimplemented in gsHTensorBasis< d, T >.
|
virtualinherited |
Coarsen the basis uniformly and produce a sparse matrix which maps coarse coefficient vectors to refined ones.
The function writes a sparse matrix into the variable transfer that indicates how the functions on the coarse grid are represented as linear combinations as fine grid functions
Reimplemented in gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, and gsTensorBasis< 1, T >.
|
virtualinherited |
Refine the basis uniformly.
The function simultainously updates the vector coefs, representing a function in the bases, such that its new version represents the same function.
This function is equivalent to
Reimplemented in gsHTensorBasis< d, T >, gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, gsTensorBasis< 1, T >, and gsRationalBasis< SrcT >.
|
virtualinherited |
Refine the basis uniformly.
The function writes a sparse matrix into the variable transfer that indicates how the functions on the coarse grid are represented as linear combinations as fine grid functions
Reimplemented in gsTensorBSplineBasis< 1, T >, gsTensorBasis< d, T >, gsTensorBasis< 1, T >, and gsRationalBasis< SrcT >.