26template<
short_t d,
class T>
class gsMappedSingleSpline;
28template<
short_t d,
class T>
29class 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(); }
134 std::map<std::array<size_t, 4>, internal::ElementBlock> BezierOperator()
const;
144 GISMO_CLONE_FUNCTION(gsMappedSpline)
147 {
return m_mbases->domainDim(); }
150 {
return m_global.cols(); }
153 size_t nPatches()
const
154 {
return m_mbases->nPatches(); }
156 const gsMappedSingleSpline<d,T> & piece(
const index_t k)
const {
return m_ss[k]; }
158 index_t size()
const {
return nPieces();}
161 std::ostream &print(std::ostream &os)
const
162 {
return m_mbases->print(os); }
164 const gsMappedBasis<d,T> & getMappedBasis()
const
165 {
return *m_mbases; }
167 const gsMatrix<T> & getMappedCoefs()
const
170 gsMappedBasis<d,T> & getMappedBasis()
171 {
return *m_mbases; }
173 gsMultiPatch<T> exportToPatches()
const;
176 gsMatrix<T> supportOf(
const index_t & k)
const
177 {
return m_mbases->getBase(k).support(); }
179 gsGeometry<T> * exportPatch(
int i,gsMatrix<T>
const & localCoef)
const;
183 void active_into(
const gsMatrix<T> &,gsMatrix<index_t>&)
const
185 void eval_into(
const gsMatrix<T> &,gsMatrix<T>&)
const
187 void deriv_into(
const gsMatrix<T> &,gsMatrix<T>&)
const
189 void deriv2_into(
const gsMatrix<T> &,gsMatrix<T>&)
const
191 void evalAllDers_into(
const gsMatrix<T> &,
int,
192 std::vector<gsMatrix<T> >&,
bool)
const
223 void eval_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const;
224 void deriv_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const;
225 void deriv2_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const;
229 void evalAllDers_into(
const unsigned patch,
const gsMatrix<T> & u,
230 const int n, std::vector<gsMatrix<T> >& result,
231 bool sameElement =
false)
const;
238 gsMappedBasis<d,T> * m_mbases;
240 gsMatrix<T> m_global;
242 std::vector<gsMappedSingleSpline<d,T> > m_ss;
248#ifndef GISMO_BUILD_LIB
249#include GISMO_HPP_HEADER(gsMappedSpline.hpp)
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides declaration of DomainIterator abstract interface.
Provides declaration of Geometry abstract interface.
Provides declaration of Basis abstract interface.
Implementation of a piece of the gsMappedBasis.
Provides declaration of Basis abstract interface.
Provides declaration of the MultiPatch class.
The G+Smo namespace, containing all definitions for the library.