3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
discretization/pq1bubble/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_PQ1BUBBLE_SUBCONTROLVOLUMEFACE_HH
25#define DUMUX_DISCRETIZATION_PQ1BUBBLE_SUBCONTROLVOLUMEFACE_HH
26
27#include <utility>
28
29#include <dune/geometry/type.hh>
30#include <dune/geometry/multilineargeometry.hh>
31
36
37namespace Dumux {
38
45template<class GridView>
47{
48 using Grid = typename GridView::Grid;
49 static constexpr int dim = Grid::dimension;
50 static constexpr int dimWorld = Grid::dimensionworld;
53 using Scalar = typename Grid::ctype;
55 using Geometry = Dune::MultiLinearGeometry<Scalar, dim-1, dimWorld, GeometryTraits>;
56 using CornerStorage = typename GeometryTraits::template CornerStorage<dim-1, dimWorld>::Type;
57 using GlobalPosition = typename CornerStorage::value_type;
59};
60
68template<class GV,
71: public SubControlVolumeFaceBase<PQ1BubbleSubControlVolumeFace<GV, T>, T>
72{
75 using GridIndexType = typename T::GridIndexType;
76 using LocalIndexType = typename T::LocalIndexType;
77 using Scalar = typename T::Scalar;
78 using CornerStorage = typename T::CornerStorage;
79 using Geometry = typename T::Geometry;
80 using BoundaryFlag = typename T::BoundaryFlag;
81
82public:
84 using GlobalPosition = typename T::GlobalPosition;
86 using Traits = T;
87
90
93 const Scalar area,
95 const std::array<LocalIndexType, 2>& scvIndices,
96 const LocalIndexType localScvfIdx,
97 bool overlapping = false)
98 : center_(center)
99 , unitOuterNormal_(normal)
100 , area_(area)
101 , localScvfIdx_(localScvfIdx)
102 , scvIndices_(scvIndices)
103 , boundary_(false)
104 , overlapping_(overlapping)
105 , boundaryFlag_{}
106 { }
107
110 const Scalar area,
111 const GlobalPosition& normal,
112 const std::array<LocalIndexType, 2>& scvIndices,
113 const LocalIndexType localScvfIdx,
114 const BoundaryFlag& bFlag,
115 bool overlapping = false)
116 : center_(center)
117 , unitOuterNormal_(normal)
118 , area_(area)
119 , localScvfIdx_(localScvfIdx)
120 , scvIndices_(scvIndices)
121 , boundary_(true)
122 , overlapping_(overlapping)
123 , boundaryFlag_(bFlag)
124 {}
125
127 const GlobalPosition& center() const
128 { return center_; }
129
132 { return center_; }
133
135 Scalar area() const
136 { return area_; }
137
139 bool isOverlapping() const
140 { return overlapping_; }
141
142 bool boundary() const
143 { return boundary_; }
144
147 { return unitOuterNormal_; }
148
150 GridIndexType insideScvIdx() const
151 { return scvIndices_[0]; }
152
154 GridIndexType outsideScvIdx() const
155 { return scvIndices_[1]; }
156
158 std::size_t numOutsideScvs() const
159 { return static_cast<std::size_t>(!boundary()); }
160
162 LocalIndexType index() const
163 { return localScvfIdx_; }
164
167 { return boundaryFlag_.get(); }
168
169private:
170 GlobalPosition center_;
171 GlobalPosition unitOuterNormal_;
172 Scalar area_;
173 LocalIndexType localScvfIdx_;
174 std::array<LocalIndexType, 2> scvIndices_;
175 bool boundary_;
176 bool overlapping_;
177 BoundaryFlag boundaryFlag_;
178};
179
180} // end namespace Dumux
181
182#endif
Boundary flag to store e.g. in sub control volume faces.
Defines the index types used for grid and local indices.
Base class for a sub control volume face.
Vector normal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero)
Definition: normal.hh:38
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
std::size_t value_type
Definition: boundaryflag.hh:51
Boundary flag to store e.g. in sub control volume faces.
Definition: boundaryflag.hh:67
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
unsigned int LocalIndex
Definition: indextraits.hh:40
Traits for an efficient corner storage for the PQ1Bubble method.
Definition: discretization/pq1bubble/geometryhelper.hh:46
Default traits class to be used for the sub-control volume faces for the cvfe scheme.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:47
static constexpr int dim
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:49
typename GeometryTraits::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:56
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:51
typename GridView::Grid Grid
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:48
typename Grid::ctype Scalar
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:53
typename CornerStorage::value_type GlobalPosition
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:57
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, GeometryTraits > Geometry
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:55
static constexpr int dimWorld
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:50
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:52
Class for a sub control volume face in the cvfe method, i.e a part of the boundary of a sub control v...
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:72
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:84
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:158
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:127
T Traits
state the traits public and thus export all types
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:86
PQ1BubbleSubControlVolumeFace(const GlobalPosition &center, const Scalar area, const GlobalPosition &normal, const std::array< LocalIndexType, 2 > &scvIndices, const LocalIndexType localScvfIdx, const BoundaryFlag &bFlag, bool overlapping=false)
Constructor for boundary scvfs.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:109
bool boundary() const
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:142
bool isOverlapping() const
returns true if the sub control volume face is overlapping with another scv
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:139
GridIndexType outsideScvIdx() const
index of the outside sub control volume
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:154
const GlobalPosition unitOuterNormal() const
The unit outer normal.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:146
LocalIndexType index() const
The local index of this sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:162
PQ1BubbleSubControlVolumeFace()=default
The default constructor.
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:166
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:131
GridIndexType insideScvIdx() const
Index of the inside sub control volume.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:150
Scalar area() const
The area of the sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:135
PQ1BubbleSubControlVolumeFace(const GlobalPosition &center, const Scalar area, const GlobalPosition &normal, const std::array< LocalIndexType, 2 > &scvIndices, const LocalIndexType localScvfIdx, bool overlapping=false)
Constructor for inner scvfs.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:92
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
Helper class constructing the dual grid finite volume geometries for the cvfe discretizazion method.