G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsTHBSpline.h
Go to the documentation of this file.
1
14#pragma once
15
19
20namespace gismo
21{
22
36template<short_t d, class T>
37class gsTHBSpline : public gsGeoTraits<d,T>::GeometryBase
38{
39public:
41
42 typedef typename Basis::tensorBasis tensorBasis;
43
44 typedef typename gsGeoTraits<d,T>::GeometryBase Base;
45
47 typedef memory::shared_ptr< gsTHBSpline > Ptr;
48
50 typedef memory::unique_ptr< gsTHBSpline > uPtr;
51
52 typedef typename
53 util::conditional<d==1, gsConstantFunction<T>, gsTHBSpline<static_cast<short_t>(d-1),T>
54 >::type BoundaryGeometryType;
55
56 typedef typename gsTHBSplineBasis<d,T>::BoundaryBasisType BoundaryBasisType;
57
58public:
59
62
64 gsTHBSpline( const Basis & basis, const gsMatrix<T> & coefs ) :
65 Base( basis, coefs )
66 { }
67
70 Base( basis, coefs )
71 { }
72
74 explicit gsTHBSpline( const gsTensorBSpline<d,T> & tbsp )
75 {
76 this->m_basis = new Basis( tbsp.basis() );
77 this->m_coefs = tbsp.coefs();
78 }
79
80 GISMO_CLONE_FUNCTION(gsTHBSpline)
81
82 GISMO_BASIS_ACCESSORS
83
84public:
85
86
87// ************************************************
88// Other member functions
89// ************************************************
90public:
98 //\param[out] bpatches list of B-spline patches associated with the boxes
99 //void getBsplinePatches(gsMatrix<index_t>& b1, gsMatrix<index_t>& b2, gsVector<index_t>& level, std::vector< gsTensorBSpline<2> > & bpatches) const;
100
102// void convertToBSpline( gsTensorBSpline<d,T,gsCompactKnotVector<T> >& result );
103
106
108 void increaseMultiplicity(index_t lvl, int dir, T knotValue, int mult = 1);
109
110
111private:
112
116 void globalRefinement(int level)const;
117
119 void initialize_cmatrix(int col, int c_level) const;
120
122 void return_cp_1D(const gsMatrix<T> & mat, int direction, gsMatrix<T>& cp)const;
123
124public:
125
129 void slice(index_t dir_fixed,T par,BoundaryGeometryType & result) const;
130
131}; // class gsTHBSpline
132
133#ifdef GISMO_WITH_PYBIND11
134
138 void pybind11_init_gsTHBSpline2(pybind11::module &m);
139 void pybind11_init_gsTHBSpline3(pybind11::module &m);
140 void pybind11_init_gsTHBSpline4(pybind11::module &m);
141
142#endif // GISMO_WITH_PYBIND11
143
144} // namespace gismo
145
146
147#ifndef GISMO_BUILD_LIB
148#include GISMO_HPP_HEADER(gsTHBSpline.hpp)
149#endif
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
gsMatrix< T > & coefs()
Definition gsGeometry.h:340
virtual const gsBasis< T > & basis() const =0
Returns a const reference to the basis of the geometry.
gsBasis< T > * m_basis
Pointer to the basis of this geometry.
Definition gsGeometry.h:632
gsMatrix< T > m_coefs
Coefficient matrix of size coefsSize() x geoDim()
Definition gsGeometry.h:629
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Truncated hierarchical B-spline basis.
Definition gsTHBSplineBasis.h:36
util::conditional< d==1, gsConstantBasis< T >, gsTHBSplineBasis< static_cast< short_t >(d-1), T > >::type BoundaryBasisType
Associated Boundary basis type.
Definition gsTHBSplineBasis.h:57
A truncated hierarchical B-Spline function, in d dimensions.
Definition gsTHBSpline.h:38
void initialize_cmatrix(int col, int c_level) const
initialization of cmatrix
gsTHBSpline(const Basis &basis, const gsMatrix< T > &coefs)
Construct THB-Spline by basis functions and coefficient matrix.
Definition gsTHBSpline.h:64
memory::unique_ptr< gsTHBSpline > uPtr
Unique pointer for gsTHBSpline.
Definition gsTHBSpline.h:50
void return_cp_1D(const gsMatrix< T > &mat, int direction, gsMatrix< T > &cp) const
convert the coefficient matrix mat in the given direction to a column of the control points matrix
void convertToBSpline(gsTensorBSpline< d, T > &result)
Refines the whole domain to the finest level present in the mesh. Returns the refined geometry as res...
Definition gsTHBSpline.hpp:29
void getBsplinePatchGlobal(gsVector< index_t > b1, gsVector< index_t > b2, unsigned l, gsTensorBSpline< 2 > geo) const
get B-spline control points on a given box of a certain level by refining eveywhere
void getBsplinePatches(gsMatrix< index_t > &b1, gsMatrix< index_t > &b2, gsVector< index_t > &level) const
Return the list of B-spline patches to represent a THB-spline geometry.
Definition gsTHBSpline.hpp:83
memory::shared_ptr< gsTHBSpline > Ptr
Shared pointer for gsTHBSpline.
Definition gsTHBSpline.h:47
gsTHBSpline(const Basis &basis, gsMatrix< T > &coefs)
Construct THB-Spline by basis functions and coefficient matrix.
Definition gsTHBSpline.h:69
void increaseMultiplicity(index_t lvl, int dir, T knotValue, int mult=1)
Increase multiplicity of knot-value knotValue in level lvl and direction dir by mult.
Definition gsTHBSpline.hpp:57
gsTHBSpline()
Default empty constructor.
Definition gsTHBSpline.h:61
gsTHBSpline(const gsTensorBSpline< d, T > &tbsp)
Construct B-Spline from a Tensor B-Spline.
Definition gsTHBSpline.h:74
void slice(index_t dir_fixed, T par, BoundaryGeometryType &result) const
Definition gsTHBSpline.hpp:338
void globalRefinement(int level) const
function for getBsplinePatchGlobal
A tensor product B-spline basis.
Definition gsTensorBSplineBasis.h:37
A tensor product of d B-spline functions, with arbitrary target dimension.
Definition gsTensorBSpline.h:45
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define index_t
Definition gsConfig.h:32
Provides forward declarations of types and structs.
This is the main header file that collects wrappers of Eigen for linear algebra.
Provides declaration of THBSplineBasis class.
The G+Smo namespace, containing all definitions for the library.
GISMO_DEPRECATED index_t direction(index_t s)
Returns the parametric direction that corresponds to side s.
Definition gsBoundary.h:1048