version 3.10-dev
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// 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_PNM_SUBCONTROLVOLUMEFACE_HH
13#define DUMUX_DISCRETIZATION_PNM_SUBCONTROLVOLUMEFACE_HH
14
15#include <dune/geometry/axisalignedcubegeometry.hh>
18
19namespace Dumux::PoreNetwork {
20
26template<class GridView>
28{
29 using Grid = typename GridView::Grid;
30 static constexpr int dim = Grid::dimension;
31 static constexpr int dimWorld = Grid::dimensionworld;
32
35
36 using Scalar = typename Grid::ctype;
37 using GlobalPosition = Dune::FieldVector<Scalar, dimWorld>;
38 using CornerStorage = std::array<Dune::FieldVector<Scalar, dimWorld>, 1>;
39 using Geometry = Dune::AxisAlignedCubeGeometry<Scalar, dim-1, dimWorld>;
40
41};
42
49template<class GV,
52: public Dumux::SubControlVolumeFaceBase<PNMSubControlVolumeFace<GV, T>, T>
53{
56 using GridIndexType = typename T::GridIndexType;
57 using LocalIndexType = typename T::LocalIndexType;
58 using Scalar = typename T::Scalar;
59
60public:
62 using GlobalPosition = typename T::GlobalPosition;
64 using Traits = T;
65
68
72 const Scalar& area,
73 GridIndexType scvfIndex,
74 std::array<LocalIndexType, 2>&& scvIndices)
75 : center_(center),
76 unitOuterNormal_(unitOuterNormal),
77 area_(area),
78 scvfIndex_(scvfIndex),
79 scvIndices_(std::move(scvIndices))
80 {}
81
83 const GlobalPosition& center() const
84 { return center_; }
85
87 const GlobalPosition& ipGlobal() const
88 { return center_; }
89
91 Scalar area() const
92 { return area_; }
93
95 bool boundary() const
96 { return false; }
97
100 { return unitOuterNormal_; }
101
103 LocalIndexType insideScvIdx() const
104 { return scvIndices_[0]; }
105
107 // This results in undefined behaviour if boundary is true
108 LocalIndexType outsideScvIdx() const
109 { return scvIndices_[1]; }
110
112 GridIndexType index() const
113 { return scvfIndex_; }
114
115private:
116 GlobalPosition center_;
117 GlobalPosition unitOuterNormal_;
118 Scalar area_;
119 GridIndexType scvfIndex_;
120 std::array<LocalIndexType, 2> scvIndices_;
121};
122
123} // end namespace Dumux::PoreNetwork
124
125#endif
Class for a sub control volume face for porenetworks.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:53
LocalIndexType outsideScvIdx() const
Index of the outside sub control volume for spatial param evaluation.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:108
const GlobalPosition & unitOuterNormal() const
The unit outer normal of the sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:99
LocalIndexType insideScvIdx() const
Index of the inside sub control volume for spatial param evaluation.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:103
Scalar area() const
The area of the sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:91
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:83
bool boundary() const
We assume to always have a pore body and not a pore throat at the boundary.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:95
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:87
GridIndexType index() const
The local index of this sub control volume face.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:112
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/porenetwork/subcontrolvolumeface.hh:62
T Traits
state the traits public and thus export all types
Definition: discretization/porenetwork/subcontrolvolumeface.hh:64
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:70
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:29
Defines the index types used for grid and local indices.
Definition: discretization/porenetwork/fvelementgeometry.hh:24
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28
Default traits class.
Definition: discretization/porenetwork/subcontrolvolumeface.hh:28
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/porenetwork/subcontrolvolumeface.hh:34
Dune::AxisAlignedCubeGeometry< Scalar, dim-1, dimWorld > Geometry
Definition: discretization/porenetwork/subcontrolvolumeface.hh:39
typename GridView::Grid Grid
Definition: discretization/porenetwork/subcontrolvolumeface.hh:29
std::array< Dune::FieldVector< Scalar, dimWorld >, 1 > CornerStorage
Definition: discretization/porenetwork/subcontrolvolumeface.hh:38
Dune::FieldVector< Scalar, dimWorld > GlobalPosition
Definition: discretization/porenetwork/subcontrolvolumeface.hh:37
static constexpr int dim
Definition: discretization/porenetwork/subcontrolvolumeface.hh:30
typename Grid::ctype Scalar
Definition: discretization/porenetwork/subcontrolvolumeface.hh:36
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/porenetwork/subcontrolvolumeface.hh:33
static constexpr int dimWorld
Definition: discretization/porenetwork/subcontrolvolumeface.hh:31
Base class for a sub control volume face.