27#ifndef DUMUX_DISCRETIZATION_EXTRUSION_HH
28#define DUMUX_DISCRETIZATION_EXTRUSION_HH
30#include <dune/common/std/type_traits.hh>
42 [[deprecated(
"Will be removed after 3.6. Use area(fvGeometry, scvf)")]]
43 static constexpr auto area(
const SCVF& scvf)
44 {
return scvf.area(); }
47 [[deprecated(
"Will be removed after 3.6. Use volume(fvGeometry, scv)")]]
48 static constexpr auto volume(
const SCV& scv)
49 {
return scv.volume(); }
51 template<
class FVGeo,
class SCVF>
52 static constexpr auto area(
const FVGeo&,
const SCVF& scvf)
53 {
return scvf.area(); }
55 template<
class FVGeo,
class SCV>
56 static constexpr auto volume(
const FVGeo&,
const SCV& scv)
57 {
return scv.volume(); }
59 template<
class Geometry>
60 static constexpr auto integrationElement(
const Geometry& geo,
const typename Geometry::LocalCoordinate& x)
61 {
return geo.integrationElement(x); }
69template<
int radAx = 0>
79 [[deprecated(
"Will be removed after 3.6. Use area(fvGeometry, scvf)")]]
80 static constexpr auto area(
const SCVF& scvf)
82 static_assert(int(SCVF::Traits::Geometry::mydimension) == int(SCVF::Traits::Geometry::coorddimension-1),
"Area element to be called with a codim-1-entity!");
83 static_assert(SCVF::Traits::Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
84 static_assert(
radialAxis < int(SCVF::Traits::Geometry::coorddimension),
"Illegal radial axis!");
87 return scvf.area()*2.0*M_PI*scvf.center()[
radialAxis];
90 template<
class FVGeo,
class SCVF>
91 static constexpr auto area(
const FVGeo&,
const SCVF& scvf)
93 static_assert(int(SCVF::Traits::Geometry::mydimension) == int(SCVF::Traits::Geometry::coorddimension-1),
"Area element to be called with a codim-1-entity!");
94 static_assert(SCVF::Traits::Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
95 static_assert(
radialAxis < int(SCVF::Traits::Geometry::coorddimension),
"Illegal radial axis!");
98 return scvf.area()*2.0*M_PI*scvf.center()[
radialAxis];
106 [[deprecated(
"Will be removed after 3.6. Use volume(fvGeometry, scv)")]]
107 static constexpr auto volume(
const SCV& scv)
109 static_assert(int(SCV::Traits::Geometry::mydimension) == int(SCV::Traits::Geometry::coorddimension),
"Volume element to be called with a codim-0-entity!");
110 static_assert(SCV::Traits::Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
111 static_assert(
radialAxis < int(SCV::Traits::Geometry::coorddimension),
"Illegal radial axis!");
114 return scv.volume()*2.0*M_PI*scv.center()[
radialAxis];
117 template<
class FVGeo,
class SCV>
118 static constexpr auto volume(
const FVGeo&,
const SCV& scv)
120 static_assert(int(SCV::Traits::Geometry::mydimension) == int(SCV::Traits::Geometry::coorddimension),
"Volume element to be called with a codim-0-entity!");
121 static_assert(SCV::Traits::Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
122 static_assert(
radialAxis < int(SCV::Traits::Geometry::coorddimension),
"Illegal radial axis!");
125 return scv.volume()*2.0*M_PI*scv.center()[
radialAxis];
131 template<
class Geometry>
132 static constexpr auto integrationElement(
const Geometry& geo,
const typename Geometry::LocalCoordinate& x)
134 static_assert(Geometry::coorddimension <= 2,
"Axis rotation only makes sense for geometries up to 2D!");
135 static_assert(
radialAxis < int(Geometry::coorddimension),
"Illegal radial axis!");
138 return geo.integrationElement(x)*2.0*M_PI*geo.global(x)[
radialAxis];
153 [[deprecated(
"Will be removed after 3.6. Use area(fvGeometry, scvf)")]]
154 static constexpr auto area(
const SCVF& scvf)
156 static_assert(int(SCVF::Traits::Geometry::mydimension) == int(SCVF::Traits::Geometry::coorddimension-1),
"Area element to be called with a codim-1-entity!");
157 static_assert(SCVF::Traits::Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
160 const auto radius = scvf.center()[0];
161 return 4.0*M_PI*radius*radius;
164 template<
class FVGeo,
class SCVF>
165 static constexpr auto area(
const FVGeo&,
const SCVF& scvf)
167 static_assert(int(SCVF::Traits::Geometry::mydimension) == int(SCVF::Traits::Geometry::coorddimension-1),
"Area element to be called with a codim-1-entity!");
168 static_assert(SCVF::Traits::Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
171 const auto radius = scvf.center()[0];
172 return 4.0*M_PI*radius*radius;
180 [[deprecated(
"Will be removed after 3.6. Use volume(fvGeometry, scv)")]]
181 static constexpr auto volume(
const SCV& scv)
183 static_assert(int(SCV::Traits::Geometry::mydimension) == int(SCV::Traits::Geometry::coorddimension),
"Volume element to be called with a codim-0-entity!");
184 static_assert(SCV::Traits::Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
187 const auto radius0 = scv.corner(0)[0];
188 const auto radius1 = scv.corner(1)[0];
190 return 4.0/3.0*M_PI*abs(radius1*radius1*radius1 - radius0*radius0*radius0);
193 template<
class FVGeo,
class SCV>
194 static constexpr auto volume(
const FVGeo& fvGeometry,
const SCV& scv)
196 static_assert(int(SCV::Traits::Geometry::mydimension) == int(SCV::Traits::Geometry::coorddimension),
"Volume element to be called with a codim-0-entity!");
197 static_assert(SCV::Traits::Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
200 if constexpr (Deprecated::hasSCVGeometryInterface<FVGeo>())
202 const auto geo = fvGeometry.geometry(scv);
203 const auto radius0 = geo.corner(0)[0];
204 const auto radius1 = geo.corner(1)[0];
206 return 4.0/3.0*M_PI*abs(radius1*radius1*radius1 - radius0*radius0*radius0);
211 const auto geo = scv.geometry();
212 const auto radius0 = geo.corner(0)[0];
213 const auto radius1 = geo.corner(1)[0];
215 return 4.0/3.0*M_PI*abs(radius1*radius1*radius1 - radius0*radius0*radius0);
222 template<
class Geometry>
223 static constexpr auto integrationElement(
const Geometry& geo,
const typename Geometry::LocalCoordinate& x)
225 static_assert(Geometry::coorddimension == 1,
"Spherical rotation only makes sense for 1D geometries!");
229 const auto radius = geo.global(x)[0];
230 return geo.integrationElement(x)*4.0*M_PI*radius*radius;
242 using E =
typename G::Extrusion;
244 using type =
typename Dune::Std::detected_or<NoExtrusion, E, T>::type;
262template<
int radialAxis>
263inline constexpr bool isRotationalExtrusion<RotationalExtrusion<radialAxis>> =
true;
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:251
constexpr bool isRotationalExtrusion
Convenience trait to check whether the extrusion is rotational.
Definition: extrusion.hh:257
Default implementation that performs no extrusion (extrusion with identity)
Definition: extrusion.hh:40
static constexpr auto area(const FVGeo &, const SCVF &scvf)
Definition: extrusion.hh:52
static constexpr auto volume(const SCV &scv)
Definition: extrusion.hh:48
static constexpr auto integrationElement(const Geometry &geo, const typename Geometry::LocalCoordinate &x)
Definition: extrusion.hh:60
static constexpr auto area(const SCVF &scvf)
Definition: extrusion.hh:43
static constexpr auto volume(const FVGeo &, const SCV &scv)
Definition: extrusion.hh:56
Rotation symmetric extrusion policy for rotating about an external axis.
Definition: extrusion.hh:71
static constexpr auto volume(const FVGeo &, const SCV &scv)
Definition: extrusion.hh:118
static constexpr auto volume(const SCV &scv)
Transformed sub-control-volume volume.
Definition: extrusion.hh:107
static constexpr int radialAxis
Definition: extrusion.hh:72
static constexpr auto area(const SCVF &scvf)
Transformed sub-control-volume face area.
Definition: extrusion.hh:80
static constexpr auto integrationElement(const Geometry &geo, const typename Geometry::LocalCoordinate &x)
Integration element for quadrature rules on the reference element.
Definition: extrusion.hh:132
static constexpr auto area(const FVGeo &, const SCVF &scvf)
Definition: extrusion.hh:91
Rotation symmetric extrusion policy for spherical rotation.
Definition: extrusion.hh:147
static constexpr auto area(const SCVF &scvf)
Transformed sub-control-volume face area.
Definition: extrusion.hh:154
static constexpr auto area(const FVGeo &, const SCVF &scvf)
Definition: extrusion.hh:165
static constexpr auto integrationElement(const Geometry &geo, const typename Geometry::LocalCoordinate &x)
Integration element for quadrature rules on the reference element.
Definition: extrusion.hh:223
static constexpr auto volume(const SCV &scv)
Transformed sub-control-volume volume.
Definition: extrusion.hh:181
static constexpr auto volume(const FVGeo &fvGeometry, const SCV &scv)
Definition: extrusion.hh:194
Traits extracting the public Extrusion type from T Defaults to NoExtrusion if no such type is found.
Definition: extrusion.hh:240
typename Dune::Std::detected_or< NoExtrusion, E, T >::type type
Definition: extrusion.hh:244