G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsBasis.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 #include <gsCore/gsFunctionSet.h>
17 #include <gsCore/gsBoundary.h>//for boxSide
18 
19 #define GISMO_MAKE_GEOMETRY_NEW \
20 virtual memory::unique_ptr<gsGeometry<T> > makeGeometry( gsMatrix<T>coefs ) const \
21  { return memory::unique_ptr<gsGeometry<T> >(new GeometryType(*this, give(coefs))); }
22 
23 namespace gismo
24 {
25 
77 template<class T>
78 class gsBasis : public gsFunctionSet<T>
79 {
80 
81 public:
82 
83  typedef gsFunctionSet<T> Base;
84 
86  typedef memory::shared_ptr< gsBasis > Ptr;
87 
89  typedef memory::unique_ptr< gsBasis > uPtr;
90 
91  typedef T Scalar_t;
92 
93  static const bool IsRational = false;
94 
95  typedef memory::unique_ptr< gsDomainIterator<T> > domainIter;
96 
97  virtual ~gsBasis();
98 
99 public:
100 
101  /*
102  Member functions with non-virtual implementations
103  (override the _into versions in derived classes).
104  */
105 
106  const gsBasis<T> & piece(const index_t k) const
107  {
108  GISMO_ENSURE(0==k, "Single basis is defined on single subdomain, received: "<<k );
109  return *this;
110  }
111 
113  //
116  gsBasisFun<T> function(index_t i) const;
117 
120 
123  {
124  gsMatrix<T> result;
125  this->evalSingle_into(i, u, result);
126  return result;
127  }
128 
131  {
132  gsMatrix<T> result;
133  this->derivSingle_into(i, u, result);
134  return result;
135  }
136 
139  {
140  gsMatrix<T> result;
141  this->deriv2Single_into(i, u, result);
142  return result;
143  }
144 
152  {
153  gsVector<index_t> result;
154  this->numActive_into(u, result);
155  return result;
156  }
157 
159 
160 
161 
172 
184  gsMatrix<T> evalFunc(const gsMatrix<T> & u, const gsMatrix<T> & coefs) const
185  {
186  gsMatrix<T> result;
187  this->evalFunc_into(u, coefs, result);
188  return result;
189  }
190 
202  virtual void evalFunc_into(const gsMatrix<T> & u,
203  const gsMatrix<T> & coefs,
204  gsMatrix<T>& result) const;
205 
206 
215  gsMatrix<T> derivFunc(const gsMatrix<T> & u, const gsMatrix<T> & coefs) const
216  {
217  gsMatrix<T> result;
218  this->derivFunc_into(u, coefs, result);
219  return result;
220  }
221 
283  virtual void derivFunc_into(const gsMatrix<T> & u,
284  const gsMatrix<T> & coefs,
285  gsMatrix<T>& result ) const;
286 
290  virtual void jacobianFunc_into(const gsMatrix<T> & u,
291  const gsMatrix<T> & coefs,
292  gsMatrix<T>& result ) const;
293 
294 
305  // second derivatives as follows (eg. for a surface (x,y) --> (f_1, f_2, f_3):
306  // * ( dxxf_1 dyyf_1 dxyf_1 dxxf_2 dyyf_2 dxy2f_2 dxxf_3 dyyf_3 dxyf_3 )^T
307  gsMatrix<T> deriv2Func(const gsMatrix<T> & u, const gsMatrix<T> & coefs) const
308  {
309  gsMatrix<T> result;
310  this->deriv2Func_into(u, coefs, result);
311  return result;
312  }
313 
352  virtual void deriv2Func_into(const gsMatrix<T> & u, const gsMatrix<T> & coefs, gsMatrix<T>& result ) const;
353 
381  virtual void evalAllDersFunc_into(const gsMatrix<T> & u,
382  const gsMatrix<T> & coefs,
383  const unsigned n,
384  std::vector< gsMatrix<T> >& result,
385  bool sameElement = false) const;
386 
397  static void linearCombination_into(const gsMatrix<T> & coefs,
398  const gsMatrix<index_t> & actives,
399  const gsMatrix<T> & values,
400  gsMatrix<T> & result, bool sameElement = false);
401 
403 
404  inline short_t dim() const {return this->domainDim();}
405 
406  /*
407  Member functions that need to be redefined in the derived class.
408  */
409 
411  virtual const gsMatrix<T> & weights() const
412  {
413  static gsMatrix<T> dummy;
414  return dummy;
415  }
416 
418  virtual gsMatrix<T> & weights()
419  {
420  static gsMatrix<T> dummy;
421  return dummy;
422  }
423 
425  virtual bool isRational() const { return false;}
426 
438  {
439  gsMatrix<T> result;
440  this->anchors_into(result);
441  return result;
442  }
443 
444  gsMatrix<T> anchor(index_t i) const
445  {
446  gsMatrix<T> result;
447  this->anchor_into(i, result);
448  return result;
449  }
450 
461  virtual void anchors_into(gsMatrix<T>& result) const;
462 
464  virtual void anchor_into(index_t i, gsMatrix<T>& result) const;
465 
468  virtual void connectivityAtAnchors(gsMesh<T> & mesh) const;
469 
472  virtual void connectivity(const gsMatrix<T> & nodes, gsMesh<T> & mesh) const;
473 
476 
486  virtual void active_into(const gsMatrix<T> & u, gsMatrix<index_t>& result) const;
487 
489  virtual void numActive_into(const gsMatrix<T> & u, gsVector<index_t>& result) const;
490 
493  virtual bool isActive(const index_t i, const gsVector<T> & u) const;
494 
505  virtual void activeCoefs_into(const gsVector<T> & u, const gsMatrix<T> & coefs,
506  gsMatrix<T>& result) const;
507 
509 
511  virtual gsMatrix<index_t> allBoundary( ) const;
512 
517  virtual gsMatrix<index_t> boundaryOffset(boxSide const & s, index_t offset) const;
518 
521  { return this->boundaryOffset(s,0); }
522 
523  virtual index_t functionAtCorner(boxCorner const & c) const;
524 
525 #ifdef __DOXYGEN__
528 #endif
529  GISMO_UPTR_FUNCTION_DEC(gsBasis<T>, boundaryBasis, boxSide const &)
530 
531 
532  virtual uPtr componentBasis(boxComponent b) const;
533 
540  virtual uPtr componentBasis_withIndices(boxComponent b, gsMatrix<index_t>& indices, bool noBoundary = true) const;
541 
546  virtual gsMatrix<T> support() const;
547 
552  virtual gsMatrix<T> support(const index_t & i) const;
553 
558  gsMatrix<T> supportInterval(index_t dir) const;
559 
562 
587  virtual void eval_into(const gsMatrix<T> & u, gsMatrix<T>& result) const;
588 
590  virtual void evalSingle_into(index_t i, const gsMatrix<T> & u, gsMatrix<T>& result) const;
591 
618  virtual void deriv_into(const gsMatrix<T> & u, gsMatrix<T>& result ) const;
619 
626  virtual void derivSingle_into(index_t i,
627  const gsMatrix<T> & u,
628  gsMatrix<T>& result ) const;
629 
664  virtual void deriv2_into(const gsMatrix<T> & u, gsMatrix<T>& result ) const;
665 
668  // hessianSingle_into
669  virtual void deriv2Single_into(index_t i,
670  const gsMatrix<T> & u,
671  gsMatrix<T>& result ) const;
672 
675  virtual void evalAllDersSingle_into(index_t i, const gsMatrix<T> & u,
676  int n, gsMatrix<T>& result) const;
677 
680  virtual void evalDerSingle_into(index_t i, const
681  gsMatrix<T> & u, int n,
682  gsMatrix<T>& result) const;
683 
685  virtual gsMatrix<T> laplacian(const gsMatrix<T> & u ) const;
686 
688 
689  GISMO_UPTR_FUNCTION_PURE(gsBasis, clone)
690 
693  virtual memory::unique_ptr<gsGeometry<T> > makeGeometry(gsMatrix<T> coefs) const = 0;
694 
697  virtual typename gsBasis::uPtr create() const;
698 
700  virtual typename gsBasis::uPtr tensorize(const gsBasis & other) const;
701 
704  virtual const gsBasis & source () const { return *this; }
705 
708  virtual gsBasis & source () { return *this; }
709 
712  virtual memory::unique_ptr<gsBasis<T> > makeNonRational() const { return clone(); }
713 
716  virtual domainIter makeDomainIterator() const;
717 
721  virtual domainIter makeDomainIterator(const boxSide & s) const;
722 
724  virtual std::ostream &print(std::ostream &os) const = 0;
725 
727  virtual std::string detail() const
728  {
729  // By default just uses print(..)
730  std::ostringstream os;
731  print(os);
732  return os.str();
733  }
734 
735  /*
736  Member functions that may be implemented or not in the derived class
737  */
738 
740  virtual size_t numElements(boxSide const & s = 0) const; // = none
741 
743  virtual size_t elementIndex(const gsVector<T> & u ) const;
744 
747  virtual gsMatrix<T> elementInSupportOf(index_t j) const;
748 
751  virtual const gsBasis<T> & component(short_t i) const;
752 
755  virtual gsBasis<T> & component(short_t i);
756 
777  virtual void refine(gsMatrix<T> const & boxes, int refExt = 0);
778  virtual void unrefine(gsMatrix<T> const & boxes, int refExt = 0);
779 
780  virtual std::vector<index_t> asElements(gsMatrix<T> const & boxes, int refExt = 0) const;
781  virtual std::vector<index_t> asElementsUnrefine(gsMatrix<T> const & boxes, int refExt = 0) const;
782 
790  virtual void refineElements(std::vector<index_t> const & boxes);
791  virtual void unrefineElements(std::vector<index_t> const & boxes);
792 
798  virtual void refineElements_withCoefs(gsMatrix<T> & coefs,std::vector<index_t> const & boxes);
799  virtual void unrefineElements_withCoefs(gsMatrix<T> & coefs,std::vector<index_t> const & boxes);
800 
803  virtual void uniformRefine(int numKnots = 1, int mul=1, int dir=-1);
804 
818  virtual void uniformRefine_withCoefs(gsMatrix<T>& coefs, int numKnots = 1, int mul = 1, int dir=-1);
819 
828  int numKnots = 1, int mul = 1);
829 
848  virtual void uniformCoarsen(int numKnots = 1);
849 
863  virtual void uniformCoarsen_withCoefs(gsMatrix<T>& coefs, int numKnots = 1);
864 
874  int numKnots = 1);
875 
877  virtual void degreeElevate(short_t const & i = 1, short_t const dir = -1);
878 
880  virtual void degreeReduce(short_t const & i = 1, short_t const dir = -1);
881 
883  virtual void degreeIncrease(short_t const & i = 1, short_t const dir = -1);
884 
886  virtual void degreeDecrease(short_t const & i = 1, short_t const dir = -1);
887 
890  void setDegree(short_t const& i);
891 
895 
897  virtual void elevateContinuity(int const & i = 1);
898 
900  virtual void reduceContinuity(int const & i = 1);
901 
904  virtual gsDomain<T> * domain() const;
905 
908  virtual short_t maxDegree() const;
909 
912  virtual short_t minDegree() const;
913 
916  virtual short_t totalDegree() const;
917 
922  virtual short_t degree(short_t i) const;
923 
926  memory::unique_ptr<gsGeometry<T> > interpolateData(gsMatrix<T> const& vals,
927  gsMatrix<T> const& pts ) const;
928 
933  virtual memory::unique_ptr<gsGeometry<T> > interpolateAtAnchors(gsMatrix<T> const& vals) const;
934 
935  //gsGeometry<T> * projectL2(gsFunction<T> const & func) const;
936 
943 
944  std::vector<gsSparseMatrix<T> > collocationMatrixWithDeriv(const gsBasis<T> & b, const gsMatrix<T> & u);
945 
947  virtual void reverse();
948 
956  virtual void matchWith(const boundaryInterface & bi, const gsBasis<T> & other,
957  gsMatrix<index_t> & bndThis, gsMatrix<index_t> & bndOther, index_t offset = 0) const;
958 
959 
961  virtual T getMinCellLength() const;
962 
964  virtual T getMaxCellLength() const;
965 
966 protected:
967 
968  // inline void getLinearCombination(
969  // const gsMatrix<T> & scalars,
970  // const gsMatrix<T> * const & coefs,
971  // const gsMatrix<index_t> & indices,
972  // gsMatrix<T>& result );
973 
974 }; // class gsBasis
975 
976 #ifdef GISMO_WITH_PYBIND11
977 
981  void pybind11_init_gsBasis(pybind11::module &m);
982 
983 #endif // GISMO_WITH_PYBIND11
984 
985 } // namespace gismo
986 
987 
988 #ifndef GISMO_BUILD_LIB
989 #include GISMO_HPP_HEADER(gsBasis.hpp)
990 #endif
Class representing a domain. i.e. a collection of elements (triangles, rectangles, cubes, simplices.
Definition: gsDomain.h:31
gsMatrix< T > derivSingle(index_t i, const gsMatrix< T > &u) const
Evaluate a single basis function i derivative at points u.
Definition: gsBasis.h:130
virtual void evalAllDersFunc_into(const gsMatrix< T > &u, const gsMatrix< T > &coefs, const unsigned n, std::vector< gsMatrix< T > > &result, bool sameElement=false) const
Evaluates all derivatives up to order n of the function described by coefs at points u...
Definition: gsBasis.hpp:119
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
gsBasis< T >::uPtr boundaryBasis(boxSide const &s)
Returns the boundary basis for side s.
virtual void evalAllDersSingle_into(index_t i, const gsMatrix< T > &u, int n, gsMatrix< T > &result) const
Evaluate the basis function i and its derivatives up to order n at points u into result.
Definition: gsBasis.hpp:471
virtual T getMaxCellLength() const
Get the maximum mesh size, as expected for approximation error estimates.
Definition: gsBasis.hpp:676
virtual gsBasis::uPtr create() const
Create an empty basis of the derived type and return a pointer to it.
Definition: gsBasis.hpp:483
virtual void derivSingle_into(index_t i, const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the (partial) derivatives of the i-th basis function at points u into result.
Definition: gsBasis.hpp:455
virtual void degreeIncrease(short_t const &i=1, short_t const dir=-1)
Elevate the degree of the basis by the given amount, preserve knots multiplicity. ...
Definition: gsBasis.hpp:588
gsMatrix< T > supportInterval(index_t dir) const
Returns an interval that contains the parameter values in direction dir.
Definition: gsBasis.hpp:439
#define short_t
Definition: gsConfig.h:35
gsVector< index_t > numActive(const gsMatrix< T > &u) const
Number of active basis functions at an arbitrary parameter value.
Definition: gsBasis.h:151
virtual void refineElements(std::vector< index_t > const &boxes)
Refinement function, with different sytax for different basis.
Definition: gsBasis.hpp:538
Provides structs and classes related to interfaces and boundaries.
virtual void connectivity(const gsMatrix< T > &nodes, gsMesh< T > &mesh) const
Definition: gsBasis.hpp:289
virtual std::ostream & print(std::ostream &os) const =0
Prints the object as a string.
virtual short_t degree(short_t i) const
Degree with respect to the i-th variable. If the basis is a tensor product of (piecewise) polynomial ...
Definition: gsBasis.hpp:650
virtual short_t minDegree() const
If the basis is of polynomial or piecewise polynomial type, then this function returns the minimum po...
Definition: gsBasis.hpp:642
virtual gsMatrix< T > elementInSupportOf(index_t j) const
Returns (the coordinates of) an element in the support of basis function j.
Definition: gsBasis.hpp:510
virtual bool isRational() const
Returns false, since all bases that inherit from gsBasis are not rational.
Definition: gsBasis.h:425
virtual void evalDerSingle_into(index_t i, const gsMatrix< T > &u, int n, gsMatrix< T > &result) const
Evaluate the (partial) derivative(s) of order n the i-th basis function at points u into result...
Definition: gsBasis.hpp:476
virtual gsMatrix< T > & weights()
Only for compatibility reasons, with gsRationalBasis. It returns an empty matrix. ...
Definition: gsBasis.h:418
virtual void derivFunc_into(const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const
Evaluate the derivatives of the function described by coefs at points u.
Definition: gsBasis.hpp:84
virtual void jacobianFunc_into(const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const
Evaluate the Jacobian of the function described by coefs at points u. Jacobian matrices are stacked i...
Definition: gsBasis.hpp:58
virtual size_t elementIndex(const gsVector< T > &u) const
Returns an index for the element which contains point u.
Definition: gsBasis.hpp:506
#define index_t
Definition: gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
virtual size_t numElements(boxSide const &s=0) const
The number of elements on side s.
Definition: gsBasis.hpp:502
const gsBasis< T > & piece(const index_t k) const
Returns the piece(s) of the function(s) at subdomain k.
Definition: gsBasis.h:106
virtual uPtr componentBasis_withIndices(boxComponent b, gsMatrix< index_t > &indices, bool noBoundary=true) const
Returns the basis that corresponds to the component.
Definition: gsBasis.hpp:360
virtual const gsBasis< T > & component(short_t i) const
For a tensor product basis, return the (const) 1-d basis for the i-th parameter component.
Definition: gsBasis.hpp:514
gsMatrix< T > derivFunc(const gsMatrix< T > &u, const gsMatrix< T > &coefs) const
Evaluate the derivatives of the function described by coefs at points u.
Definition: gsBasis.h:215
virtual gsDomain< T > * domain() const
Definition: gsBasis.hpp:634
virtual void deriv2_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the second derivatives of all active basis function at points u.
Definition: gsBasis.hpp:461
virtual void uniformRefine(int numKnots=1, int mul=1, int dir=-1)
Refine the basis uniformly by inserting numKnots new knots with multiplicity mul on each knot span...
Definition: gsBasis.hpp:554
virtual T getMinCellLength() const
Get the minimum mesh size, as expected for inverse inequalities.
Definition: gsBasis.hpp:663
virtual void uniformCoarsen_withCoefs(gsMatrix< T > &coefs, int numKnots=1)
Coarsen the basis uniformly.
Definition: gsBasis.hpp:571
memory::unique_ptr< gsGeometry< T > > interpolateData(gsMatrix< T > const &vals, gsMatrix< T > const &pts) const
Applies interpolation given the parameter values pts and values vals.
Definition: gsBasis.hpp:217
virtual void degreeDecrease(short_t const &i=1, short_t const dir=-1)
Lower the degree of the basis by the given amount, preserving knots multiplicity. ...
Definition: gsBasis.hpp:592
virtual void uniformCoarsen(int numKnots=1)
Coarsen the basis uniformly by removing groups of numKnots consecutive knots, each knot removed mul t...
Definition: gsBasis.hpp:567
gsMatrix< T > anchors() const
Returns the anchor points that represent the members of the basis. There is exactly one anchor point ...
Definition: gsBasis.h:437
virtual uPtr componentBasis(boxComponent b) const
Returns the basis that corresponds to the component.
Definition: gsBasis.hpp:331
virtual void anchors_into(gsMatrix< T > &result) const
Returns the anchor points that represent the members of the basis in result. There is exactly one anc...
Definition: gsBasis.hpp:272
gsMatrix< T > evalSingle(index_t i, const gsMatrix< T > &u) const
Evaluate a single basis function i at points u.
Definition: gsBasis.h:122
virtual void activeCoefs_into(const gsVector< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const
Returns the matrix result of active coefficients at points u, each row being one coefficient. The order of the rows is the same as active_into and eval_into functions.
Definition: gsBasis.hpp:305
virtual short_t totalDegree() const
If the basis is of polynomial or piecewise polynomial type, then this function returns the total poly...
Definition: gsBasis.hpp:646
virtual void uniformCoarsen_withTransfer(gsSparseMatrix< T, RowMajor > &transfer, int numKnots=1)
Coarsen the basis uniformly and produce a sparse matrix which maps coarse coefficient vectors to refi...
Definition: gsBasis.hpp:575
virtual void uniformRefine_withCoefs(gsMatrix< T > &coefs, int numKnots=1, int mul=1, int dir=-1)
Refine the basis uniformly.
Definition: gsBasis.hpp:558
virtual void refineElements_withCoefs(gsMatrix< T > &coefs, std::vector< index_t > const &boxes)
Refine basis and geometry coefficients to levels.
Definition: gsBasis.hpp:546
memory::shared_ptr< gsBasis > Ptr
Shared pointer for gsBasis.
Definition: gsBasis.h:86
void setDegreePreservingMultiplicity(short_t const &i)
Set the degree of the basis (either increase or decrecee) in order to have degree equal to i...
Definition: gsBasis.hpp:614
virtual void connectivityAtAnchors(gsMesh< T > &mesh) const
Definition: gsBasis.hpp:281
virtual void refine(gsMatrix< T > const &boxes, int refExt=0)
Refine the basis on the area defined by the matrix boxes.
Definition: gsBasis.hpp:530
virtual memory::unique_ptr< gsGeometry< T > > makeGeometry(gsMatrix< T > coefs) const =0
Create a gsGeometry of proper type for this basis with the given coefficient matrix.
virtual short_t domainDim() const =0
Dimension of the (source) domain.
static void linearCombination_into(const gsMatrix< T > &coefs, const gsMatrix< index_t > &actives, const gsMatrix< T > &values, gsMatrix< T > &result, bool sameElement=false)
Computes the linear combination coefs * values( actives )
Definition: gsBasis.hpp:150
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
gsMatrix< T > evalFunc(const gsMatrix< T > &u, const gsMatrix< T > &coefs) const
Evaluate the function described by coefs at points u.
Definition: gsBasis.h:184
virtual gsBasis & source()
Definition: gsBasis.h:708
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
virtual memory::unique_ptr< gsBasis< T > > makeNonRational() const
Definition: gsBasis.h:712
virtual const gsBasis & source() const
Definition: gsBasis.h:704
virtual void evalSingle_into(index_t i, const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the i-th basis function at points u into result.
Definition: gsBasis.hpp:447
Represents an individual function in a function set, or a certain component of a vector-valued functi...
Definition: gsBasisFun.h:36
virtual const gsMatrix< T > & weights() const
Only for compatibility reasons, with gsRationalBasis. It returns an empty matrix. ...
Definition: gsBasis.h:411
uPtr clone()
Clone methode. Produceds a deep copy inside a uPtr.
virtual void numActive_into(const gsMatrix< T > &u, gsVector< index_t > &result) const
Returns the number of active (nonzero) basis functions at points u in result.
Definition: gsBasis.hpp:301
virtual void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates nonzero basis functions at point u into result.
Definition: gsBasis.hpp:443
gsMatrix< T > deriv2Func(const gsMatrix< T > &u, const gsMatrix< T > &coefs) const
Evaluates the second derivatives of the function described by coefs at points u.
Definition: gsBasis.h:307
virtual memory::unique_ptr< gsGeometry< T > > interpolateAtAnchors(gsMatrix< T > const &vals) const
Applies interpolation of values pts using the anchors as parameter points. May be reimplemented in de...
Definition: gsBasis.hpp:244
memory::unique_ptr< gsBasis > uPtr
Unique pointer for gsBasis.
Definition: gsBasis.h:89
virtual gsBasis::uPtr tensorize(const gsBasis &other) const
Return a tensor basis of this and other.
Definition: gsBasis.hpp:488
virtual gsMatrix< index_t > boundaryOffset(boxSide const &s, index_t offset) const
Definition: gsBasis.hpp:316
gsMatrix< T > deriv2Single(index_t i, const gsMatrix< T > &u) const
Evaluate the second derivative of a single basis function i at points u.
Definition: gsBasis.h:138
virtual void reduceContinuity(int const &i=1)
Reduces the continuity of the basis along element boundaries.
Definition: gsBasis.hpp:630
virtual gsMatrix< index_t > allBoundary() const
Returns the indices of the basis functions that are nonzero at the domain boundary.
Definition: gsBasis.hpp:311
virtual void matchWith(const boundaryInterface &bi, const gsBasis< T > &other, gsMatrix< index_t > &bndThis, gsMatrix< index_t > &bndOther, index_t offset=0) const
Computes the indices of DoFs that match on the interface bi. The interface is assumed to be a common ...
Definition: gsBasis.hpp:658
virtual void reverse()
Reverse the basis.
Definition: gsBasis.hpp:654
virtual std::string detail() const
Prints the object as a string with extended details.
Definition: gsBasis.h:727
virtual void degreeElevate(short_t const &i=1, short_t const dir=-1)
Elevate the degree of the basis by the given amount, preserve smoothness.
Definition: gsBasis.hpp:580
virtual bool isActive(const index_t i, const gsVector< T > &u) const
Returns true if there the point u with non-zero value or derivatives when evaluated at the basis func...
Definition: gsBasis.hpp:297
virtual short_t maxDegree() const
If the basis is of polynomial or piecewise polynomial type, then this function returns the maximum po...
Definition: gsBasis.hpp:638
Struct which represents an interface between two patches.
Definition: gsBoundary.h:649
This is the interface of all objects that computes functions on points like gsBasis, gsGeometry and gsFunctions.
virtual void evalFunc_into(const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const
Evaluate the function described by coefs at points u, i.e., evaluates a linear combination of coefs x...
Definition: gsBasis.hpp:37
virtual domainIter makeDomainIterator() const
Create a domain iterator for the computational mesh of this basis, that points to the first element o...
Definition: gsBasis.hpp:493
virtual void uniformRefine_withTransfer(gsSparseMatrix< T, RowMajor > &transfer, int numKnots=1, int mul=1)
Refine the basis uniformly.
Definition: gsBasis.hpp:562
virtual void deriv_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the first partial derivatives of the nonzero basis function.
Definition: gsBasis.hpp:451
Struct which represents a certain corner of a hyper-cube.
Definition: gsBoundary.h:291
gsSparseMatrix< T > collocationMatrix(gsMatrix< T > const &u) const
Computes the collocation matrix w.r.t. points u.
Definition: gsBasis.hpp:192
virtual void anchor_into(index_t i, gsMatrix< T > &result) const
Returns the anchor point for member i of the basis.
Definition: gsBasis.hpp:276
virtual gsMatrix< T > support() const
Returns (a bounding box for) the domain of the whole basis.
Definition: gsBasis.hpp:431
virtual gsMatrix< T > laplacian(const gsMatrix< T > &u) const
Compute the Laplacian of all nonzero basis functions at points u.
Definition: gsBasis.hpp:184
gsMatrix< index_t > boundary(boxSide const &s) const
Returns the indices of the basis functions that are nonzero at the domain boundary as single-column-m...
Definition: gsBasis.h:520
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
void setDegree(short_t const &i)
Set the degree of the basis (either elevate or reduce) in order to have degree equal to i wrt to each...
Definition: gsBasis.hpp:596
virtual void deriv2Single_into(index_t i, const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the (partial) derivatives of the i-th basis function at points u into result.
Definition: gsBasis.hpp:465
virtual void deriv2Func_into(const gsMatrix< T > &u, const gsMatrix< T > &coefs, gsMatrix< T > &result) const
Evaluates the second derivatives of the function described by coefs at points u.
Definition: gsBasis.hpp:101
virtual void elevateContinuity(int const &i=1)
Elevates the continuity of the basis along element boundaries.
Definition: gsBasis.hpp:626
virtual void active_into(const gsMatrix< T > &u, gsMatrix< index_t > &result) const
Returns the indices of active basis functions at points u, as a list of indices, in result...
Definition: gsBasis.hpp:293
Struct which represents a certain component (interior, face, egde, corner).
Definition: gsBoundary.h:445
virtual void degreeReduce(short_t const &i=1, short_t const dir=-1)
Reduce the degree of the basis by the given amount, preserve smoothness.
Definition: gsBasis.hpp:584