G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsMultiBasis.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <gsCore/gsGeometry.h>
17 #include <gsCore/gsBasis.h>
18 #include <gsCore/gsDofMapper.h>
19 #include <gsCore/gsBoxTopology.h>
22 
23 
24 namespace gismo
25 {
26 
35 template<class T>
36 class gsMultiBasis : public gsFunctionSet<T>
37 {
38 public:
39  typedef gsFunctionSet<T> Base;
40 
41  typedef memory::shared_ptr<gsMultiBasis> Ptr;
42  typedef memory::unique_ptr<gsMultiBasis> uPtr;
43 
44  typedef std::vector<gsBasis<T> *> BasisContainer;
45 
46 public:
47 
49  typedef typename BasisContainer::iterator iterator;
50  typedef typename BasisContainer::const_iterator const_iterator;
51 
52  typedef gsBasis<T> & reference;
53  typedef const gsBasis<T> & const_reference;
54 
55 public:
56 
59 
69  explicit gsMultiBasis( const gsMultiPatch<T> & mpatch,
70  bool numeratorOnly = false);
71 
73  gsMultiBasis(BasisContainer& bases, const gsBoxTopology & topology)
74  : m_topology( topology )
75  {
76  m_bases.swap(bases);// consumes the pointers
77  }
78 
80  gsMultiBasis( const gsBasis<T> & geo, bool numeratorOnly = false);
81 
83  gsMultiBasis( BasisContainer & bases,
84  const std::vector<patchSide>& boundary,
85  const std::vector<boundaryInterface>& interfaces )
86  : m_topology( bases[0]->dim(), bases.size(), boundary, interfaces )
87  {
88  m_bases.swap(bases);// consumes the pointers
89  }
90 
92  ~gsMultiBasis();
93 
95  gsMultiBasis( const gsMultiBasis& other );
96 
97 #if EIGEN_HAS_RVALUE_REFERENCES
98  gsMultiBasis(gsMultiBasis&& other) : m_bases(give(other.m_bases)), m_topology(give(other.m_topology)) {}
100 
102  gsMultiBasis& operator= ( const gsMultiBasis& other );
103 
106  {
107  freeAll(m_bases);
108  m_bases = give(other.m_bases);
109  m_topology = give(other.m_topology);
110  return *this;
111  }
112 #else
115  {
116  this->swap( other );
117  return *this;
118  }
119 #endif
120 
121  GISMO_CLONE_FUNCTION(gsMultiBasis)
122 
123 public:
124 
127  const_iterator begin() const
128  {
129  return m_bases.begin();
130  }
131 
134  const_iterator end() const
135  {
136  return m_bases.end();
137  }
138 
142  return m_bases.begin();
143  }
144 
148  return m_bases.end();
149  }
150 
152  void clear()
153  {
154  m_topology.clearAll();
155  m_bases .clear();
156  }
157 
158  const gsBoxTopology & topology() const { return m_topology; }
159 
160 public:
161 
163  const_reference at(size_t i) const
164  {return *m_bases.at(i);}
165 
166  //reference at(size_t i)
167  //{return *m_bases.at(i);}
168 
169  const_reference operator[](size_t i) const
170  {return *m_bases[i];}
171 
172  reference operator[](size_t i)
173  {return *m_bases[i];}
174 
175  // reference front()
176  // {return *m_bases.front();}
177 
178  const_reference front() const
179  {return *m_bases.front();}
180 
181  // reference back()
182  // {return *m_bases.back();}
183 
184  const_reference back() const
185  {return *m_bases.back();}
186 
187  void pop_back()
188  {m_bases.pop_back();}
189 
190 public:
191 
192  short_t domainDim () const {return m_bases.empty() ? 0 : m_bases.front()->domainDim();}
193 
194  short_t targetDim () const {return m_bases.empty() ? 0 : m_bases.front()->targetDim();}
195 
197  void swap(gsMultiBasis& other)
198  {
199  m_topology.swap( other.m_topology );
200 
201  m_bases.swap( other.m_bases );
202  }
203 
205  std::ostream& print( std::ostream& os ) const;
206 
208  short_t dim() const { return m_bases[0]->dim();}
209 
212  short_t degree(size_t i = 0, short_t comp = 0) const
213  {
214  GISMO_ASSERT( i < m_bases.size(),
215  "Invalid patch index "<<i<<" requested from gsMultiBasis" );
216  return m_bases[i]->degree(comp);
217  }
218 
220  short_t maxDegree(short_t k) const;
221 
223  short_t minDegree(short_t k) const;
224 
226  short_t maxCwiseDegree() const;
227 
229  short_t minCwiseDegree() const;
230 
232  int size(size_t i) const
233  {
234  GISMO_ASSERT( i < m_bases.size(),
235  "Invalid patch index "<<i<<" requested from gsMultiBasis" );
236  return m_bases[i]->size();
237  }
238 
239  index_t size() const
240  {
241  //GISMO_ERROR("call gsMultiBasis::nBases() instead.");
242  return totalSize();
243  }
244 
246  size_t totalSize() const
247  {
248  size_t sum = 0;
249  for (size_t k = 0; k < m_bases.size(); ++k)
250  sum += m_bases[k]->size();
251  return sum;
252  }
253 
255  size_t totalElements() const
256  {
257  size_t sum = 0;
258  for (size_t k = 0; k < m_bases.size(); ++k)
259  sum += m_bases[k]->numElements();
260  return sum;
261  }
262 
264  size_t nBases() const { return m_bases.size(); }
265 
267  const gsBasis<T> & basis(const size_t i ) const
268  {
269  GISMO_ASSERT( i < m_bases.size(),
270  "Invalid patch index"<<i<<" requested from gsMultiBasis" );
271  return *m_bases[i];
272  }
273 
274  const gsBasis<T> & piece(const index_t i) const
275  {
276  GISMO_ASSERT( static_cast<size_t>(i) < m_bases.size(),
277  "Invalid patch index"<<i<<" requested from gsMultiBasis" );
278  return *m_bases[i];
279  }
280 
282  index_t nPieces() const { return static_cast<index_t>(m_bases.size()); }
283 
285  gsBasis<T> & basis(const size_t i )
286  {
287  GISMO_ASSERT( i < m_bases.size(),
288  "Invalid patch index"<<i<<" requested from gsMultiBasis" );
289  return *m_bases[i];
290  }
291 
293  void addBasis( gsBasis<T> * g );
294 
296  void addBasis(typename gsBasis<T>::uPtr g);
297 
299  int findBasisIndex( gsBasis<T>* g ) const;
300 
305  void addInterface( gsBasis<T>* g1, boxSide s1,
306  gsBasis<T>* g2, boxSide s2 );
307 
310  {
311  const int p =findBasisIndex( g );
312  m_topology.addBoundary( patchSide( p, s ) );
313  }
314 
318  void uniformRefine(int numKnots = 1, int mul = 1, int dir = -1)
319  {
320  for (size_t k = 0; k < m_bases.size(); ++k)
321  {
322  m_bases[k]->uniformRefine(numKnots,mul,dir);
323  }
324  }
325 
335  static void combineTransferMatrices(
336  const std::vector< gsSparseMatrix<T, RowMajor> >& localTransferMatrices,
337  const gsDofMapper& coarseMapper,
338  const gsDofMapper& fineMapper,
339  gsSparseMatrix<T, RowMajor>& transferMatrix
340  );
341 
354  gsSparseMatrix<T, RowMajor>& transfer,
355  const gsBoundaryConditions<T>& boundaryConditions,
356  const gsOptionList& assemblerOptions,
357  int numKnots = 1,
358  int mul = 1,
359  index_t unk = 0
360  );
361 
364  void uniformRefineComponent(int comp, int numKnots = 1, int mul = 1)
365  {
366  for (size_t k = 0; k < m_bases.size(); ++k)
367  {
368  m_bases[k]->component(comp).uniformRefine(numKnots,mul);
369  }
370  }
371 
372  // @brief Refine the boxes defined by "boxes"
373  void refine(int k, gsMatrix<T> const & boxes)
374  {
375  m_bases[k]->refine(boxes);
376  }
377 
378  // @brief Refine the boxes defined by "boxes"
379  void unrefine(int k, gsMatrix<T> const & boxes)
380  {
381  m_bases[k]->unrefine(boxes);
382  }
383 
388  void refineElements(int k, std::vector<index_t> const & boxes)
389  {
390  m_bases[k]->refineElements(boxes);
391  }
392 
393  void unrefineElements(int k, std::vector<index_t> const & boxes)
394  {
395  m_bases[k]->unrefineElements(boxes);
396  }
397 
402  void refine(size_t k, gsMatrix<T> const & boxes, int refExt)
403  {
404  GISMO_ASSERT( k < m_bases.size(),
405  "Invalid patch index "<<k<<" requested from gsMultiBasis" );
406  m_bases[k]->refine( boxes, refExt);
407  }
408  void unrefine(size_t k, gsMatrix<T> const & boxes, int refExt)
409  {
410  GISMO_ASSERT( k < m_bases.size(),
411  "Invalid patch index "<<k<<" requested from gsMultiBasis" );
412  m_bases[k]->unrefine( boxes, refExt);
413  }
414 
418  void uniformCoarsen(int numKnots = 1)
419  {
420  for (size_t k = 0; k < m_bases.size(); ++k)
421  {
422  m_bases[k]->uniformCoarsen(numKnots);
423  }
424  }
425 
438  gsSparseMatrix<T, RowMajor>& transfer,
439  const gsBoundaryConditions<T>& boundaryConditions,
440  const gsOptionList& assemblerOptions,
441  int numKnots = 1,
442  index_t unk = 0
443  );
444 
447  { return m_bases[p.patch()]->componentBasis(p); }
448 
457  patchComponent pc,
458  const gsDofMapper& dm,
459  gsMatrix<index_t>& indices,
460  bool no_lower = true
461  ) const;
462 
470  std::vector<typename gsBasis<T>::uPtr> componentBasis_withIndices(
471  const std::vector<patchComponent>& pc,
472  const gsDofMapper& dm,
473  gsMatrix<index_t>& indices,
474  bool no_lower = true
475  ) const;
476 
485  void repairInterfaces( const std::vector< boundaryInterface > & bivec )
486  {
487  size_t kmax = 2*bivec.size();
488  size_t k = 0;
489  bool sthChanged = false;
490  bool change = false;
491  do
492  {
493  sthChanged = false;
494  for( size_t i = 0; i < bivec.size(); i++ )
495  {
496  change = repairInterface( bivec[i] );
497  sthChanged = sthChanged || change;
498  }
499  k++; // just to be sure this cannot go on infinitely
500  }
501  while( sthChanged && k <= kmax );
502  }
503 
510  bool repairInterface2d( const boundaryInterface & bi );
511 
520  bool repairInterface( const boundaryInterface & bi );
521 
545  template<short_t d>
547  std::vector<index_t> & refEltsFirst,
548  std::vector<index_t> & refEltsSecond );
549 
551  void degreeElevate(short_t const i = 1, short_t const dir = -1)
552  {
553  for (size_t k = 0; k < m_bases.size(); ++k)
554  m_bases[k]->degreeElevate(i,dir);
555  }
556 
559  void degreeIncrease(short_t const i = 1, short_t const dir = -1)
560  {
561  for (size_t k = 0; k < m_bases.size(); ++k)
562  m_bases[k]->degreeIncrease(i,dir);
563  }
564 
567  void degreeDecrease(short_t const i = 1, short_t const dir = -1)
568  {
569  for (size_t k = 0; k < m_bases.size(); ++k)
570  m_bases[k]->degreeDecrease(i,dir);
571  }
572 
574  void degreeReduce(short_t const i = 1)
575  {
576  for (size_t k = 0; k < m_bases.size(); ++k)
577  m_bases[k]->degreeReduce(i);
578  }
579 
581  void setDegree(short_t const& i)
582  {
583  for (size_t k = 0; k < m_bases.size(); ++k)
584  m_bases[k]->setDegree(i);
585  }
586 
588  void reduceContinuity(int const i = 1)
589  {
590  for (size_t k = 0; k < m_bases.size(); ++k)
591  m_bases[k]->reduceContinuity(i);
592  }
593 
594  BasisContainer & patchBases()
595  {
596  return m_bases;
597  }
598 
599  const BasisContainer & patchBases() const
600  {
601  return m_bases;
602  }
603 
604  void setTopology(const gsBoxTopology & tpl)
605  {
606  m_topology = tpl;
607  }
608 
609 
610  void getMapper(bool conforming,
611  const gsBoundaryConditions<T> & bc,
612  int unk,
613  gsDofMapper & mapper,
614  bool finalize = true) const;
615 
616  void getMapper(bool conforming,
617  const gsBoundaryConditions<T> & bc,
618  gsDofMapper & mapper,
619  bool finalize = true) const
620  { getMapper(conforming, bc, 0, mapper, finalize); }
621 
622  void getMapper(iFace::strategy is,
623  const gsBoundaryConditions<T> & bc,
624  gsDofMapper & mapper,
625  int unk,
626  bool finalize = true) const
627  { getMapper(is==iFace::glue, bc, unk, mapper, finalize); }
628 
629  void getMapper(dirichlet::strategy ds,
630  iFace::strategy is,
631  const gsBoundaryConditions<T> & bc,
632  gsDofMapper & mapper,
633  int unk,
634  bool finalize = true) const
635  {
636  if ( ds == dirichlet::elimination )
637  getMapper(is==iFace::glue, bc, unk, mapper, finalize);
638  else
639  getMapper(is==iFace::glue, mapper, finalize);
640  }
641 
642  gsDofMapper getMapper(dirichlet::strategy ds,
643  iFace::strategy is,
644  const gsBoundaryConditions<T> & bc,
645  int unk,
646  bool finalize = true) const
647  {
648  gsDofMapper mapper;
649  if ( ds == dirichlet::elimination )
650  getMapper(is==iFace::glue, bc, unk, mapper, finalize);
651  else
652  getMapper(is==iFace::glue, mapper, finalize);
653  return mapper;
654  }
655 
656 
657  // to remove
658  void getMapper(bool conforming, gsDofMapper & mapper, bool finalize = true) const;
659 
660  void getMapper(iFace::strategy is, gsDofMapper & mapper, bool finalize = true) const
661  { getMapper(is==iFace::glue, mapper, finalize); }
662 
663 
664  //private: // to do
665 
687  void matchInterface(const boundaryInterface & bi,
688  gsDofMapper & mapper) const;
689 
692  void tileParameters();
693 
694 private:
695 
696  BasisContainer m_bases;
697 
698  gsBoxTopology m_topology;
699 
700 }; // class gsMultiBasis
701 
702 
704 template<class T>
705 std::ostream& operator<<( std::ostream& os, const gsMultiBasis<T>& b )
706 {
707  return b.print( os );
708 }
709 
710 #ifdef GISMO_WITH_PYBIND11
711 
715  void pybind11_init_gsMultiBasis(pybind11::module &m);
716 
717 #endif // GISMO_WITH_PYBIND11
718 
719 } // namespace gismo
720 
721 
722 #ifndef GISMO_BUILD_LIB
723 #include GISMO_HPP_HEADER(gsMultiBasis.hpp)
724 #endif
gsBasis< T >::uPtr componentBasis_withIndices(patchComponent pc, const gsDofMapper &dm, gsMatrix< index_t > &indices, bool no_lower=true) const
Returns the basis that corresponds to the component.
Definition: gsMultiBasis.hpp:262
void addBoundary(index_t p, boxSide s, std::string l="")
Set side s of box p to a boundary.
Definition: gsBoxTopology.h:208
int findBasisIndex(gsBasis< T > *g) const
Search for the given basis and return its index.
Definition: gsMultiBasis.hpp:112
void addInterface(gsBasis< T > *g1, boxSide s1, gsBasis< T > *g2, boxSide s2)
Add an interface joint between side s1 of geometry g1 side s2 of geometry g2.
Definition: gsMultiBasis.hpp:121
size_t totalSize() const
The total number of basis functions in all bases.
Definition: gsMultiBasis.h:246
index_t patch() const
Returns the patch number.
Definition: gsBoundary.h:626
gsMultiBasis()
Default empty constructor.
Definition: gsMultiBasis.h:58
Struct which represents a certain side of a patch.
Definition: gsBoundary.h:231
Provides declaration of the BoxTopology class.
gsMultiBasis & operator=(gsMultiBasis other)
Assignment operator (uses copy-and-swap idiom)
Definition: gsMultiBasis.h:114
gsMultiBasis(BasisContainer &bases, const gsBoxTopology &topology)
Create from a vector of bases and topology.
Definition: gsMultiBasis.h:73
#define short_t
Definition: gsConfig.h:35
void degreeElevate(short_t const i=1, short_t const dir=-1)
Elevate the degree of every basis by the given amount. (keeping the smoothness)
Definition: gsMultiBasis.h:551
iterator end()
Definition: gsMultiBasis.h:147
int size(size_t i) const
The number of basis functions in basis i.
Definition: gsMultiBasis.h:232
Struct that defines the boundary sides and corners and types of a geometric object.
Definition: gsBoundary.h:55
short_t maxDegree(short_t k) const
Maximum degree with respect to variable k.
Definition: gsMultiBasis.hpp:331
bool repairInterface2d(const boundaryInterface &bi)
Checks if the 2D-interface is fully matching, and if not, repairs it.
Definition: gsMultiBasis.hpp:692
short_t minCwiseDegree() const
Minimum degree with respect to all variables.
Definition: gsMultiBasis.hpp:352
Provides declaration of Basis abstract interface.
S give(S &x)
Definition: gsMemory.h:266
Provides declaration of Geometry abstract interface.
short_t degree(size_t i=0, short_t comp=0) const
Returns the polynomial degree of basis i in component j, if the basis is of polynomial or piecewise p...
Definition: gsMultiBasis.h:212
void degreeIncrease(short_t const i=1, short_t const dir=-1)
Increase the degree of every basis by the given amount. (keeping the multiplicity) ...
Definition: gsMultiBasis.h:559
#define index_t
Definition: gsConfig.h:32
void swap(gsMultiBasis &other)
Swap with another gsMultiBasis.
Definition: gsMultiBasis.h:197
Provides assembler and solver options.
void degreeDecrease(short_t const i=1, short_t const dir=-1)
Increase the degree of every basis by the given amount. (keeping the multiplicity) ...
Definition: gsMultiBasis.h:567
gsBasis< T >::uPtr componentBasis(patchComponent p) const
Returns the basis that corresponds to the component.
Definition: gsMultiBasis.h:446
void matchInterface(const boundaryInterface &bi, gsDofMapper &mapper) const
Matches the degrees of freedom along an interface.
Definition: gsMultiBasis.hpp:415
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsMultiBasis.hpp:71
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
size_t totalElements() const
The total number of elements in all patches.
Definition: gsMultiBasis.h:255
void uniformRefineComponent(int comp, int numKnots=1, int mul=1)
Refine the component comp of every basis uniformly by inserting numKnots new knots on each knot span...
Definition: gsMultiBasis.h:364
Maintains a mapping from patch-local dofs to global dof indices and allows the elimination of individ...
Definition: gsDofMapper.h:68
void uniformCoarsen(int numKnots=1)
Coarsen every basis uniformly.
Definition: gsMultiBasis.h:418
void addPatchBoundary(gsBasis< T > *g, boxSide s)
Add side s of patch g to the outer boundary of the domain.
Definition: gsMultiBasis.h:309
memory::shared_ptr< gsFunctionSet > Ptr
Shared pointer for gsFunctionSet.
Definition: gsFunctionSet.h:223
bool repairInterface(const boundaryInterface &bi)
Checks if the interface is fully matching, and if not, repairs it.
Definition: gsMultiBasis.hpp:428
const_reference at(size_t i) const
Assess i-th parametric basis.
Definition: gsMultiBasis.h:163
const_iterator begin() const
Definition: gsMultiBasis.h:127
Provides the gsDofMapper class for re-indexing DoFs.
index_t nPieces() const
Number of patch-wise bases.
Definition: gsMultiBasis.h:282
void degreeReduce(short_t const i=1)
Reduce the degree of the basis by the given amount.
Definition: gsMultiBasis.h:574
gsMultiBasis(BasisContainer &bases, const std::vector< patchSide > &boundary, const std::vector< boundaryInterface > &interfaces)
Create from bases and boundary/interface information.
Definition: gsMultiBasis.h:83
memory::unique_ptr< gsFunctionSet > uPtr
Unique pointer for gsFunctionSet.
Definition: gsFunctionSet.h:226
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
short_t maxCwiseDegree() const
Maximum degree with respect to all variables.
Definition: gsMultiBasis.hpp:342
iterator begin()
Definition: gsMultiBasis.h:141
short_t dim() const
Dimension of the parameter domain (must match for all bases).
Definition: gsMultiBasis.h:208
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
gsBasis< T > & basis(const size_t i)
Return the i-th basis block.
Definition: gsMultiBasis.h:285
void freeAll(It begin, It end)
Frees all pointers in the range [begin end)
Definition: gsMemory.h:312
void refineElements(int k, std::vector< index_t > const &boxes)
Refine the are defined by boxes on patch k.
Definition: gsMultiBasis.h:388
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
const gsBasis< T > & piece(const index_t i) const
Returns the piece(s) of the function(s) at subdomain k.
Definition: gsMultiBasis.h:274
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsMultiBasis.h:192
Struct which represents a certain component (interior, face, egde, corner) of a particular patch...
Definition: gsBoundary.h:565
void swap(gsBoxTopology &other)
Swap with another gsBoxTopology.
Definition: gsBoxTopology.h:174
memory::unique_ptr< gsBasis > uPtr
Unique pointer for gsBasis.
Definition: gsBasis.h:89
const gsBasis< T > & basis(const size_t i) const
Return the i-th basis block.
Definition: gsMultiBasis.h:267
BasisContainer::iterator iterator
Type definitions.
Definition: gsMultiBasis.h:49
short_t minDegree(short_t k) const
Minimum degree with respect to variable k.
Definition: gsMultiBasis.hpp:362
void clearAll()
Clear all boxes, boundary and interface data.
Definition: gsBoxTopology.h:165
void uniformRefine(int numKnots=1, int mul=1, int dir=-1)
Refine every basis uniformly.
Definition: gsMultiBasis.h:318
const_iterator end() const
Definition: gsMultiBasis.h:134
Class containing a set of boundary conditions.
Definition: gsBoundaryConditions.h:341
void uniformRefine_withTransfer(gsSparseMatrix< T, RowMajor > &transfer, const gsBoundaryConditions< T > &boundaryConditions, const gsOptionList &assemblerOptions, int numKnots=1, int mul=1, index_t unk=0)
Refine every basis uniformly.
Definition: gsMultiBasis.hpp:181
bool repairInterfaceFindElements(const boundaryInterface &bi, std::vector< index_t > &refEltsFirst, std::vector< index_t > &refEltsSecond)
Finds the elements that need to be refined in order to repair an interface.
Definition: gsMultiBasis.hpp:462
void repairInterfaces(const std::vector< boundaryInterface > &bivec)
Checks if the interfaces bivec are fully matching, and if not, repairs them, i.e., makes them fully matching.
Definition: gsMultiBasis.h:485
size_t nBases() const
Number of patch-wise bases.
Definition: gsMultiBasis.h:264
void refine(size_t k, gsMatrix< T > const &boxes, int refExt)
Refine the are defined by boxes on patch k with extension refExt.
Definition: gsMultiBasis.h:402
Provides gsBoundaryConditions class.
~gsMultiBasis()
Destructor.
Definition: gsMultiBasis.hpp:65
void reduceContinuity(int const i=1)
Reduce the continuity by i.
Definition: gsMultiBasis.h:588
Struct which represents an interface between two patches.
Definition: gsBoundary.h:649
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
index_t size() const
size
Definition: gsMultiBasis.h:239
void setDegree(short_t const &i)
Set the degree of the basis.
Definition: gsMultiBasis.h:581
Defines a topological arrangement of a collection of &quot;boxes&quot; (e.g., parameter domains that map to phy...
Definition: gsBoxTopology.h:38
void clear()
Clear (delete) all patches.
Definition: gsMultiBasis.h:152
short_t targetDim() const
Dimension of the target space.
Definition: gsMultiBasis.h:194
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
void uniformCoarsen_withTransfer(gsSparseMatrix< T, RowMajor > &transfer, const gsBoundaryConditions< T > &boundaryConditions, const gsOptionList &assemblerOptions, int numKnots=1, index_t unk=0)
Coarsen every basis uniformly.
Definition: gsMultiBasis.hpp:222
static void combineTransferMatrices(const std::vector< gsSparseMatrix< T, RowMajor > > &localTransferMatrices, const gsDofMapper &coarseMapper, const gsDofMapper &fineMapper, gsSparseMatrix< T, RowMajor > &transferMatrix)
This function takes local transfer matrices (per patch) and combines them using given DofMappers to a...
Definition: gsMultiBasis.hpp:137
void addBasis(gsBasis< T > *g)
Add a basis (ownership of the pointer is also acquired)
Definition: gsMultiBasis.hpp:79