G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsMPBESHSplineBasis.h
Go to the documentation of this file.
1
14#pragma once
15
19
20namespace gismo
21{
22
31template<short_t d, class T>
33{
34public:
36 typedef memory::shared_ptr< gsMPBESHSplineBasis > Ptr;
37
39 typedef memory::unique_ptr< gsMPBESHSplineBasis > uPtr;
40
42 static const index_t Dim = d;
43
44 typedef index_t indexType;
45 typedef gsMPBESBasis<d,T> Base;
47 typedef typename std::vector<BasisType *> BasisContainer;
48 typedef typename std::vector<gsBasis<T>* >::const_iterator ConstBasisIter;
49
50protected:
51 using Base::m_bases;
52 using Base::m_topol;
54 using Base::m_mapper;
55 using Base::m_vertices;
57 using Base::m_minDist;
58public:
59 using Base::nPatches;
61 using Base::degree;
63 using Base::maxDegree;
64protected:
65 using Base::_getPatch;
66 using Base::_getPatchIndex;
69
70//TODO: gsCompactKnotVector to gsKnotVector,
71// shift knots by constant
72// read in of thb multipatch
73// compute topology of thb multipatch
74
75public:
79
80 gsMPBESHSplineBasis (std::vector<BasisType *> const & bases, gsBoxTopology const & topol,
81 index_t increaseSmoothnessLevel=-1, index_t minEVDistance=-1);
82
83 gsMPBESHSplineBasis (std::vector<BasisType *> const & bases, gsBoxTopology const & topol,
84 std::vector<gsMatrix<T> * > & coefs,index_t increaseSmoothnessLevel=-1, index_t minEVDistance=-1);
85
86 gsMPBESHSplineBasis (BasisType const & base, gsBoxTopology const & topol);
87
88 gsMPBESHSplineBasis( gsMultiPatch<T> const & mp, index_t increaseSmoothnessLevel = -1,
89 index_t minEVDistance=-1);
90
91 gsMPBESHSplineBasis( gsMultiBasis<T> const & mb,gsBoxTopology const & topol, index_t increaseSmoothnessLevel = -1,
92 index_t minEVDistance=-1);
93
95
96 gsMPBESHSplineBasis<d,T>& operator=( const gsMPBESHSplineBasis& other );
97
99 {
100
101 } //destructor
102
103private:
105 // functions for initializing and updating
107
109 { return true; }
110
111protected:
112 void _setMapping();
113
114
115public:
117 // general functions for interacting with this class
119
121 GISMO_CLONE_FUNCTION(gsMPBESHSplineBasis)
122
123 gsHTensorBasis<d,T> & basis(size_t i)
124 { return static_cast<gsHTensorBasis<d,T>&>(*m_bases[i]); }
125
126 const gsHTensorBasis<d,T> & basis(size_t i) const
127 { return static_cast<const gsHTensorBasis<d,T>&>(*m_bases[i]); }
128
129 unsigned basisFunctionsOnSide(const patchSide& ps) const;
130
131 virtual bool isLocallyConnected(indexType i,indexType j) const;
132
133public:
135 // functions for evaluating and derivatives
137
139 void numActive_into(const index_t patch,const gsMatrix<T> & u, gsVector<index_t>& result) const
140 {
141 GISMO_UNUSED(patch); GISMO_UNUSED(u); GISMO_UNUSED(result);
143 }
144
145public:
147 // functions for refinement
149
150 void refine(const index_t patch, gsMatrix<T> const & boxes, bool updateBasis = true);
151
152 void refineElements(const index_t patch, std::vector<index_t> const & boxes, bool updateBasis = true);
153
154 void refine_withCoefs(gsMatrix<T>& localCoef, const index_t patch, gsMatrix<T> const & boxes, bool updateBasis = true);
155
156 void refineElements_withCoefs(gsMatrix<T>& localCoef, const index_t patch, std::vector<index_t> const & boxes, bool updateBasis = true);
157
162 virtual void refineWithExtension(const index_t patch,gsMatrix<T> const & boxes, index_t refExt = 0,bool updateBasis = true);
163
164//private:
166 // private helper functions for the refinement
168
169 void repairPatches(std::vector<gsMatrix<T> *> & coefs, index_t startFromPatch = -1);
170
171 bool _innerBoxesAreSuitable(const index_t patch,
172 std::vector<index_t>& boxes);
173
174 bool _boxesMatchNeighbours(const index_t patch,
175 std::vector<index_t>& boxes, std::vector<index_t>& checkPatches);
176
177 void _addBoundaryBox(const index_t patch,const boxSide s,const index_t start, const index_t end,const unsigned level, std::vector<index_t> & boxes, std::vector<bool> & sideToCheck);
178
179 void _addFunBox(const index_t patch,const unsigned uMin,const unsigned vMin,const unsigned uMax,const unsigned vMax,const unsigned level, std::vector<index_t> & boxes);
180
181 void _addBox(const index_t patch,const unsigned uMin,const unsigned vMin,const unsigned uMax,const unsigned vMax,const unsigned level, std::vector<index_t> & boxes);
182
183protected:
185 // functions going back and forth between absolute val and parametric value for C^0 parts
187
188 void _endpointsOfActiveBoundaryFunctions(patchSide const & ps,bool orient,std::vector<T>& endpoints) const;
189
190 T findParameter(patchSide const & ps,patchCorner const & pc,unsigned nrBasisFuncs) const;
191
192}; // class gsMPBESHSplineBasis
193
194}
Struct which represents a certain side of a box.
Definition gsBoundary.h:85
Defines a topological arrangement of a collection of "boxes" (e.g., parameter domains that map to phy...
Definition gsBoxTopology.h:39
Class representing a (scalar) hierarchical tensor basis of functions .
Definition gsHTensorBasis.h:75
Purely abstract class gsMappedBasis, which gives means of combining basis functions to new,...
Definition gsMPBESBasis.h:47
void updateTopol()
updates the mapping of this basis (f.e. after a knot insertion)
Definition gsMPBESBasis.h:101
unsigned m_minDist
minimal C^0 distance from special (extraordinary) vertices, specified in basisfunctions
Definition gsMPBESBasis.h:377
virtual void repairPatches(std::vector< gsMatrix< T > * > &coefs, index_t startFromPatch=-1)=0
void _setDistanceOfAllVertices()
initializes the m_distances field
Definition gsMPBESBasis.hpp:313
void _initVertices()
initializes the m_vertices field
Definition gsMPBESBasis.hpp:298
std::vector< distances > m_distances
vector of distances objects, that store C^0 distances from special vertices on the edges
Definition gsMPBESBasis.h:383
std::vector< std::pair< patchCorner, bool > > m_vertices
vector storing all the inner vertices, with a flag if it is an Extraordinary vertex or an ordinary ve...
Definition gsMPBESBasis.h:381
short_t m_incrSmoothnessDegree
smoothness degree that is tried to achive over patch interfaces
Definition gsMPBESBasis.h:375
A univariate Lagrange basis.
Definition gsMPBESHSplineBasis.h:33
void numActive_into(const index_t patch, const gsMatrix< T > &u, gsVector< index_t > &result) const
Returns the number of active (nonzero) basis functions at points u in result.
Definition gsMPBESHSplineBasis.h:139
virtual void refineWithExtension(const index_t patch, gsMatrix< T > const &boxes, index_t refExt=0, bool updateBasis=true)
Refine the are defined by boxes on patch k with extension refExt.
Definition gsMPBESHSplineBasis.hpp:317
void refine(const index_t patch, gsMatrix< T > const &boxes, bool updateBasis=true)
Definition gsMPBESHSplineBasis.hpp:217
memory::shared_ptr< gsMPBESHSplineBasis > Ptr
Shared pointer for gsMPBESHSplineBasis.
Definition gsMPBESHSplineBasis.h:36
unsigned basisFunctionsOnSide(const patchSide &ps) const
Returns the amount of basis functions on a given side of a given patch.
Definition gsMPBESHSplineBasis.hpp:180
bool _checkTopologyWithBases() const
Checks the gsMappedBasis for consistency.
Definition gsMPBESHSplineBasis.h:108
void refineElements_withCoefs(gsMatrix< T > &localCoef, const index_t patch, std::vector< index_t > const &boxes, bool updateBasis=true)
Definition gsMPBESHSplineBasis.hpp:282
memory::unique_ptr< gsMPBESHSplineBasis > uPtr
Unique pointer for gsMPBESHSplineBasis.
Definition gsMPBESHSplineBasis.h:39
void _setMapping()
create a new mapping of the local basisfunctions
Definition gsMPBESHSplineBasis.hpp:170
gsMPBESHSplineBasis()
Default empty constructor.
Definition gsMPBESHSplineBasis.h:77
void refineElements(const index_t patch, std::vector< index_t > const &boxes, bool updateBasis=true)
Definition gsMPBESHSplineBasis.hpp:231
gsHTensorBasis< d, T > & basis(size_t i)
Clone function. Used to make a copy of a derived basis.
Definition gsMPBESHSplineBasis.h:123
T findParameter(patchSide const &ps, patchCorner const &pc, unsigned nrBasisFuncs) const
Definition gsMPBESHSplineBasis.hpp:586
void refine_withCoefs(gsMatrix< T > &localCoef, const index_t patch, gsMatrix< T > const &boxes, bool updateBasis=true)
Definition gsMPBESHSplineBasis.hpp:245
void repairPatches(std::vector< gsMatrix< T > * > &coefs, index_t startFromPatch=-1)
Definition gsMPBESHSplineBasis.hpp:331
static const index_t Dim
Dimension of the parameter domain.
Definition gsMPBESHSplineBasis.h:42
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
Provides definition of HTensorBasis abstract interface.
Provides declaration of Basis abstract interface.
Provides declaration of Basis abstract interface.
The G+Smo namespace, containing all definitions for the library.
Struct which represents a certain corner of a patch.
Definition gsBoundary.h:393
Struct which represents a certain side of a patch.
Definition gsBoundary.h:232