19 template<
short_t d,
class T>
20 gsMappedSpline<d,T>::gsMappedSpline(
const gsMultiPatch<T> & mp,
const gsSparseMatrix<T> & m )
23 m_mbases =
new gsMappedBasis<d,T>(gsMultiBasis<T>(mp),m);
26 gsMatrix<T> local = mp.coefs();
27 m_mbases->local_coef_to_global_coef(local,m_global);
32 template<
short_t d,
class T>
33 gsMappedSpline<d,T>::gsMappedSpline(
const gsMappedBasis<d,T> & mbases,
const gsMatrix<T> & coefs )
37 m_mbases=mbases.clone().release();
41 template<
short_t d,
class T>
42 gsMappedSpline<d,T>::gsMappedSpline(
const gsMappedSpline& other )
43 : gsFunctionSet<T>(), m_global(other.m_global)
45 m_mbases=other.m_mbases->clone().release();
48 template<
short_t d,
class T>
49 gsMappedSpline<d,T> & gsMappedSpline<d,T>::operator=(
const gsMappedSpline& other )
52 m_mbases=other.m_mbases->clone().release();
53 m_global = other.m_global;
55 for (
auto & s : m_ss) s.setSource(*
this);
59 template<
short_t d,
class T>
60 void gsMappedSpline<d,T>::eval_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const
62 gsMatrix<index_t> actives;
76 result.resize( N,u.cols());
78 for (
index_t k = 0; k!=u.cols(); k++)
80 m_mbases->active_into(patch,u.col(k),actives);
81 m_mbases->eval_into(patch,u.col(k),evals);
82 m_mbases->getBase(patch).linearCombination_into(m_global,actives,evals,tmp);
88 template<
short_t d,
class T>
89 void gsMappedSpline<d,T>::deriv_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const
91 gsMatrix<index_t> actives;
96 result.resize( N * M,u.cols());
100 for (
index_t k = 0; k!=u.cols(); k++)
102 m_mbases->active_into(patch,u.col(k),actives);
103 m_mbases->deriv_into(patch,u.col(k),evals);
104 m_mbases->getBase(patch).linearCombination_into(m_global,actives,evals,tmp);
109 template<
short_t d,
class T>
110 void gsMappedSpline<d,T>::deriv2_into(
const unsigned patch,
const gsMatrix<T> & u, gsMatrix<T>& result )
const
112 gsMatrix<index_t> actives;
118 result.resize( S*N,u.cols());
121 for (
index_t k = 0; k!=u.cols(); k++)
123 m_mbases->active_into(patch,u.col(k),actives);
124 m_mbases->deriv2_into(patch,u.col(k),evals);
125 m_mbases->getBase(patch).linearCombination_into(m_global,actives,evals,tmp);
130 template<
short_t d,
class T>
131 void gsMappedSpline<d,T>::evalAllDers_into(
const unsigned patch,
const gsMatrix<T> & u,
132 const int n, std::vector<gsMatrix<T> >& result,
133 bool sameElement)
const
137 gsMatrix<index_t> actives;
138 std::vector< gsMatrix<T> > evals;
144 std::vector<index_t> blocksizes(3);
151 for(
int i = 0; i <= n; i++)
153 result[i].resize(blocksizes[i],u.cols());
155 for (
index_t k = 0; k!=u.cols(); k++)
157 m_mbases->active_into(patch,u.col(k),actives);
158 m_mbases->evalAllDers_into(patch,u.col(k),n,evals,sameElement);
159 m_mbases->getBase(patch).linearCombination_into(m_global,actives,evals[i],tmp);
160 result[i].col(k) = tmp;
182 template<
short_t d,
class T>
183 gsMultiPatch<T> gsMappedSpline<d,T>::exportToPatches()
const
186 m_mbases->global_coef_to_local_coef(m_global,local);
187 return m_mbases->exportToPatches(local);
190 template<
short_t d,
class T>
191 gsGeometry<T> * gsMappedSpline<d,T>::exportPatch(
int i,gsMatrix<T>
const & localCoef)
const
193 return m_mbases->exportPatch(i,localCoef);
#define index_t
Definition: gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
Provides declaration of Basis abstract interface.