3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
discretization/facecentered/diamond/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_FACECENTERED_DIAMOND_SUBCONTROLVOLUMEFACE_HH
25#define DUMUX_DISCRETIZATION_FACECENTERED_DIAMOND_SUBCONTROLVOLUMEFACE_HH
26
27#include <array>
28#include <utility>
29#include <dune/common/fvector.hh>
30#include <dune/geometry/type.hh>
31#include <dune/geometry/multilineargeometry.hh>
32
38
39
40#include <typeinfo>
41
42namespace Dumux {
43
50template<class GridView>
52{
53 using Grid = typename GridView::Grid;
54 static constexpr int dim = Grid::dimension;
55 static constexpr int dimWorld = Grid::dimensionworld;
56
59 using Scalar = typename Grid::ctype;
60 using Geometry = Dune::MultiLinearGeometry<Scalar, dim-1, dimWorld, FCDiamondMLGeometryTraits<Scalar>>;
62 using GlobalPosition = typename CornerStorage::value_type;
64
65 static constexpr Dune::GeometryType interiorGeometryType(Dune::GeometryType)
66 { return Dune::GeometryTypes::simplex(dim-1); }
67};
68
73template<class GridView, class T = FaceCenteredDiamondScvfGeometryTraits<GridView>>
75{
76 using Scalar = typename T::Scalar;
77 using GridIndexType = typename T::GridIndexType;
78 using LocalIndexType = typename T::LocalIndexType;
79 using Geometry = typename T::Geometry;
80 using BoundaryFlag = typename T::BoundaryFlag;
81
82public:
84 using Traits = T;
85
86 using GlobalPosition = typename T::GlobalPosition;
87
89
90 // interior scvf
92 const Scalar area,
94 const std::array<LocalIndexType, 2>& scvIndices,
95 const LocalIndexType localScvfIdx)
96 : center_(center)
97 , unitOuterNormal_(normal)
98 , area_(area)
99 , localScvfIdx_(localScvfIdx)
100 , scvIndices_(scvIndices)
101 , boundary_(false)
102 , boundaryFlag_{}
103 {}
104
105 // boundary scvf
107 const Scalar area,
108 const GlobalPosition& normal,
109 const std::array<LocalIndexType, 2>& scvIndices,
110 const LocalIndexType localScvfIdx,
111 const BoundaryFlag& bFlag)
112 : center_(center)
113 , unitOuterNormal_(normal)
114 , area_(area)
115 , localScvfIdx_(localScvfIdx)
116 , scvIndices_(scvIndices)
117 , boundary_(true)
118 , boundaryFlag_(bFlag)
119 {}
120
122 const GlobalPosition& center() const
123 { return center_; }
124
127 { return center_; }
128
131 { return unitOuterNormal_; }
132
134 GridIndexType insideScvIdx() const
135 { return scvIndices_[0]; }
136
138 GridIndexType outsideScvIdx() const
139 { return scvIndices_[1]; }
140
141 std::size_t numOutsideScvs() const
142 { return static_cast<std::size_t>(!boundary()); }
143
144 GridIndexType index() const
145 { return localScvfIdx_; }
146
147 bool boundary() const
148 { return boundary_; }
149
150 Scalar area() const
151 { return area_; }
152
155 {
156 return boundaryFlag_.get();
157 }
158
159private:
160 GlobalPosition center_;
161 GlobalPosition unitOuterNormal_;
162 Scalar area_;
163 LocalIndexType localScvfIdx_;
164 std::array<LocalIndexType, 2> scvIndices_;
165 bool boundary_;
166 BoundaryFlag boundaryFlag_;
167};
168
169
170} // end namespace Dumux
171
172#endif
A helper function for class member function introspection.
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
std::uint_least8_t SmallLocalIndex
Definition: indextraits.hh:41
Traits for an efficient corner storage for fc diamond method.
Definition: discretization/facecentered/diamond/geometryhelper.hh:41
Default traits class to be used for the sub-control volumes for the cell-centered finite volume schem...
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:52
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:57
static constexpr int dimWorld
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:55
typename CornerStorage::value_type GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:62
typename IndexTraits< GridView >::SmallLocalIndex LocalIndexType
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:58
typename Grid::ctype Scalar
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:59
typename FCDiamondMLGeometryTraits< Scalar >::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:61
static constexpr int dim
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:54
static constexpr Dune::GeometryType interiorGeometryType(Dune::GeometryType)
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:65
typename GridView::Grid Grid
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:53
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, FCDiamondMLGeometryTraits< Scalar > > Geometry
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:60
The SCVF implementation for diamond.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:75
bool boundary() const
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:147
std::size_t numOutsideScvs() const
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:141
GridIndexType insideScvIdx() const
Index of the inside sub control volume.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:134
const GlobalPosition unitOuterNormal() const
The unit outer normal.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:130
const GlobalPosition & ipGlobal() const
The integration point of the sub control volume face.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:126
Scalar area() const
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:150
FaceCenteredDiamondSubControlVolumeFace(const GlobalPosition &center, const Scalar area, const GlobalPosition &normal, const std::array< LocalIndexType, 2 > &scvIndices, const LocalIndexType localScvfIdx, const BoundaryFlag &bFlag)
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:106
T Traits
state the traits public and thus export all types
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:84
GridIndexType index() const
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:144
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:154
GridIndexType outsideScvIdx() const
index of the outside sub control volume
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:138
FaceCenteredDiamondSubControlVolumeFace(const GlobalPosition &center, const Scalar area, const GlobalPosition &normal, const std::array< LocalIndexType, 2 > &scvIndices, const LocalIndexType localScvfIdx)
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:91
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:122
typename T::GlobalPosition GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:86