26 template<
short_t d,
class T>
class gsMappedSingleSpline;
28 template<
short_t d,
class T>
29 class gsMappedSpline :
public gsFunctionSet<T>
31 friend class gsMappedSingleSpline<d,T>;
34 typedef typename gsGeoTraits<d,T>::GeometryBase GeoType;
35 typedef gsBasis<T> BasisType;
38 typedef memory::shared_ptr< gsMappedSpline > Ptr;
41 typedef memory::unique_ptr< gsMappedSpline > uPtr;
45 gsMappedSpline() : m_mbases(nullptr) { }
49 gsMappedSpline(
const gsMultiPatch<T> & mp,
const gsSparseMatrix<T> & m );
52 gsMappedSpline(
const gsMappedBasis<d,T> & mbases,
const gsMatrix<T> & coefs );
54 gsMappedSpline(
const gsMappedSpline& other );
56 gsMappedSpline<d,T> & operator=(
const gsMappedSpline& other );
61 void init(
const gsMappedBasis<d,T> & mbasis)
63 GISMO_ASSERT(mbasis.domainDim()==d,
"Error in dimensions");
66 m_ss.reserve(mbasis.nPieces());
67 for (
index_t k=0; k!=mbasis.nPieces(); k++ )
69 m_ss.push_back( gsMappedSingleSpline<d,T>(
this,k) );
73 void init(
const gsMappedBasis<d,T> & mbasis,
const gsMatrix<T> & coefs)
75 GISMO_ASSERT(mbasis.domainDim()==d,
"Error in dimensions");
80 m_mbases=mbasis.clone().release();
83 m_ss.reserve(mbasis.nPieces());
84 for (
index_t k=0; k!=mbasis.nPieces(); k++ )
86 m_ss.push_back( gsMappedSingleSpline<d,T>(
this,k) );
90 void init(
const gsMultiPatch<T> & mp,
const gsSparseMatrix<T> & m )
93 m_mbases =
new gsMappedBasis<d,T>(gsMultiBasis<T>(mp),m);
96 gsMatrix<T> local = mp.coefs();
97 m_mbases->local_coef_to_global_coef(local,m_global);
104 index_t nPieces()
const {
return m_mbases->nPieces();}
107 BasisType
const & getBase(
int i)
const
108 {
return m_mbases->getBase(i); }
111 BasisType & getBase(
int i)
112 {
return m_mbases->getBase(i); }
115 const std::vector<BasisType*> getBases()
const
116 {
return m_mbases->getBases(); }
119 gsWeightMapper<T>
const & getMapper()
const
120 {
return m_mbases->getMapper(); }
123 gsWeightMapper<T> * getMapPointer()
const
124 {
return m_mbases->getMapPointer(); }
127 gsBoxTopology
const & getTopol()
const
128 {
return m_mbases->getTopol(); }
138 GISMO_CLONE_FUNCTION(gsMappedSpline)
141 {
return m_mbases->domainDim(); }
144 {
return m_global.cols(); }
147 size_t nPatches()
const
148 {
return m_mbases->nPatches(); }
150 const gsMappedSingleSpline<d,T> & piece(
const index_t k)
const {
return m_ss[k]; }
152 index_t size()
const {
return nPieces();}
155 std::ostream &print(std::ostream &os)
const
156 {
return m_mbases->print(os); }
158 const gsMappedBasis<d,T> & getMappedBasis()
const
159 {
return *m_mbases; }
161 const gsMatrix<T> & getMappedCoefs()
const
164 gsMappedBasis<d,T> & getMappedBasis()
165 {
return *m_mbases; }
167 gsMultiPatch<T> exportToPatches()
const;
170 gsMatrix<T> supportOf(
const index_t & k)
const
171 {
return m_mbases->getBase(k).support(); }
173 gsGeometry<T> * exportPatch(
int i,gsMatrix<T>
const & localCoef)
const;
177 void active_into(
const gsMatrix<T> &,gsMatrix<index_t>&)
const
179 void eval_into(
const gsMatrix<T> &,gsMatrix<T>&)
const
181 void deriv_into(
const gsMatrix<T> &,gsMatrix<T>&)
const
183 void deriv2_into(
const gsMatrix<T> &,gsMatrix<T>&)
const
185 void evalAllDers_into(
const gsMatrix<T> &,
int,
186 std::vector<gsMatrix<T> >&,
bool)
const
217 void eval_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const;
218 void deriv_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const;
219 void deriv2_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const;
223 void evalAllDers_into(
const unsigned patch,
const gsMatrix<T> & u,
224 const int n, std::vector<gsMatrix<T> >& result,
225 bool sameElement =
false)
const;
232 gsMappedBasis<d,T> * m_mbases;
234 gsMatrix<T> m_global;
236 std::vector<gsMappedSingleSpline<d,T> > m_ss;
242 #ifndef GISMO_BUILD_LIB
243 #include GISMO_HPP_HEADER(gsMappedSpline.hpp)
#define GISMO_NO_IMPLEMENTATION
Definition: gsDebug.h:129
#define short_t
Definition: gsConfig.h:35
Provides declaration of Geometry abstract interface.
#define index_t
Definition: gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
Provides declaration of Basis abstract interface.
Provides declaration of the MultiPatch class.
Provides declaration of DomainIterator abstract interface.
Implementation of a piece of the gsMappedBasis.
Provides declaration of Basis abstract interface.