G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsBasisRefs.h
Go to the documentation of this file.
1 
14 #pragma once
15 
16 namespace gismo
17 {
18 
24 template <class T>
26 {
27 private:
28  typedef typename std::vector<gsMultiBasis<T> >::const_iterator mbIterator;
29 
30 public:
31 
33  inline gsBasisRefs(std::vector<gsMultiBasis<T> > & bases, const size_t k)
34  {
35  GISMO_ASSERT(bases.size()>0, "Cannot construct empty list of gsBasis.");
36  m_refs.reserve(bases.size());
37  for(mbIterator it = bases.begin(); it != bases.end(); ++it)
38  m_refs.push_back( &(*it)[k] );
39  }
40 
42  inline const gsBasis<T> & operator[](size_t i) const
43  { return *m_refs[i]; }
44 
46  inline operator const gsBasis<T> &() const
47  { return *m_refs.front(); }
48 
50  inline const gsBasis<T> & front() const
51  { return *m_refs.front(); }
52 
54  inline const gsBasis<T> & back () const
55  { return *m_refs.back(); }
56 
58  inline size_t size () const
59  { return m_refs.size(); }
60 
62  inline short_t dim() const { return m_refs.front()->dim();}
63 
64 private:
65  std::vector<const gsBasis<T>*> m_refs;
66 
67 private:
68  gsBasisRefs();
69  gsBasisRefs(const gsBasisRefs &);
70 };
71 
72 } // namespace gismo
#define short_t
Definition: gsConfig.h:35
short_t dim() const
Return the parametric dimension of the bases (assumed to be the same for all the bases) ...
Definition: gsBasisRefs.h:62
const gsBasis< T > & operator[](size_t i) const
Accessor for a certain gsBasis.
Definition: gsBasisRefs.h:42
Simple class to hold a list of gsBasis which discretize a PDE system on a given patch.
Definition: gsBasisRefs.h:25
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
Holds a set of patch-wise bases and their topology information.
Definition: gsMultiBasis.h:36
size_t size() const
Size.
Definition: gsBasisRefs.h:58
const gsBasis< T > & back() const
Back.
Definition: gsBasisRefs.h:54
const gsBasis< T > & front() const
Front.
Definition: gsBasisRefs.h:50
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
gsBasisRefs(std::vector< gsMultiBasis< T > > &bases, const size_t k)
Constructor from a gsMultiBasis bases and a patch index k.
Definition: gsBasisRefs.h:33