38 typedef memory::shared_ptr< gsConstantBasis >
Ptr;
41 typedef memory::unique_ptr< gsConstantBasis >
uPtr;
49 : m_val( weight.value() ), m_domainDim(b->dim())
51 GISMO_ASSERT(weight.size() == 1,
"Something seems wrong.");
55 gsConstantBasis(
const std::vector<gsBasis<T>*> & rr)
56 : m_val( 1.0 ), m_domainDim(1)
59 GISMO_CLONE_FUNCTION(gsConstantBasis)
61 static gsConstantBasis * New(std::vector<gsBasis<T>*> & bb )
63 return new gsConstantBasis(bb);
74 result.setZero(1,u.cols());
79 GISMO_ASSERT(u.rows() == m_domainDim,
"Wrong domain dimension "<< u.rows()
80 <<
", expected "<< m_domainDim);
81 result.setConstant(1, u.cols(), m_val);
86 GISMO_ASSERT(u.rows() == m_domainDim,
"Wrong domain dimension "<< u.rows()
87 <<
", expected "<< m_domainDim);
96 std::ostream &
print(std::ostream &os)
const
105 return memory::unique_ptr<gsGeometry<T> >(
new gsConstantFunction<T>(coefs.transpose(), m_domainDim));
110 T value()
const {
return m_val;}
Class defining a dummy basis of constant functions. This is used for compatibility reasons...
Definition: gsConstantBasis.h:34
void active_into(const gsMatrix< T > &u, gsMatrix< index_t > &result) const
Returns the indices of active basis functions at points u, as a list of indices, in result...
Definition: gsConstantBasis.h:72
memory::shared_ptr< gsConstantBasis > Ptr
Shared pointer for gsConstantBasis.
Definition: gsConstantBasis.h:38
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates nonzero basis functions at point u into result.
Definition: gsConstantBasis.h:77
virtual void anchors_into(gsMatrix< T > &result) const
Returns the anchor points that represent the members of the basis in result. There is exactly one anc...
Definition: gsConstantBasis.h:91
#define short_t
Definition: gsConfig.h:35
Provides declaration of ConstantFunction class.
#define index_t
Definition: gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsConstantBasis.h:68
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsConstantBasis.h:96
memory::unique_ptr< gsConstantBasis > uPtr
Unique pointer for gsConstantBasis.
Definition: gsConstantBasis.h:41
void deriv_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluates the first partial derivatives of the nonzero basis function.
Definition: gsConstantBasis.h:84
index_t size() const
size
Definition: gsConstantBasis.h:70
This is the main header file that collects wrappers of Eigen for linear algebra.
memory::unique_ptr< gsGeometry< T > > makeGeometry(gsMatrix< T > coefs) const
Create a gsGeometry of proper type for this basis with the given coefficient matrix.
Definition: gsConstantBasis.h:102
A basis represents a family of scalar basis functions defined over a common parameter domain...
Definition: gsBasis.h:78
Class defining a globally constant function.
Definition: gsConstantFunction.h:33