27#ifndef DUMUX_DISCRETIZATION_EXTRUSION_HH
28#define DUMUX_DISCRETIZATION_EXTRUSION_HH
30#include <dune/common/std/type_traits.hh>
41 static constexpr auto area(
const SCVF& scvf)
42 {
return scvf.area(); }
45 static constexpr auto volume(
const SCV& scv)
46 {
return scv.volume(); }
48 template<
class Geometry>
49 static constexpr auto integrationElement(
const Geometry& geo,
const typename Geometry::LocalCoordinate& x)
50 {
return geo.integrationElement(x); }
58template<
int radAx = 0>
68 static constexpr auto area(
const SCVF& scvf)
70 static_assert(int(SCVF::Traits::Geometry::mydimension) == int(SCVF::Traits::Geometry::coorddimension-1),
"Area element to be called with a codim-1-entity!");
71 static_assert(SCVF::Traits::Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
72 static_assert(
radialAxis < int(SCVF::Traits::Geometry::coorddimension),
"Illegal radial axis!");
75 return scvf.area()*2.0*M_PI*scvf.center()[
radialAxis];
83 static constexpr auto volume(
const SCV& scv)
85 static_assert(int(SCV::Traits::Geometry::mydimension) == int(SCV::Traits::Geometry::coorddimension),
"Volume element to be called with a codim-0-entity!");
86 static_assert(SCV::Traits::Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
87 static_assert(
radialAxis < int(SCV::Traits::Geometry::coorddimension),
"Illegal radial axis!");
90 return scv.volume()*2.0*M_PI*scv.center()[
radialAxis];
96 template<
class Geometry>
97 static constexpr auto integrationElement(
const Geometry& geo,
const typename Geometry::LocalCoordinate& x)
99 static_assert(Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
100 static_assert(
radialAxis < int(Geometry::coorddimension),
"Illegal radial axis!");
103 return geo.integrationElement(x)*2.0*M_PI*geo.global(x)[
radialAxis];
118 static constexpr auto area(
const SCVF& scvf)
120 static_assert(int(SCVF::Traits::Geometry::mydimension) == int(SCVF::Traits::Geometry::coorddimension-1),
"Area element to be called with a codim-1-entity!");
121 static_assert(SCVF::Traits::Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
124 const auto radius = scvf.center()[0];
125 return 4.0*M_PI*radius*radius;
133 static constexpr auto volume(
const SCV& scv)
135 static_assert(int(SCV::Traits::Geometry::mydimension) == int(SCV::Traits::Geometry::coorddimension),
"Volume element to be called with a codim-0-entity!");
136 static_assert(SCV::Traits::Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
139 const auto radius0 = scv.corner(0)[0];
140 const auto radius1 = scv.corner(1)[0];
142 return 4.0/3.0*M_PI*abs(radius1*radius1*radius1 - radius0*radius0*radius0);
148 template<
class Geometry>
149 static constexpr auto integrationElement(
const Geometry& geo,
const typename Geometry::LocalCoordinate& x)
151 static_assert(Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
155 const auto radius = geo.global(x)[0];
156 return geo.integrationElement(x)*4.0*M_PI*radius*radius;
168 using E =
typename G::Extrusion;
170 using type =
typename Dune::Std::detected_or<NoExtrusion, E, T>::type;
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:177
Default implementation that performs no extrusion (extrusion with identity)
Definition: extrusion.hh:39
static constexpr auto volume(const SCV &scv)
Definition: extrusion.hh:45
static constexpr auto integrationElement(const Geometry &geo, const typename Geometry::LocalCoordinate &x)
Definition: extrusion.hh:49
static constexpr auto area(const SCVF &scvf)
Definition: extrusion.hh:41
Rotation symmetric extrusion policy for rotating about an external axis.
Definition: extrusion.hh:60
static constexpr auto volume(const SCV &scv)
Transformed sub-control-volume volume.
Definition: extrusion.hh:83
static constexpr int radialAxis
Definition: extrusion.hh:61
static constexpr auto area(const SCVF &scvf)
Transformed sub-control-volume face area.
Definition: extrusion.hh:68
static constexpr auto integrationElement(const Geometry &geo, const typename Geometry::LocalCoordinate &x)
Integration element for quadrature rules on the reference element.
Definition: extrusion.hh:97
Rotation symmetric extrusion policy for spherical rotation.
Definition: extrusion.hh:112
static constexpr auto area(const SCVF &scvf)
Transformed sub-control-volume face area.
Definition: extrusion.hh:118
static constexpr auto integrationElement(const Geometry &geo, const typename Geometry::LocalCoordinate &x)
Integration element for quadrature rules on the reference element.
Definition: extrusion.hh:149
static constexpr auto volume(const SCV &scv)
Transformed sub-control-volume volume.
Definition: extrusion.hh:133
Traits extracting the public Extrusion type from T Defaults to NoExtrusion if no such type is found.
Definition: extrusion.hh:166
typename Dune::Std::detected_or< NoExtrusion, E, T >::type type
Definition: extrusion.hh:170