3#ifndef DUNE_GEOGRID_COORDFUNCTION_HH
4#define DUNE_GEOGRID_COORDFUNCTION_HH
9#include <dune/common/std/type_traits.hh>
17 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
18 class AnalyticalCoordFunction;
20 template<
class ct,
unsigned int dimR,
class Impl >
21 class DiscreteCoordFunction;
40 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
49 typedef Impl Implementation;
69 This &operator= (
const This & ) =
default;
70 This &operator= (
This && ) =
default;
73 template<
typename F,
typename DV>
74 using has_operator_parentheses =
decltype(std::declval<F>()(std::declval<DV>()));
103 "You need to implement either operator() or evaluate() in your coordinate function!");
104 asImp().evaluate( x, y );
111 const Implementation &asImp ()
const
113 return static_cast< const Implementation &
>( *this );
116 Implementation &asImp ()
118 return static_cast< Implementation &
>( *this );
129 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
145 This &operator= (
const This & ) =
default;
146 This &operator= (
This && ) =
default;
171 template<
class ct,
unsigned int dimR,
class Impl >
180 typedef Impl Implementation;
196 This &operator= (
const This & ) =
default;
197 This &operator= (
This && ) =
default;
205 template<
class HostEntity >
206 void evaluate (
const HostEntity &hostEntity,
unsigned int corner,
209 asImp().evaluate( hostEntity, corner, y );
221 const Implementation &asImp ()
const
223 return static_cast< const Implementation &
>( *this );
226 Implementation &asImp ()
228 return static_cast< Implementation &
>( *this );
240 template<
class ct,
unsigned int dimR,
class Impl >
255 This &operator= (
const This & ) =
default;
256 This &operator= (
This && ) =
default;
262 template<
class HostEntity >
263 void evaluate (
const HostEntity &hostEntity,
unsigned int corner,
275 template<
class CoordFunctionInterface >
276 struct isCoordFunctionInterface
278 static const bool value =
false;
281 template<
class ct,
unsigned int dimD,
unsigned int dimR,
class Impl >
282 struct isCoordFunctionInterface
283 < AnalyticalCoordFunctionInterface< ct, dimD, dimR, Impl > >
285 static const bool value =
true;
288 template<
class ct,
unsigned int dimR,
class Impl >
289 struct isCoordFunctionInterface
290 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >
292 static const bool value =
true;
300 template<
class CoordFunctionInterface >
301 struct isDiscreteCoordFunctionInterface
303 static const bool value =
false;
306 template<
class ct,
unsigned int dimR,
class Impl >
307 struct isDiscreteCoordFunctionInterface
308 < DiscreteCoordFunctionInterface< ct, dimR, Impl > >
310 static const bool value =
true;
318 template<
class CoordFunctionInterface >
319 struct AdaptCoordFunction
321 static void adapt ( CoordFunctionInterface &coordFunction )
325 template<
class ct,
unsigned int dimR,
class Impl >
326 struct AdaptCoordFunction< DiscreteCoordFunctionInterface< ct, dimR, Impl > >
328 typedef DiscreteCoordFunctionInterface< ct, dimR, Impl > CoordFunctionInterface;
330 static void adapt ( CoordFunctionInterface &coordFunction )
332 coordFunction.adapt();
Interface class for using an analytical function to define the geometry of a Dune::GeometryGrid....
Definition: coordfunction.hh:42
FieldVector< ctype, dimRange > RangeVector
range vector for the evaluate method
Definition: coordfunction.hh:62
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:57
ct ctype
field type of the coordinate vector
Definition: coordfunction.hh:52
static const unsigned int dimDomain
dimension of the range vector (dimensionworld of host grid)
Definition: coordfunction.hh:55
FieldVector< ctype, dimDomain > DomainVector
domain vector for the evaluate method
Definition: coordfunction.hh:60
Derive an implementation of an analytical coordinate function from this class.
Definition: coordfunction.hh:132
Interface class for using a discrete function to define the geometry of a Dune::GeometryGrid....
Definition: coordfunction.hh:173
static const unsigned int dimRange
dimension of the range vector
Definition: coordfunction.hh:186
void evaluate(const HostEntity &hostEntity, unsigned int corner, RangeVector &y) const
evaluate method
Definition: coordfunction.hh:206
ct ctype
field type of the coordinate vector
Definition: coordfunction.hh:183
void adapt()
method called from grid.adapt() method to allow adaptation of the discrete coordinate function
Definition: coordfunction.hh:215
FieldVector< ctype, dimRange > RangeVector
range vector for the evaluate method
Definition: coordfunction.hh:189
Derive an implementation of a discrete coordinate function from this class.
Definition: coordfunction.hh:243
vector space out of a tensor product of fields.
Definition: fvector.hh:93
Implements a vector constructed from a given type representing a field and a compile-time given size.
typename detected_or< nonesuch, Op, Args... >::value_t is_detected
Detects whether Op<Args...> is valid.
Definition: type_traits.hh:340
Dune namespace.
Definition: alignedallocator.hh:10