45 typedef memory::unique_ptr<gsGeometry<T> > gsGeoPtr;
46 typedef memory::unique_ptr<gsBasis<T> > gsBasisPtr;
59 typedef memory::shared_ptr< gsNurbsBasis > Ptr;
60 typedef memory::unique_ptr< gsNurbsBasis > uPtr;
63 static const int Dim = 1;
91 *this->m_src =
give(bs);
119 std::ostream &
print(std::ostream &os)
const
121 os <<
"NURBS Basis: deg=" << this->
degree()
122 <<
", size=" << this->
size() <<
", knot vector:\n";
123 os << this->knots() <<
", weights: [ ";
124 os << this->
weights().transpose() <<
" ]";
152 {
return this->
source().firstActive(u.value()); };
155 const KnotVectorType & knots()
const {
return this->
source().knots(); }
156 KnotVectorType & knots() {
return this->
source().knots(); }
178 std::vector<T> newKnots;
179 this->knots().getUniformRefinementKnots(numKnots, newKnots,mul);
180 this->
insertKnots( newKnots.begin(), newKnots.end() );
199#ifndef GISMO_BUILD_LIB
200#include GISMO_HPP_HEADER(gsNurbsBasis.hpp)
202#ifdef gsNurbsBasis_EXPORT
203#include GISMO_HPP_HEADER(gsNurbsBasis.hpp)
204#undef EXTERN_CLASS_TEMPLATE
205#define EXTERN_CLASS_TEMPLATE CLASS_TEMPLATE_INST
209EXTERN_CLASS_TEMPLATE gsNurbsBasis<real_t>;
A univariate B-spline basis.
Definition gsBSplineBasis.h:700
virtual gsBasis::uPtr create() const
Create an empty basis of the derived type and return a pointer to it.
Definition gsBasis.hpp:532
Class defining a dummy basis of constant functions. This is used for compatibility reasons.
Definition gsConstantBasis.h:35
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
A univariate NURBS basis.
Definition gsNurbsBasis.h:40
gsNurbsBasis(T u0, T u1, unsigned interior, int degree, unsigned mult_interior=1)
Construct a NURBS basis with unit weights.
Definition gsNurbsBasis.h:73
gsNurbsBasis(gsKnotVector< T > KV, gsMatrix< T > w)
Construct a rational counterpart of B-spline basis given by knots and weights.
Definition gsNurbsBasis.h:100
unsigned firstActive(const T &u) const
Returns the index of the first active (ie. non-zero) basis function at point u.
Definition gsNurbsBasis.h:141
gsNurbsBasis(gsBSplineBasis< T > bs, gsMatrix< T > w)
Construct NURBS basis by a Bspline basis plus weights.
Definition gsNurbsBasis.h:88
void insertKnot(T val, int i=1)
Insert a new knot val with multiplicity i.
Definition gsNurbsBasis.h:159
gsNurbsBasis(gsBSplineBasis< T > *bs, gsMatrix< T > w)
Construct NURBS basis by a Bspline basis pointer (consumed) plus weights.
Definition gsNurbsBasis.h:84
gsNurbsBasis(gsKnotVector< T > KV)
Construct NURBS basis of a knot vector.
Definition gsNurbsBasis.h:95
void insertKnots(It begin, It end)
Insert the new knots given by the range [begin..end).
Definition gsNurbsBasis.h:167
gsNurbs< T > GeometryType
Associated geometry type.
Definition gsNurbsBasis.h:52
void uniform_k_refine(int const &i=1)
Apply k-refinement to the basis i times.
Definition gsNurbsBasis.h:184
gsConstantBasis< T > BoundaryBasisType
Associated Boundary basis type.
Definition gsNurbsBasis.h:57
index_t numActive() const
Number of active basis functions at an arbitrary parameter value.
Definition gsNurbsBasis.h:147
gsNurbsBasis(const gsNurbsBasis &o)
Copy Constructor.
Definition gsNurbsBasis.h:104
T domainEnd() const
Returns the starting value of the domain of the basis.
Definition gsNurbsBasis.h:138
gsGeoPtr makeGeometry(gsMatrix< T >coefs) const
Clone function. Used to make a copy of a derived basis.
Definition gsNurbsBasis.hpp:29
gsBSplineBasis< T > Family_t
The family type.
Definition gsNurbsBasis.h:49
index_t firstActive(const gsMatrix< T, 1 > &u) const
Definition gsNurbsBasis.h:151
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition gsNurbsBasis.h:119
gsNurbsBasis()
Default empty constructor.
Definition gsNurbsBasis.h:81
static const int Dim
Dimension of the parameter domain.
Definition gsNurbsBasis.h:63
T domainStart() const
Returns the starting value of the domain of the basis.
Definition gsNurbsBasis.h:135
void uniformRefine(int numKnots=1, int mul=1, int dir=-1)
Refine the basis uniformly by inserting numKnots new knots per knot span.
Definition gsNurbsBasis.h:173
A NURBS function of one argument, with arbitrary target dimension.
Definition gsNurbs.h:40
Class that creates a rational counterpart for a given basis.
Definition gsRationalBasis.h:48
index_t size() const
Definition gsRationalBasis.h:137
const gsMatrix< T > & weights() const
Returns the weights of the rational basis.
Definition gsRationalBasis.h:300
short_t degree(short_t i=0) const
Definition gsRationalBasis.h:165
const gsBSplineBasis< T > & source() const
Returns the source basis of the rational basis.
Definition gsRationalBasis.h:293
Provides declaration of BSplineBasis class.
Boehm's algorithm for knot insertion.
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
Provides forward declarations of types and structs.
Provides declaration of RationalBasis class.
The G+Smo namespace, containing all definitions for the library.
void gsBoehm(KnotVectorType &knots, Mat &coefs, T val, int r=1, bool update_knots=true)
Performs insertion of multiple knot on "knots" and coefficients "coefs".
Definition gsBoehm.hpp:29
S give(S &x)
Definition gsMemory.h:266
void gsBoehmRefine(KnotVectorType &knots, Mat &coefs, int p, ValIt valBegin, ValIt valEnd, bool update_knots=true)
Definition gsBoehm.hpp:163