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" );
114template<
class T>
void
117 GISMO_ASSERT( i<
unsigned(m_function->targetDim()),
"Invalid coordinate" );
121template<
class T>
void
128template<
class T>
bool
131 return ( ++m_index[0] <
static_cast<index_t>(m_function->targetDim()) );
134template<
class T>
bool
137 return ( m_index[0] <
static_cast<index_t>(m_function->targetDim()) );
143 return m_function->support();
146template<
class T>
void
150 m_function->eval_into(u, tmp);
151 result = tmp(m_index, gsEigen::all);
154template<
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);
165template<
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);
Represents a certain component of a vector-valued function.
Definition gsFuncCoordinate.h:35
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
gsFuncCoordinate()
Default empty constructor.
Definition gsFuncCoordinate.h:38
bool valid()
Return false if the the function iteration is invalidated.
Definition gsFuncCoordinate.h:135
memory::shared_ptr< gsFuncCoordinate > Ptr
Shared pointer for gsFuncCoordinate.
Definition gsFuncCoordinate.h:41
void first()
Point to the first coordinate.
Definition gsFuncCoordinate.h:122
short_t targetDim() const
Dimension of the target space.
Definition gsFuncCoordinate.h:60
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition gsFuncCoordinate.h:147
bool next()
Definition gsFuncCoordinate.h:129
virtual const gsFuncCoordinate & piece(const index_t k) const
Returns the piece(s) of the function(s) at subdomain k.
Definition gsFuncCoordinate.h:87
void setCoordinate(unsigned const &i)
Definition gsFuncCoordinate.h:115
short_t domainDim() const
Dimension of the (source) domain.
Definition gsFuncCoordinate.h:58
memory::unique_ptr< gsFuncCoordinate > uPtr
Unique pointer for gsFuncCoordinate.
Definition gsFuncCoordinate.h:44
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
Interface for the set of functions defined on a domain (the total number of functions in the set equa...
Definition gsFunctionSet.h:219
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
A function from a n-dimensional domain to an m-dimensional image.
Definition gsFunction.h:60
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define short_t
Definition gsConfig.h:35
#define index_t
Definition gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
This is the interface of all objects that computes functions on points like gsBasis,...
Provides declaration of Function abstract interface.
The G+Smo namespace, containing all definitions for the library.
S give(S &x)
Definition gsMemory.h:266