5#ifndef DUNE_GEOGRID_COORDFUNCTION_HH
6#define DUNE_GEOGRID_COORDFUNCTION_HH
10#include <dune/common/fvector.hh>
11#include <dune/common/std/type_traits.hh>
19 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
20 class AnalyticalCoordFunction;
22 template<
class ct,
unsigned int dimR,
class Impl >
23 class DiscreteCoordFunction;
42 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
71 This &operator= (
const This & ) =
default;
72 This &operator= (
This && ) =
default;
75 template<
typename F,
typename DV>
76 using has_operator_parentheses =
decltype(std::declval<F>()(std::declval<DV>()));
89 Std::is_detected<has_operator_parentheses,Impl,DV>::value
98 not Std::is_detected<has_operator_parentheses,Impl,DV>::value
105 "You need to implement either operator() or evaluate() in your coordinate function!");
106 asImp().evaluate( x, y );
131 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
173 template<
class ct,
unsigned int dimR,
class Impl >
198 This &operator= (
const This & ) =
default;
199 This &operator= (
This && ) =
default;
210 template<
class HostEntity >
211 void evaluate (
const HostEntity &hostEntity,
unsigned int corner,
214 asImp().evaluate( hostEntity, corner, y );
245 template<
class ct,
unsigned int dimR,
class Impl >
267 template<
class HostEntity >
268 void evaluate (
const HostEntity &hostEntity,
unsigned int corner,
280 template<
class CoordFunctionInterface >
286 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
290 static const bool value =
true;
293 template<
class ct,
unsigned int dimR,
class Impl >
294 struct isCoordFunctionInterface
297 static const bool value =
true;
305 template<
class CoordFunctionInterface >
311 template<
class ct,
unsigned int dimR,
class Impl >
315 static const bool value =
true;
323 template<
class CoordFunctionInterface >
326 static void adapt ( CoordFunctionInterface & )
330 template<
class ct,
unsigned int dimR,
class Impl >
335 static void adapt ( CoordFunctionInterface &coordFunction )
337 coordFunction.adapt();
Include standard header files.
Definition: agrid.hh:60
Derive an implementation of an analytical coordinate function from this class.
Definition: coordfunction.hh:134
Base::DomainVector DomainVector
Definition: coordfunction.hh:139
AnalyticalCoordFunction()=default
~AnalyticalCoordFunction()=default
AnalyticalCoordFunction(This &&)=default
Base::RangeVector RangeVector
Definition: coordfunction.hh:140
This & operator=(const This &)=default
AnalyticalCoordFunction(const This &)=default
Derive an implementation of a discrete coordinate function from this class.
Definition: coordfunction.hh:248
This & operator=(const This &)=default
void adapt()
Definition: coordfunction.hh:263
DiscreteCoordFunction()=default
DiscreteCoordFunction(This &&)=default
~DiscreteCoordFunction()=default
DiscreteCoordFunction(const This &)=default
Base::RangeVector RangeVector
Definition: coordfunction.hh:253
Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid....
Definition: coordfunction.hh:44
Impl Implementation
Definition: coordfunction.hh:51
FieldVector< ctype, dimRange > RangeVector
range vector for the evaluate method
Definition: coordfunction.hh:64
void evaluate(const DomainVector &x, RangeVector &y) const
evaluate method for global mapping
static const unsigned int dimRange
dimension of the range vector
Definition: coordfunction.hh:59
ct ctype
field type of the coordinate vector
Definition: coordfunction.hh:54
static const unsigned int dimDomain
dimension of the range vector (dimensionworld of host grid)
Definition: coordfunction.hh:57
const Implementation & asImp() const
Definition: coordfunction.hh:113
This Interface
Definition: coordfunction.hh:50
Implementation & asImp()
Definition: coordfunction.hh:118
FieldVector< ctype, dimDomain > DomainVector
domain vector for the evaluate method
Definition: coordfunction.hh:62
Interface class for using a discrete function to define the geometry of a Dune::GeometryGrid....
Definition: coordfunction.hh:175
static const unsigned int dimRange
dimension of the range vector
Definition: coordfunction.hh:188
void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector &y) const
evaluate method
Definition: coordfunction.hh:211
Implementation & asImp()
Definition: coordfunction.hh:231
ct ctype
field type of the coordinate vector
Definition: coordfunction.hh:185
void adapt()
method called from grid.adapt() method to allow adaptation of the discrete coordinate function
Definition: coordfunction.hh:220
FieldVector< ctype, dimRange > RangeVector
range vector for the evaluate method
Definition: coordfunction.hh:191
const Implementation & asImp() const
Definition: coordfunction.hh:226
Impl Implementation
Definition: coordfunction.hh:182
This Interface
Definition: coordfunction.hh:181
Definition: coordfunction.hh:282
static const bool value
Definition: coordfunction.hh:283
Definition: coordfunction.hh:307
static const bool value
Definition: coordfunction.hh:308
Definition: coordfunction.hh:325
static void adapt(CoordFunctionInterface &)
Definition: coordfunction.hh:326