G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsBasisRefs.h
Go to the documentation of this file.
1
14#pragma once
15
16namespace gismo
17{
18
24template <class T>
26{
27private:
28 typedef typename std::vector<gsMultiBasis<T> >::const_iterator mbIterator;
29
30public:
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
64private:
65 std::vector<const gsBasis<T>*> m_refs;
66
67private:
69 gsBasisRefs(const gsBasisRefs &);
70};
71
72} // namespace gismo
Simple class to hold a list of gsBasis which discretize a PDE system on a given patch.
Definition gsBasisRefs.h:26
size_t size() const
Size.
Definition gsBasisRefs.h:58
gsBasisRefs(std::vector< gsMultiBasis< T > > &bases, const size_t k)
Constructor from a gsMultiBasis bases and a patch index k.
Definition gsBasisRefs.h:33
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
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:79
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
#define short_t
Definition gsConfig.h:35
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
The G+Smo namespace, containing all definitions for the library.