3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
rotationsymmetricscvf.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_DISCRETIZATION_ROTATION_SYMMETRIC_SUBCONTROLVOLUMEFACE_HH
25#define DUMUX_DISCRETIZATION_ROTATION_SYMMETRIC_SUBCONTROLVOLUMEFACE_HH
26
27#include <cmath>
29
30namespace Dumux {
31
38template<class SubControlVolumeFace, RotationPolicy rotationPolicy>
40
47template<class SubControlVolumeFace>
49: public SubControlVolumeFace
50{
51 using Scalar = typename SubControlVolumeFace::Traits::Scalar;
52 static_assert(SubControlVolumeFace::Traits::Geometry::mydimension == 0, "Rotation symmetric scvf with disc policy only works with 1d grids!");
53 static_assert(SubControlVolumeFace::Traits::Geometry::coorddimension == 1, "Rotation symmetric scvf with disc policy only works with 1d grids!");
54public:
56 using SubControlVolumeFace::SubControlVolumeFace;
57
59 Scalar area() const
60 {
61 const auto radius = this->corner(0)[0];
62 return 2.0*M_PI*radius;
63 }
64};
65
72template<class SubControlVolumeFace>
74: public SubControlVolumeFace
75{
76 using Scalar = typename SubControlVolumeFace::Traits::Scalar;
77 static_assert(SubControlVolumeFace::Traits::Geometry::mydimension == 0, "Rotation symmetric scvf with ball policy only works with 1d grids!");
78 static_assert(SubControlVolumeFace::Traits::Geometry::coorddimension == 1, "Rotation symmetric scvf with ball policy only works with 1d grids!");
79public:
81 using SubControlVolumeFace::SubControlVolumeFace;
82
84 Scalar area() const
85 {
86 const auto radius = this->corner(0)[0];
87 return 4.0*M_PI*radius*radius;
88 }
89};
90
98template<class SubControlVolumeFace>
100: public SubControlVolumeFace
101{
102 using Scalar = typename SubControlVolumeFace::Traits::Scalar;
103 static_assert(SubControlVolumeFace::Traits::Geometry::mydimension == 1, "Rotation symmetric scvf with toroid policy only works with 2d grids!");
104 static_assert(SubControlVolumeFace::Traits::Geometry::coorddimension == 2, "Rotation symmetric scvf with toroid policy only works with 2d grids!");
105public:
107 using SubControlVolumeFace::SubControlVolumeFace;
108
110 Scalar area() const
111 {
112 const auto radius = this->center()[0];
113 return SubControlVolumeFace::area()*2.0*M_PI*radius;
114 }
115};
116
117} // end namespace Dumux
118
119#endif
Rotation policy for defining rotational symmetric grid geometries.
RotationPolicy
Rotation policies.
Definition: rotationpolicy.hh:37
Definition: adapt.hh:29
Wrapper to make a sub control volume face rotation symmetric.
Definition: rotationsymmetricscvf.hh:39
Scalar area() const
The area of the sub control volume face (circumference of circle)
Definition: rotationsymmetricscvf.hh:59
Scalar area() const
The area of the sub control volume face (surface of sphere)
Definition: rotationsymmetricscvf.hh:84
Scalar area() const
The area of the sub control volume face (Guldinus theorem)
Definition: rotationsymmetricscvf.hh:110