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"
Class representing a domain. i.e. a collection of elements (triangles, rectangles, cubes, simplices.
Definition: gsDomain.h:31
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
gsMatrix< T > support(const index_t &i) const
Returns a bounding box for the basis' domain.
Definition: gsLagrangeBasis.h:158
T get_m_end() const
Returns the end of the parameter interval.
Definition: gsLagrangeBasis.h:337
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
gsBasis< T >::uPtr boundaryBasis(boxSide const &s)
Returns the boundary basis for side s.
gsLagrangePoly< T > GeometryType
Associated geometry type.
Definition: gsLagrangeBasis.h:54
T Scalar_t
Coefficient type.
Definition: gsLagrangeBasis.h:51
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
const std::vector< T > * get_m_breaks() const
Returns the breaks vector of this basis.
Definition: gsLagrangeBasis.h:325
void getTransformationLagrangeBezier(gsMatrix< T > &result) const
Definition: gsLagrangeBasis.h:283
static const short_t Dim
Dimension of the parameter domain.
Definition: gsLagrangeBasis.h:60
#define short_t
Definition: gsConfig.h:35
Provides structs and classes related to interfaces and boundaries.
gsMatrix< index_t > boundary() const
Returns the indices of the basis functions that touch the domain boundary.
Definition: gsLagrangeBasis.h:132
void _getTransformationLagrangeMonomial(gsMatrix< T > &result) const
Definition: gsLagrangeBasis.hpp:193
std::string detail() const
Prints the object as a string with extended details.
Definition: gsLagrangeBasis.h:226
short_t get_m_p() const
Returns the degree of this basis.
Definition: gsLagrangeBasis.h:319
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
short_t degree() const
Returns the polynomial degree.
Definition: gsLagrangeBasis.h:268
side
Identifiers for topological sides.
Definition: gsBoundary.h:58
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
Provides declaration of Basis abstract interface.
bool _nextPoint(std::vector< int > &vec, int end) const
Definition: gsLagrangeBasis.hpp:254
memory::shared_ptr< gsLagrangeBasis > Ptr
Shared pointer for gsLagrangeBasis.
Definition: gsLagrangeBasis.h:63
#define index_t
Definition: gsConfig.h:32
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the non-zero basis functions at value u.
Definition: gsLagrangeBasis.hpp:50
memory::unique_ptr< gsLagrangeBasis > uPtr
Unique pointer for gsLagrangeBasis.
Definition: gsLagrangeBasis.h:66
Provides combinatorial unitilies.
GISMO_MAKE_GEOMETRY_NEW std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsLagrangeBasis.h:213
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.
Definition: gsLagrangeBasis.hpp:20
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
T get_m_start() const
Returns the start of the parameter interval.
Definition: gsLagrangeBasis.h:331
The geometry class of a Lagrange Polyomial curve.
Definition: gsLagrangeBasis.h:17
gsLagrangeBasis< T > & component(index_t i) const
Returns the same basis for i=0, error otherwise.
Definition: gsLagrangeBasis.h:242
short_t domainDim() const
Returns the dimension d of the parameter space.
Definition: gsLagrangeBasis.h:106
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
short_t minDegree() const
Returns the polynomial degree.
Definition: gsLagrangeBasis.h:262
gsDomain< T > * domain() const
Definition: gsLagrangeBasis.h:252
void anchors_into(gsMatrix< T > &result) const
Returns the anchors (greville points) of the basis.
Definition: gsLagrangeBasis.hpp:8
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
Provides forward declarations of types and structs.
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
gsMatrix< T > supportInterval(index_t dir) const
Returns an interval that contains the parameter values in direction \ dir.
Definition: gsLagrangeBasis.hpp:33
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
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
gsLagrangeBasis()
Default empty constructor.
Definition: gsLagrangeBasis.h:74
short_t maxDegree() const
Returns the polynomial degree.
Definition: gsLagrangeBasis.h:256
bool check() const
Check the LagrangeBasis for consistency.
Definition: gsLagrangeBasis.h:293
void anchor_into(index_t i, gsMatrix< T > &result) const
Returns the anchor point for member i of the basis.
Definition: gsLagrangeBasis.h:112
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
#define GISMO_ERROR(message)
Definition: gsDebug.h:118
T _getFactor(int i) const
Returns the denominator of the ith basis function.
Definition: gsLagrangeBasis.h:361
short_t size() const
Returns the number of basis functions in the basis.
Definition: gsLagrangeBasis.h:239
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< T > BoundaryBasisType
Associated Boundary basis type.
Definition: gsLagrangeBasis.h:57
void _getTransformationMonomialBezier(gsMatrix< T > &result) const
Definition: gsLagrangeBasis.hpp:236
A univariate Lagrange basis.
Definition: gsLagrangeBasis.h:16
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 reparameterizeToZeroOne()
Changes the basis so the curve is defined in the interval [0,1].
Definition: gsLagrangeBasis.hpp:181
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
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 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
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
gsMatrix< T > support() const
Returns the boundary basis for side s.
Definition: gsLagrangeBasis.h:149