36 typedef memory::shared_ptr< gsAbsError >
Ptr;
39 typedef memory::unique_ptr< gsAbsError >
uPtr;
44 bool _f2param =
false)
45 : m_geo(geo), m_f1(f1), m_f2(f2), f2param(_f2param)
55 m_geo.eval_into(u, tmp);
58 result.noalias() = ( m_f1.eval(u) - m_f2.eval(tmp) ).cwiseAbs();
60 result.noalias() = ( m_f1.eval(u) - m_f2.eval(u) ).cwiseAbs();
68 std::ostream &
print(std::ostream &os)
const
69 { os <<
"Absolute error.\n";
return os; };
95 typedef memory::shared_ptr< gsGradientField >
Ptr;
98 typedef memory::unique_ptr< gsGradientField >
uPtr;
109 m_geo.eval_into(u, tmp);
110 m_f.deriv_into(tmp, result);
117 std::ostream &
print(std::ostream &os)
const
118 { os <<
"Gradient field of ";
return os; };
136 typedef memory::shared_ptr< gsJacDetField >
Ptr;
139 typedef memory::unique_ptr< gsJacDetField >
uPtr;
142 : m_geo(geo), m_dim(m_geo.parDim())
144 GISMO_ENSURE(m_dim == m_geo.geoDim(),
"Not extended to surface case yet." );
151 result.resize(1, u.cols() );
153 for (
index_t k=0; k!= u.cols(); ++k)
154 result(0,k) = m_geo.deriv(u.col(k)).
reshape(m_dim,m_dim).determinant();
161 std::ostream &
print(std::ostream &os)
const
162 { os <<
"Jacobian determinant field of ";
return os; };
180 typedef memory::shared_ptr< gsNormalField >
Ptr;
183 typedef memory::unique_ptr< gsNormalField >
uPtr;
194 const short_t ParDim = m_geo.parDim();
195 result.resize(ParDim+1, u.cols()) ;
199 for(
index_t j=0; j < u.cols(); ++j )
201 Jk = m_geo.jacobian( u.col(j) );
204 for (
int i = 0; i <= ParDim; ++i)
207 result(i,j) = alt_sgn * mm.determinant();
217 std::ostream &
print(std::ostream &os)
const
218 { os <<
"NormalField";
return os; };
239 typedef memory::shared_ptr< gsParamField >
Ptr;
242 typedef memory::unique_ptr< gsParamField >
uPtr;
259 std::ostream &
print(std::ostream &os)
const
260 { os <<
"Parameter field.\n";
return os; };
281 typedef memory::shared_ptr< gsPatchIdField >
Ptr;
284 typedef memory::unique_ptr< gsPatchIdField >
uPtr;
287 : geo(geo_), m_supp(geo.support())
294 result.setZero(2, u.cols() );
295 result.row(0).setConstant(geo.id());
297 const int d = geo.parDim();
300 const index_t dir = c.direction();
301 const T par = m_supp(dir, c.parameter() );
303 for (
index_t v = 0; v != u.cols(); ++v)
305 if (
math::abs( u(dir,v) - par ) < 1e-2 )
306 result(1,v) =
static_cast<T
>(c);
315 std::ostream &
print(std::ostream &os)
const
316 { os <<
"Boundary side indicator field.\n";
return os; };
341 for (
size_t k=0; k< mp.
nPatches(); ++k)
353 for (
size_t k=0; k< mp.
nPatches(); ++k)
364 for (
size_t k=0; k< mp.
nPatches(); ++k)
376 for (
size_t k=0; k< mp.
nPatches(); ++k)
387 for (
size_t k=0; k< mp.
nPatches(); ++k)
396 for (
size_t k=0; k< mp.
nPatches(); ++k)
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsFieldCreator.h:157
Generates a field with value the absolute difference (error) between and isogeometric function and a ...
Definition: gsFieldCreator.h:32
short_t targetDim() const
Dimension of the target space.
Definition: gsFieldCreator.h:65
short_t targetDim() const
Dimension of the target space.
Definition: gsFieldCreator.h:256
Class that creates standard fields on a given parametric (multipatch) geometry.
Definition: gsFieldCreator.h:332
Abstract base class representing a geometry map.
Definition: gsGeometry.h:92
void rowMinor(index_t i, RowMinorMatrixType &result) const
Definition: gsMatrix.h:331
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsFieldCreator.h:161
memory::shared_ptr< gsJacDetField > Ptr
Shared pointer for gsJacDetField.
Definition: gsFieldCreator.h:136
A scalar of vector field defined on a m_parametric geometry.
Definition: gsField.h:54
const gsFunction< T > & function(int i=0) const
Returns the gsFunction of patch i.
Definition: gsField.h:231
#define short_t
Definition: gsConfig.h:35
static boxSide getFirst(short_t)
helper for iterating on sides of an n-dimensional box
Definition: gsBoundary.h:160
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsFieldCreator.h:259
memory::shared_ptr< gsPatchIdField > Ptr
Shared pointer for gsPatchIdField.
Definition: gsFieldCreator.h:281
Generates a field that attaches the parameter values on each physical point.
Definition: gsFieldCreator.h:235
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsFieldCreator.h:113
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsFieldCreator.h:213
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsFieldCreator.h:315
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsFieldCreator.h:255
memory::unique_ptr< gsNormalField > uPtr
Unique pointer for gsNormalField.
Definition: gsFieldCreator.h:183
memory::shared_ptr< gsParamField > Ptr
Shared pointer for gsParamField.
Definition: gsFieldCreator.h:239
memory::shared_ptr< gsGradientField > Ptr
Shared pointer for gsGradientField.
Definition: gsFieldCreator.h:95
memory::unique_ptr< gsPatchIdField > uPtr
Unique pointer for gsPatchIdField.
Definition: gsFieldCreator.h:284
#define index_t
Definition: gsConfig.h:32
#define GISMO_ENSURE(cond, message)
Definition: gsDebug.h:102
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsFieldCreator.h:217
A function from a n-dimensional domain to an m-dimensional image.
Definition: gsFunction.h:59
memory::unique_ptr< gsGradientField > uPtr
Unique pointer for gsGradientField.
Definition: gsFieldCreator.h:98
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition: gsMatrix.h:38
memory::unique_ptr< gsAbsError > uPtr
Unique pointer for gsAbsError.
Definition: gsFieldCreator.h:39
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsFieldCreator.h:192
memory::shared_ptr< gsNormalField > Ptr
Shared pointer for gsNormalField.
Definition: gsFieldCreator.h:180
const gsMultiPatch< T > & patches() const
Returns gsMultiPatch containing the geometric information on the domain.
Definition: gsField.h:210
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsFieldCreator.h:68
memory::unique_ptr< gsParamField > uPtr
Unique pointer for gsParamField.
Definition: gsFieldCreator.h:242
Generates a field that indicates the boundary sides on the geometry.
Definition: gsFieldCreator.h:277
static boxSide getEnd(short_t dim)
helper for iterating on sides of an n-dimensional box
Definition: gsBoundary.h:176
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsFieldCreator.h:311
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsFieldCreator.h:252
gsGeometry< T > & patch(size_t i) const
Return the i-th patch.
Definition: gsMultiPatch.h:226
size_t nPatches() const
Number of patches.
Definition: gsMultiPatch.h:208
short_t targetDim() const
Dimension of the target space.
Definition: gsFieldCreator.h:214
short_t domainDim() const
Dimension of the (source) domain.
Definition: gsFieldCreator.h:64
std::ostream & print(std::ostream &os) const
Prints the object as a string.
Definition: gsFieldCreator.h:117
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsFieldCreator.h:106
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition: gsMultiPatch.h:33
Struct which represents a certain side of a box.
Definition: gsBoundary.h:84
Generates a field with value the Jacobian determinant of a geometry.
Definition: gsFieldCreator.h:132
EIGEN_STRONG_INLINE reshape_expr< E > const reshape(E const &u, index_t n, index_t m)
Reshape an expression.
Definition: gsExpressions.h:1925
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsFieldCreator.h:149
Generates the normal field of a geometry.
Definition: gsFieldCreator.h:176
memory::unique_ptr< gsJacDetField > uPtr
Unique pointer for gsJacDetField.
Definition: gsFieldCreator.h:139
short_t targetDim() const
Dimension of the target space.
Definition: gsFieldCreator.h:158
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsFieldCreator.h:292
void eval_into(const gsMatrix< T > &u, gsMatrix< T > &result) const
Evaluate the function at points u into result.
Definition: gsFieldCreator.h:52
EIGEN_STRONG_INLINE abs_expr< E > abs(const E &u)
Absolute value.
Definition: gsExpressions.h:4486
Generates a field with value being the gradient of an isogeometric function.
Definition: gsFieldCreator.h:91
A function depending on an index i, typically referring to a patch/sub-domain. On each patch a differ...
Definition: gsPiecewiseFunction.h:28
short_t targetDim() const
Dimension of the target space.
Definition: gsFieldCreator.h:312
memory::shared_ptr< gsPiecewiseFunction > Ptr
Shared pointer for gsPiecewiseFunction.
Definition: gsPiecewiseFunction.h:37
memory::shared_ptr< gsAbsError > Ptr
Shared pointer for gsAbsError.
Definition: gsFieldCreator.h:36
short_t targetDim() const
Dimension of the target space.
Definition: gsFieldCreator.h:114
Provides declaration of the Field class.