26 template <
short_t d,
class T>
28 const gsMatrix<T> & fullCoefs,
29 const gsVector<index_t, d> & sizes,
43 template<
short_t d,
class T>
59 typedef memory::shared_ptr< gsTensorBSpline >
Ptr;
62 typedef memory::unique_ptr< gsTensorBSpline >
uPtr;
77 #if !EIGEN_HAS_RVALUE_REFERENCES
79 { this->swap(other);
return *
this;}
96 typename util::enable_if<d==2,U>::type * = NULL)
99 << d<<
"D tensor B-spline using 2 knot-vectors.");
101 std::vector<Family_t*> cbases;
104 Basis * tbasis = Basis::New(cbases);
107 "Coefficient matrix for the tensor B-spline does not have "
108 "the expected number of control points (rows)." );
129 << d<<
"D tensor B-spline using 3 knot-vectors.");
131 std::vector<Family_t*> cbases;
135 Basis * tbasis = Basis::New(cbases);
138 "Coefficient matrix for the tensor B-spline does not have "
139 "the expected number of control points (rows)." );
154 << d<<
"D tensor B-spline using 4 knot-vectors.");
156 std::vector<Family_t*> cbases;
162 Basis * tbasis = Basis::New(cbases);
165 "Coefficient matrix for the tensor B-spline does not have "
166 "the expected number of control points (rows)." );
174 GISMO_BASIS_ACCESSORS
185 KnotVectorType &
knots(const
int i) {
return this->
basis().knots(i); }
188 const KnotVectorType &
knots(
const int i)
const {
return this->
basis().knots(i); }
193 std::ostream &
print(std::ostream &os)
const;
199 {
return this->
basis().component(i).degree(); }
208 void toggleOrientation();
237 this->
basis().setPeriodic( dir );
277 #ifdef GISMO_WITH_PYBIND11
282 void pybind11_init_gsTensorBSpline2(pybind11::module &m);
283 void pybind11_init_gsTensorBSpline3(pybind11::module &m);
284 void pybind11_init_gsTensorBSpline4(pybind11::module &m);
286 #endif // GISMO_WITH_PYBIND11
290 #ifndef GISMO_BUILD_LIB
291 #include GISMO_HPP_HEADER(gsTensorBSpline.hpp)
KnotVectorType & knots(const int i)
Returns a reference to the knot vector in direction i.
Definition: gsTensorBSpline.h:185
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
gsMatrix< T > m_coefs
Coefficient matrix of size coefsSize() x geoDim()
Definition: gsGeometry.h:624
void reverse(unsigned k)
Definition: gsTensorBSpline.hpp:190
void swapDirections(const unsigned i, const unsigned j)
Swap directions.
Definition: gsTensorBSpline.hpp:201
std::vector< gsGeometry< T > * > uniformSplit(index_t dir=-1) const
Definition: gsTensorBSpline.hpp:386
Traits for BSplineBasis in more dimensions.
Definition: gsBSplineBasis.h:31
short_t degree(const unsigned &i) const
Returns the degree of the basis wrt direction i.
Definition: gsTensorBSpline.h:198
index_t size() const
Returns the number of elements in the basis.
Definition: gsTensorBasis.h:108
gsTensorBSpline()
Default empty constructor.
Definition: gsTensorBSpline.h:73
bool isPatchCorner(gsMatrix< T > const &v, T tol=1e-3) const
Return true if point u is a corner of the patch with tolerance tol.
Definition: gsTensorBSpline.hpp:217
gsBasis< T > * m_basis
Pointer to the basis of this geometry.
Definition: gsGeometry.h:627
void setPeriodic(int dir)
Definition: gsTensorBSpline.h:234
memory::unique_ptr< gsTensorBSpline > uPtr
Unique pointer for gsTensorBSpline.
Definition: gsTensorBSpline.h:62
#define short_t
Definition: gsConfig.h:35
gsBSplineBasis< T > Family_t
Family type.
Definition: gsTensorBSpline.h:56
A tensor product of d B-spline functions, with arbitrary target dimension.
Definition: gsTensorBSpline.h:44
void insertKnot(T knot, int dir, int i=1)
Inserts knot knot at direction dir, i times.
Definition: gsTensorBSpline.hpp:314
void splitAt(index_t dir, T xi, gsTensorBSpline< d, T > &left, gsTensorBSpline< d, T > &right) const
Definition: gsTensorBSpline.hpp:449
gsTensorBSpline(const Basis &basis, gsMatrix< T > coefs)
Construct B-Spline by basis functions and coefficient matrix.
Definition: gsTensorBSpline.h:87
gsGeometry< T >::uPtr localRep(const gsMatrix< T > &u) const
Definition: gsTensorBSpline.hpp:339
S give(S &x)
Definition: gsMemory.h:266
Provides declaration of Geometry abstract interface.
#define index_t
Definition: gsConfig.h:32
A tensor product B-spline basis.
Definition: gsTensorBSplineBasis.h:36
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
A univariate B-spline basis.
Definition: gsBSplineBasis.h:694
std::vector< gsGeometry< T > * > splitAtMult(index_t minMult=1, index_t dir=-1) const
Definition: gsTensorBSpline.hpp:537
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
gsTensorBSpline(KnotVectorType KV1, KnotVectorType KV2, KnotVectorType KV3, gsMatrix< T > tcoefs)
Definition: gsTensorBSpline.h:123
void findCorner(const gsMatrix< T > &v, gsVector< index_t, d > &curr, T tol=1e-3)
returns the tensor-index curr of the corner control point v, or an invalid index if the corner is not...
Definition: gsTensorBSpline.hpp:235
void setFurthestCorner(gsMatrix< T > const &v)
Modifies the parameterization such that the point v is the ending corner of the parametrization of th...
Definition: gsTensorBSpline.hpp:273
void slice(index_t dir_fixed, T par, BoundaryGeometryType &result) const
Definition: gsTensorBSpline.hpp:125
memory::unique_ptr< gsGeometry > uPtr
Unique pointer for gsGeometry.
Definition: gsGeometry.h:100
void degreeElevate(short_t const i=1, short_t const dir=-1)
Elevate the degree by the given amount i for the direction dir. If dir is -1 then degree elevation is...
Definition: gsTensorBSpline.hpp:286
gsTensorBSpline(KnotVectorType KV1, gsKnotVector< U > KV2, gsMatrix< T > tcoefs, typename util::enable_if< d==2, U >::type *=NULL)
Definition: gsTensorBSpline.h:94
Class for representing a knot vector.
Definition: gsKnotVector.h:79
void setOriginCorner(gsMatrix< T > const &v)
Modifies the parameterization such that the point v is the origin of the parametrization of the patch...
Definition: gsTensorBSpline.hpp:261
Struct which represents an interface between two patches.
Definition: gsBoundary.h:649
const KnotVectorType & knots(const int i) const
Returns a reference to the knot vector i.
Definition: gsTensorBSpline.h:188
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
gsTensorBSpline(KnotVectorType KV1, KnotVectorType KV2, KnotVectorType KV3, KnotVectorType KV4, gsMatrix< T > tcoefs)
Definition: gsTensorBSpline.h:147
void constructCoefsForSlice(index_t dir_fixed, const index_t index, const gsMatrix< T > &fullCoefs, const gsVector< index_t, d > &sizes, gsMatrix< T > &result)
Definition: gsTensorBSpline.hpp:32
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsTensorBSpline.hpp:373
memory::shared_ptr< gsTensorBSpline > Ptr
Shared pointer for gsTensorBSpline.
Definition: gsTensorBSpline.h:59
gsBSplineTraits< static_cast< short_t >d-1), T >::Geometry BoundaryGeometryType
Associated Boundary basis type.
Definition: gsTensorBSpline.h:65
gsMatrix< T > & coefs()
Definition: gsGeometry.h:340
Provides declaration of TensorBSplineBasis abstract interface.