G+Smo  25.01.0
Geometry + Simulation Modules
 
Loading...
Searching...
No Matches
gsAffineFunction.h
Go to the documentation of this file.
1
15#pragma once
16
18#include <gsCore/gsFunction.h>
19
20namespace gismo {
21
28template <typename T>
30{
31protected:
32 gsMatrix<T> m_mat;
33 gsMatrix<T> m_box1, m_box2;
34 gsVector<T> m_trans;
35public:
37 typedef memory::shared_ptr< gsAffineFunction > Ptr;
38
40 typedef memory::unique_ptr< gsAffineFunction > uPtr;
41
46 : m_mat(other.m_mat), m_trans(other.m_trans)
47 {}
48
49 GISMO_CLONE_FUNCTION(gsAffineFunction)
50
51
57 gsAffineFunction(const gsMatrix<T> mat, const gsVector<T> trans);
58
67 gsAffineFunction(const gsVector<index_t> &directions, const gsVector<bool> &orientation, const gsMatrix<T> &box1, const gsMatrix<T> &box2);
68
75 static uPtr make(const gsMatrix<T> mat, const gsVector<T> trans)
76 { return uPtr(new gsAffineFunction(mat, trans)); }
77
86 static uPtr make(const gsVector<index_t> &directions, const gsVector<bool> &orientation, const gsMatrix<T> &box1, const gsMatrix<T> &box2)
87 { return uPtr(new gsAffineFunction(directions, orientation, box1, box2)); }
88
89 const gsMatrix<T> & matrix() const { return m_mat; }
90 const gsVector<T> & translation() const { return m_trans; }
91
92 virtual short_t domainDim() const;
93 virtual short_t targetDim() const;
94 virtual void eval_into(const gsMatrix<T>& u, gsMatrix<T>& result) const;
95 virtual void eval_component_into(const gsMatrix<T>& u,
96 const index_t comp,
97 gsMatrix<T>& result) const;
98 virtual void deriv_into(const gsMatrix<T>& u, gsMatrix<T>& result) const;
99 virtual void deriv2_into( const gsMatrix<T>& u, gsMatrix<T>& result ) const;
100};
101
102
103} // namespace gismo
104
105#ifndef GISMO_BUILD_LIB
106#include GISMO_HPP_HEADER(gsAffineFunction.hpp)
107#endif
Representation of an affine function.
Definition gsAffineFunction.h:30
virtual void deriv2_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate second derivatives of the function at points u into result.
Definition gsAffineFunction.hpp:100
gsAffineFunction(const gsAffineFunction &other)
copy constructor
Definition gsAffineFunction.h:45
virtual short_t targetDim() const
Dimension of the target space.
Definition gsAffineFunction.hpp:58
virtual void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition gsAffineFunction.hpp:64
static uPtr make(const gsMatrix< T > mat, const gsVector< T > trans)
Affine maps are the composition of a linear map with a translation this constructor takes the two com...
Definition gsAffineFunction.h:75
memory::unique_ptr< gsAffineFunction > uPtr
Unique pointer for gsAffineFunction.
Definition gsAffineFunction.h:40
static uPtr make(const gsVector< index_t > &directions, const gsVector< bool > &orientation, const gsMatrix< T > &box1, const gsMatrix< T > &box2)
Construct the affine map that maps box1 to box2 by mapping coordinate i of box1 to coordinate directi...
Definition gsAffineFunction.h:86
virtual void eval_component_into(const gsMatrix< T > &u, const index_t comp, gsMatrix< T > &result) const
Evaluate the function for component comp in the target dimension at points u into result.
Definition gsAffineFunction.hpp:72
virtual short_t domainDim() const
Dimension of the (source) domain.
Definition gsAffineFunction.hpp:52
virtual void deriv_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate derivatives of the function at points u into result.
Definition gsAffineFunction.hpp:82
memory::shared_ptr< gsAffineFunction > Ptr
Shared pointer for gsAffineFunction.
Definition gsAffineFunction.h:37
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
Provides declaration of Function abstract interface.
This is the main header file that collects wrappers of Eigen for linear algebra.
The G+Smo namespace, containing all definitions for the library.