3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
discretization/porenetwork/subcontrolvolumeface.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_PNM_SUBCONTROLVOLUMEFACE_HH
25#define DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUMEFACE_HH
26
29
30namespace Dumux::PoreNetwork {
31
37template<class GridView>
39{
40 using Grid = typename GridView::Grid;
41 static constexpr int dim = Grid::dimension;
42 static constexpr int dimWorld = Grid::dimensionworld;
43
46
47 using Scalar = typename Grid::ctype;
48 using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
49 using CornerStorage = std::array<Dune::FieldVector<Scalar, dimWorld>, 1>;
50};
51
58template<class GV,
61: public Dumux::SubControlVolumeFaceBase<PNMSubControlVolumeFace<GV, T>, T>
62{
65 using GridIndexType = typename T::GridIndexType;
66 using LocalIndexType = typename T::LocalIndexType;
67 using Scalar = typename T::Scalar;
68
69public:
71 using GlobalPosition = typename T::GlobalPosition;
73 using Traits = T;
74
77
81 const Scalar& area,
82 GridIndexType scvfIndex,
83 std::array<LocalIndexType, 2>&& scvIndices)
84 : center_(center),
85 unitOuterNormal_(unitOuterNormal),
86 area_(area),
87 scvfIndex_(scvfIndex),
88 scvIndices_(std::move(scvIndices))
89 {}
90
92 const GlobalPosition& center() const
93 { return center_; }
94
96 const GlobalPosition& ipGlobal() const
97 { return center_; }
98
100 Scalar area() const
101 { return area_; }
102
104 bool boundary() const
105 { return false; }
106
109 { return unitOuterNormal_; }
110
112 LocalIndexType insideScvIdx() const
113 { return scvIndices_[0]; }
114
116 // This results in undefined behaviour if boundary is true
117 LocalIndexType outsideScvIdx() const
118 { return scvIndices_[1]; }
119
121 GridIndexType index() const
122 { return scvfIndex_; }
123
124private:
125 GlobalPosition center_;
126 GlobalPosition unitOuterNormal_;
127 Scalar area_;
128 GridIndexType scvfIndex_;
129 std::array<LocalIndexType, 2> scvIndices_;
130};
131
132} // end namespace Dumux::PoreNetwork
133
134#endif
Defines the index types used for grid and local indices.
Base class for a sub control volume face.
Definition: discretization/porenetwork/fvelementgeometry.hh:33
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
unsigned int LocalIndex
Definition: indextraits.hh:40
Default traits class.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:39
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/porenetwork/subcontrolvolumeface.hh:45
typename GridView::Grid Grid
Definition: discretization/porenetwork/subcontrolvolumeface.hh:40
std::array< Dune::FieldVector< Scalar, dimWorld >, 1 > CornerStorage
Definition: discretization/porenetwork/subcontrolvolumeface.hh:49
Dune::FieldVector< Scalar, dimWorld > GlobalPosition
Definition: discretization/porenetwork/subcontrolvolumeface.hh:48
static constexpr int dim
Definition: discretization/porenetwork/subcontrolvolumeface.hh:41
typename Grid::ctype Scalar
Definition: discretization/porenetwork/subcontrolvolumeface.hh:47
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/porenetwork/subcontrolvolumeface.hh:44
static constexpr int dimWorld
Definition: discretization/porenetwork/subcontrolvolumeface.hh:42
Class for a sub control volume face for porenetworks.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:62
LocalIndexType outsideScvIdx() const
Index of the outside sub control volume for spatial param evaluation.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:117
const GlobalPosition & unitOuterNormal() const
The unit outer normal of the sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:108
LocalIndexType insideScvIdx() const
Index of the inside sub control volume for spatial param evaluation.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:112
Scalar area() const
The area of the sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:100
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:92
bool boundary() const
We assume to always have a pore body and not a pore throat at the boundary.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:104
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:96
GridIndexType index() const
The local index of this sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:121
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/porenetwork/subcontrolvolumeface.hh:71
T Traits
state the traits public and thus export all types
Definition: discretization/porenetwork/subcontrolvolumeface.hh:73
PNMSubControlVolumeFace(const GlobalPosition &center, const GlobalPosition &unitOuterNormal, const Scalar &area, GridIndexType scvfIndex, std::array< LocalIndexType, 2 > &&scvIndices)
Constructor for inner scvfs.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:79
PNMSubControlVolumeFace()=default
The default constructor.
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