3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
subcontrolvolumefacebase.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_SUBCONTROLVOLUMEFACEBASE_HH
25#define DUMUX_DISCRETIZATION_SUBCONTROLVOLUMEFACEBASE_HH
26
27#include <utility>
28#include <dune/common/fvector.hh>
29
30namespace Dumux {
31
39template<class Imp, class ScvfGeometryTraits>
41{
42 using Implementation = Imp;
43 using GridIndexType = typename ScvfGeometryTraits::GridIndexType;
44 using Scalar = typename ScvfGeometryTraits::Scalar;
45
46public:
48 using GlobalPosition = typename ScvfGeometryTraits::GlobalPosition;
50 using Traits = ScvfGeometryTraits;
51
54 {
55 return asImp_().center();
56 }
57
60 {
61 // Return center for now
62 return asImp_().ipGlobal();
63 }
64
66 Scalar area() const
67 {
68 return asImp_().area();
69 }
70
72 bool boundary() const
73 {
74 return asImp_().boundary();
75 }
76
79 {
80 return asImp_().unitOuterNormal();
81 }
82
84 GridIndexType insideScvIdx() const
85 {
86 return asImp_().insideScvIdx();
87 }
88
92 GridIndexType outsideScvIdx(int i = 0) const
93 {
94 return asImp_().outsideScvIdx(i);
95 }
96
98 GridIndexType index() const
99 {
100 return asImp_().index();
101 }
102
103private:
104 const Implementation& asImp_() const
105 { return *static_cast<const Implementation*>(this); }
106
107 Implementation& asImp_()
108 { return *static_cast<Implementation*>(this); }
109};
110
111} // end namespace Dumux
112
113#endif
Definition: adapt.hh:29
Base class for a sub control volume face, i.e a part of the boundary of a sub control volume we compu...
Definition: subcontrolvolumefacebase.hh:41
GridIndexType index() const
The global index of this sub control volume face.
Definition: subcontrolvolumefacebase.hh:98
GlobalPosition unitOuterNormal() const
the unit outward pointing normal on the scv face
Definition: subcontrolvolumefacebase.hh:78
GridIndexType insideScvIdx() const
index of the inside sub control volume for spatial param evaluation
Definition: subcontrolvolumefacebase.hh:84
bool boundary() const
returns bolean if the sub control volume face is on the boundary
Definition: subcontrolvolumefacebase.hh:72
typename ScvfGeometryTraits::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: subcontrolvolumefacebase.hh:48
Scalar area() const
The area of the sub control volume face.
Definition: subcontrolvolumefacebase.hh:66
GlobalPosition ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: subcontrolvolumefacebase.hh:59
GridIndexType outsideScvIdx(int i=0) const
Definition: subcontrolvolumefacebase.hh:92
GlobalPosition center() const
The center of the sub control volume face.
Definition: subcontrolvolumefacebase.hh:53
ScvfGeometryTraits Traits
state the traits public and thus export all types
Definition: subcontrolvolumefacebase.hh:50