5#ifndef DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
6#define DUNE_GRID_ALBERTAGRID_GEOMETRYREFERENCE_HH
12#include <dune/common/typetraits.hh>
14#include <dune/geometry/type.hh>
24 template<
class Implementation >
33 typedef typename Implementation::ctype
ctype;
43 template<
class Implementation_T>
44 using JacobianInverseOfImplementation =
decltype(
typename Implementation_T::JacobianInverse{std::declval<Implementation_T>().jacobianInverse(std::declval<LocalCoordinate>())});
46 using JacobianInverseDefault =
decltype(transpose(std::declval<JacobianInverseTransposed>()));
48 template<
class Implementation_T>
49 using JacobianOfImplementation =
decltype(
typename Implementation_T::Jacobian{std::declval<Implementation_T>().jacobian(std::declval<LocalCoordinate>())});
51 using JacobianDefault =
decltype(transpose(std::declval<JacobianTransposed>()));
54 template <
class I = Implementation>
55 [[deprecated(
"Geometry implementatons are required to provide a jacobian(local) method. The default implementation is deprecated and will be removed after release 2.9")]]
60 template <
class I = Implementation>
61 [[deprecated(
"Geometry implementatons are required to provide a jacobianInverse(local) method. The default implementation is deprecated and will be removed after release 2.9")]]
62 auto deprecatedDefaultJacobianInverse (
const LocalCoordinate& local )
const {
68 using Jacobian = Std::detected_or_t<JacobianDefault, JacobianOfImplementation, Implementation>;
69 using JacobianInverse = Std::detected_or_t<JacobianInverseDefault, JacobianInverseOfImplementation, Implementation>;
85 return impl().global( local );
95 return impl().integrationElement( local );
102 return impl().jacobianTransposed( local );
107 return impl().jacobianInverseTransposed( local );
112 if constexpr(Std::is_detected_v<JacobianOfImplementation, Implementation>)
113 return impl().jacobian(local);
115 return deprecatedDefaultJacobian(local);
120 if constexpr(Std::is_detected_v<JacobianInverseOfImplementation, Implementation>)
121 return impl().jacobianInverse(local);
123 return deprecatedDefaultJacobianInverse(local);
126 const Implementation &
impl ()
const {
return *impl_; }
129 const Implementation *impl_;
136 template<
int mydim,
int cdim,
class Gr
id >
138 :
public GeometryReference< typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl >
140 typedef typename std::remove_const< Grid >::type::Traits::template Codim< std::remove_const< Grid >::type::dimension - mydim >::LocalGeometryImpl Implementation;
153 template<
class Implementation >
156 template<
class Implementation >
Include standard header files.
Definition: agrid.hh:60
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
Definition: geometryreference.hh:26
static const int mydimension
Definition: geometryreference.hh:30
ctype integrationElement(const LocalCoordinate &local) const
Definition: geometryreference.hh:93
ctype volume() const
Definition: geometryreference.hh:98
const Implementation & impl() const
Definition: geometryreference.hh:126
JacobianInverse jacobianInverse(const LocalCoordinate &local) const
Definition: geometryreference.hh:118
GlobalCoordinate center() const
Definition: geometryreference.hh:81
Implementation::JacobianTransposed JacobianTransposed
Definition: geometryreference.hh:39
GeometryReference(const Implementation &impl)
Definition: geometryreference.hh:71
Std::detected_or_t< JacobianInverseDefault, JacobianInverseOfImplementation, Implementation > JacobianInverse
Definition: geometryreference.hh:69
Implementation::GlobalCoordinate GlobalCoordinate
Definition: geometryreference.hh:36
static const int coorddimension
Definition: geometryreference.hh:31
bool affine() const
Definition: geometryreference.hh:77
GlobalCoordinate corner(int i) const
Definition: geometryreference.hh:80
JacobianInverseTransposed jacobianInverseTransposed(const LocalCoordinate &local) const
Definition: geometryreference.hh:105
JacobianTransposed jacobianTransposed(const LocalCoordinate &local) const
Definition: geometryreference.hh:100
int corners() const
Definition: geometryreference.hh:79
Implementation::LocalCoordinate LocalCoordinate
Definition: geometryreference.hh:35
GlobalCoordinate global(const LocalCoordinate &local) const
Definition: geometryreference.hh:83
Std::detected_or_t< JacobianDefault, JacobianOfImplementation, Implementation > Jacobian
Definition: geometryreference.hh:68
Implementation::ctype ctype
Definition: geometryreference.hh:33
Implementation::JacobianInverseTransposed JacobianInverseTransposed
Definition: geometryreference.hh:38
Jacobian jacobian(const LocalCoordinate &local) const
Definition: geometryreference.hh:110
GeometryType type() const
Definition: geometryreference.hh:75
Definition: geometryreference.hh:139
LocalGeometryReference(const Implementation &impl)
Definition: geometryreference.hh:143
Wrapper and interface classes for element geometries.