version 3.8
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_DISCRETIZATION_SUBCONTROLVOLUMEFACEBASE_HH
13#define DUMUX_DISCRETIZATION_SUBCONTROLVOLUMEFACEBASE_HH
14
15#include <utility>
16#include <dune/common/fvector.hh>
17
18namespace Dumux {
19
27template<class Imp, class ScvfGeometryTraits>
29{
30 using Implementation = Imp;
31 using GridIndexType = typename ScvfGeometryTraits::GridIndexType;
32 using Scalar = typename ScvfGeometryTraits::Scalar;
33
34public:
36 using GlobalPosition = typename ScvfGeometryTraits::GlobalPosition;
38 using Traits = ScvfGeometryTraits;
39
42 {
43 return asImp_().center();
44 }
45
48 {
49 // Return center for now
50 return asImp_().ipGlobal();
51 }
52
54 Scalar area() const
55 {
56 return asImp_().area();
57 }
58
60 bool boundary() const
61 {
62 return asImp_().boundary();
63 }
64
67 {
68 return asImp_().unitOuterNormal();
69 }
70
72 GridIndexType insideScvIdx() const
73 {
74 return asImp_().insideScvIdx();
75 }
76
80 GridIndexType outsideScvIdx(int i = 0) const
81 {
82 return asImp_().outsideScvIdx(i);
83 }
84
86 GridIndexType index() const
87 {
88 return asImp_().index();
89 }
90
91private:
92 const Implementation& asImp_() const
93 { return *static_cast<const Implementation*>(this); }
94
95 Implementation& asImp_()
96 { return *static_cast<Implementation*>(this); }
97};
98
99} // end namespace Dumux
100
101#endif
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:29
GridIndexType index() const
The global index of this sub control volume face.
Definition: subcontrolvolumefacebase.hh:86
GlobalPosition unitOuterNormal() const
the unit outward pointing normal on the scv face
Definition: subcontrolvolumefacebase.hh:66
GridIndexType insideScvIdx() const
index of the inside sub control volume for spatial param evaluation
Definition: subcontrolvolumefacebase.hh:72
bool boundary() const
returns boolean if the sub control volume face is on the boundary
Definition: subcontrolvolumefacebase.hh:60
typename ScvfGeometryTraits::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: subcontrolvolumefacebase.hh:36
Scalar area() const
The area of the sub control volume face.
Definition: subcontrolvolumefacebase.hh:54
GlobalPosition ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: subcontrolvolumefacebase.hh:47
GridIndexType outsideScvIdx(int i=0) const
Definition: subcontrolvolumefacebase.hh:80
GlobalPosition center() const
The center of the sub control volume face.
Definition: subcontrolvolumefacebase.hh:41
ScvfGeometryTraits Traits
state the traits public and thus export all types
Definition: subcontrolvolumefacebase.hh:38
Definition: adapt.hh:17