41 typedef memory::shared_ptr< gsFuncCoordinate >
Ptr;
44 typedef memory::unique_ptr< gsFuncCoordinate >
uPtr;
84 index_t index()
const {
return m_index.value(); }
89 auto it = m_pieces.find(k);
90 if (m_pieces.end()!=it)
return it->second;
91 std::pair<
typename std::map<index_t,gsFuncCoordinate>::iterator,
bool> ins;
92 # pragma omp critical (m_pieces_touch)
94 return ins.first->second;
102 mutable std::map<index_t,gsFuncCoordinate> m_pieces;
108 : m_function(&function), m_index(1)
110 GISMO_ASSERT( i<
unsigned(m_function->targetDim()),
"Invalid coordinate" );
114 template<
class T>
void
117 GISMO_ASSERT( i<
unsigned(m_function->targetDim()),
"Invalid coordinate" );
121 template<
class T>
void
128 template<
class T>
bool
131 return ( ++m_index[0] < static_cast<index_t>(m_function->targetDim()) );
134 template<
class T>
bool
137 return ( m_index[0] < static_cast<index_t>(m_function->targetDim()) );
143 return m_function->support();
146 template<
class T>
void
150 m_function->eval_into(u, tmp);
151 result = tmp(m_index, gsEigen::all);
154 template<
class T>
void
158 m_function->deriv_into(u, tmp);
159 const index_t stride = domainDim();
160 result.resize(m_index.size()*stride, u.cols() );
161 for (
index_t i = 0; i != m_index.size(); ++i)
162 result.middleRows(i*stride,stride) = tmp.middleRows(stride*m_index[i], stride);
165 template<
class T>
void
169 m_function->deriv2_into(u, tmp);
170 const index_t dim = domainDim();
171 const index_t stride = dim*(dim+1)/2;
172 result.resize(m_index.size()*stride, u.cols() );
173 for (
index_t i = 0; i != m_index.size(); ++i)
174 result.middleRows(i*stride,stride) = tmp.middleRows(stride*m_index[i], stride);
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsFuncCoordinate.h:147
void setCoordinate(unsigned const &i)
Definition: gsFuncCoordinate.h:115
virtual const gsFuncCoordinate & piece(const index_t k) const
Returns the piece(s) of the function(s) at subdomain k.
Definition: gsFuncCoordinate.h:87
short_t targetDim() const
Dimension of the target space.
Definition: gsFuncCoordinate.h:60
#define short_t
Definition: gsConfig.h:35
const gsFunction< T > & function(const index_t k) const
Helper which casts and returns the k-th piece of this function set as a gsFunction.
Definition: gsFunctionSet.hpp:25
S give(S &x)
Definition: gsMemory.h:266
#define index_t
Definition: gsConfig.h:32
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
void first()
Point to the first coordinate.
Definition: gsFuncCoordinate.h:122
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsFuncCoordinate.h:58
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition: gsFuncData.h:23
gsFuncCoordinate()
Default empty constructor.
Definition: gsFuncCoordinate.h:38
memory::unique_ptr< gsFuncCoordinate > uPtr
Unique pointer for gsFuncCoordinate.
Definition: gsFuncCoordinate.h:44
bool next()
Definition: gsFuncCoordinate.h:129
Represents a certain component of a vector-valued function.
Definition: gsFuncCoordinate.h:34
This is the interface of all objects that computes functions on points like gsBasis, gsGeometry and gsFunctions.
Provides declaration of Function abstract interface.
memory::shared_ptr< gsFuncCoordinate > Ptr
Shared pointer for gsFuncCoordinate.
Definition: gsFuncCoordinate.h:41
bool valid()
Return false if the the function iteration is invalidated.
Definition: gsFuncCoordinate.h:135
void deriv2_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate second derivatives of the function at points u into result.
Definition: gsFuncCoordinate.h:166
void deriv_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate derivatives of the function at points u into result.
Definition: gsFuncCoordinate.h:155