16template<
class T>
class gsLagrangeBasis;
17template <
class T>
class gsLagrangePoly;
29struct gsTraits<gsLagrangeBasis<T>,1>
31typedef gsLagrangeBasis<T> TensorBasisType;
32typedef gsLagrange<T> TensorGeometryType;
33typedef gsLagrange<T> TensorBoundaryType;
63 typedef memory::shared_ptr< gsLagrangeBasis >
Ptr;
66 typedef memory::unique_ptr< gsLagrangeBasis >
uPtr;
78 m_p(pars.
size()-1), m_breaks(pars), m_start(start), m_end(end)
85 m_p(amount_of_inner_breaks+1), m_start(start), m_end(end)
87 m_breaks.push_back(start);
88 for(
int i =0;i<amount_of_inner_breaks;i++)
91 start+( (i+1) * (end-start) / (amount_of_inner_breaks+1) ) );
93 m_breaks.push_back(end);
115 result(0,0)=m_breaks[i];
124 result.resize(1,u.cols());
125 for(
short_t i = 0; i<u.cols();++i)
152 *res << m_start , m_end ;
210 GISMO_MAKE_GEOMETRY_NEW
213 std::ostream &
print(std::ostream &os)
const
215 os <<
"Lagrange Basis: deg=" << this->
degree()
216 <<
", size="<< this->
size()
217 <<
", parameters= [";
218 for (
unsigned i = 0; i<m_breaks.size(); ++i )
219 os << m_breaks[i] <<
" ";
220 os <<
"], interval= [" << m_start <<
"," << m_end <<
"].\n";
229 std::ostringstream os;
247 throw std::runtime_error(
"gsLagrangeBasis has only one component");
289 result=M_to_B*L_to_M;
295 bool consistent =
true;
297 for(
unsigned i=0;i<m_breaks.size()-1;i++)
298 if(m_breaks[i]>=m_breaks[i+1])
300 GISMO_ERROR(
"gsLagrangeBasis Error: not strictly monoton increasing");
307 GISMO_ERROR(
"gsLagrangeBasis Error: interval = 0");
358 bool _nextPoint(std::vector<int> & vec,
int end)
const;
366 prod*=(m_breaks[i]-m_breaks[j]);
376 std::vector<T> m_breaks;
393#include "gsLagrangeBasis.hpp"
Struct which represents a certain side of a box.
Definition gsBoundary.h:85
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
gsBasis< T >::uPtr boundaryBasis(boxSide const &s)
Returns the boundary basis for side s.
Class representing a domain. i.e. a collection of elements (triangles, rectangles,...
Definition gsDomain.h:32
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
A univariate Lagrange basis.
Definition gsLagrangeBasis.h:46
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.
Definition gsLagrangeBasis.hpp:80
gsLagrangeBasis(const T &start, const T &end, int amount_of_inner_breaks)
Construct Lagrange basis with equidistant breaks in the Interval [start,end].
Definition gsLagrangeBasis.h:84
void anchors_into(gsMatrix< T > &result) const
Returns the anchors (greville points) of the basis.
Definition gsLagrangeBasis.hpp:8
short_t maxDegree() const
Returns the polynomial degree.
Definition gsLagrangeBasis.h:256
gsLagrangeBasis()
Default empty constructor.
Definition gsLagrangeBasis.h:74
GISMO_MAKE_GEOMETRY_NEW std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsLagrangeBasis.h:213
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.
Definition gsLagrangeBasis.hpp:113
void getTransformationLagrangeBezier(gsMatrix< T > &result) const
Definition gsLagrangeBasis.h:283
gsLagrangePoly< T > GeometryType
Associated geometry type.
Definition gsLagrangeBasis.h:54
gsLagrangeBasis(const std::vector< T > &pars, const T &start, const T &end)
Construct Lagrange basis along the parameter pars and Interval [start,end].
Definition gsLagrangeBasis.h:77
memory::unique_ptr< gsLagrangeBasis > uPtr
Unique pointer for gsLagrangeBasis.
Definition gsLagrangeBasis.h:66
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.
Definition gsLagrangeBasis.h:122
void evalSingle_into(index_t i, const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates i-th basis functions at value u.
Definition gsLagrangeBasis.h:172
void reparameterizeToZeroOne()
Changes the basis so the curve is defined in the interval [0,1].
Definition gsLagrangeBasis.hpp:181
void _getTransformationLagrangeMonomial(gsMatrix< T > &result) const
Definition gsLagrangeBasis.hpp:193
const std::vector< T > * get_m_breaks() const
Returns the breaks vector of this basis.
Definition gsLagrangeBasis.h:325
memory::shared_ptr< gsLagrangeBasis > Ptr
Shared pointer for gsLagrangeBasis.
Definition gsLagrangeBasis.h:63
gsLagrangeBasis< T > BoundaryBasisType
Associated Boundary basis type.
Definition gsLagrangeBasis.h:57
T Scalar_t
Coefficient type.
Definition gsLagrangeBasis.h:51
bool check() const
Check the LagrangeBasis for consistency.
Definition gsLagrangeBasis.h:293
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the non-zero basis functions at value u.
Definition gsLagrangeBasis.hpp:50
gsLagrangeBasis< T > & component(index_t i) const
Returns the same basis for i=0, error otherwise.
Definition gsLagrangeBasis.h:242
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...
Definition gsLagrangeBasis.h:275
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,...
Definition gsLagrangeBasis.hpp:20
std::string detail() const
Prints the object as a string with extended details.
Definition gsLagrangeBasis.h:226
T _getFactor(int i) const
Returns the denominator of the ith basis function.
Definition gsLagrangeBasis.h:361
static const short_t Dim
Dimension of the parameter domain.
Definition gsLagrangeBasis.h:60
T get_m_start() const
Returns the start of the parameter interval.
Definition gsLagrangeBasis.h:331
short_t domainDim() const
Returns the dimension d of the parameter space.
Definition gsLagrangeBasis.h:106
bool _nextPoint(std::vector< int > &vec, int end) const
Definition gsLagrangeBasis.hpp:254
gsMatrix< index_t > boundary(boundary::side const &s) const
Returns the indices of the basis functions that touch the domain boundary.
Definition gsLagrangeBasis.h:143
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.
Definition gsLagrangeBasis.hpp:95
void anchor_into(index_t i, gsMatrix< T > &result) const
Returns the anchor point for member i of the basis.
Definition gsLagrangeBasis.h:112
gsMatrix< T > support(const index_t &i) const
Returns a bounding box for the basis' domain.
Definition gsLagrangeBasis.h:158
short_t size() const
Returns the number of basis functions in the basis.
Definition gsLagrangeBasis.h:239
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.
Definition gsLagrangeBasis.hpp:65
gsMatrix< T > supportInterval(index_t dir) const
Returns an interval that contains the parameter values in direction \ dir.
Definition gsLagrangeBasis.hpp:33
gsMatrix< T > support() const
Returns the boundary basis for side s.
Definition gsLagrangeBasis.h:149
gsDomain< T > * domain() const
Definition gsLagrangeBasis.h:252
T get_m_end() const
Returns the end of the parameter interval.
Definition gsLagrangeBasis.h:337
gsMatrix< index_t > boundary() const
Returns the indices of the basis functions that touch the domain boundary.
Definition gsLagrangeBasis.h:132
short_t minDegree() const
Returns the polynomial degree.
Definition gsLagrangeBasis.h:262
void _getTransformationMonomialBezier(gsMatrix< T > &result) const
Definition gsLagrangeBasis.hpp:236
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.
Definition gsLagrangeBasis.h:191
short_t get_m_p() const
Returns the degree of this basis.
Definition gsLagrangeBasis.h:319
short_t degree() const
Returns the polynomial degree.
Definition gsLagrangeBasis.h:268
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.
Definition gsLagrangeBasis.hpp:127
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.
Definition gsLagrangeBasis.h:181
The geometry class of a Lagrange Polyomial curve.
Definition gsLagrangePoly.h:27
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
Provides declaration of Basis abstract interface.
Provides structs and classes related to interfaces and boundaries.
Provides combinatorial unitilies.
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ERROR(message)
Definition gsDebug.h:118
Provides forward declarations of types and structs.
The G+Smo namespace, containing all definitions for the library.
side
Identifiers for topological sides.
Definition gsBoundary.h:58