version 3.8
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// 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_FACECENTERED_DIAMOND_SUBCONTROLVOLUMEFACE_HH
13#define DUMUX_DISCRETIZATION_FACECENTERED_DIAMOND_SUBCONTROLVOLUMEFACE_HH
14
15#include <array>
16#include <utility>
17#include <dune/common/fvector.hh>
18#include <dune/geometry/type.hh>
19#include <dune/geometry/multilineargeometry.hh>
20
26
27
28#include <typeinfo>
29
30namespace Dumux {
31
38template<class GridView>
40{
41 using Grid = typename GridView::Grid;
42 static constexpr int dim = Grid::dimension;
43 static constexpr int dimWorld = Grid::dimensionworld;
44
47 using Scalar = typename Grid::ctype;
48 using Geometry = Dune::MultiLinearGeometry<Scalar, dim-1, dimWorld, FCDiamondMLGeometryTraits<Scalar>>;
50 using GlobalPosition = typename CornerStorage::value_type;
52
53 static constexpr Dune::GeometryType interiorGeometryType(Dune::GeometryType)
54 { return Dune::GeometryTypes::simplex(dim-1); }
55};
56
61template<class GridView, class T = FaceCenteredDiamondScvfGeometryTraits<GridView>>
63{
64 using Scalar = typename T::Scalar;
65 using GridIndexType = typename T::GridIndexType;
66 using LocalIndexType = typename T::LocalIndexType;
67 using Geometry = typename T::Geometry;
68 using BoundaryFlag = typename T::BoundaryFlag;
69
70public:
72 using Traits = T;
73
74 using GlobalPosition = typename T::GlobalPosition;
75
77
78 // interior scvf
80 const Scalar area,
82 const std::array<LocalIndexType, 2>& scvIndices,
83 const LocalIndexType localScvfIdx)
84 : center_(center)
85 , unitOuterNormal_(normal)
86 , area_(area)
87 , localScvfIdx_(localScvfIdx)
88 , scvIndices_(scvIndices)
89 , boundary_(false)
90 , boundaryFlag_{}
91 {}
92
93 // boundary scvf
95 const Scalar area,
97 const std::array<LocalIndexType, 2>& scvIndices,
98 const LocalIndexType localScvfIdx,
99 const BoundaryFlag& bFlag)
100 : center_(center)
101 , unitOuterNormal_(normal)
102 , area_(area)
103 , localScvfIdx_(localScvfIdx)
104 , scvIndices_(scvIndices)
105 , boundary_(true)
106 , boundaryFlag_(bFlag)
107 {}
108
110 const GlobalPosition& center() const
111 { return center_; }
112
115 { return center_; }
116
119 { return unitOuterNormal_; }
120
122 GridIndexType insideScvIdx() const
123 { return scvIndices_[0]; }
124
126 GridIndexType outsideScvIdx() const
127 { return scvIndices_[1]; }
128
129 std::size_t numOutsideScvs() const
130 { return static_cast<std::size_t>(!boundary()); }
131
132 GridIndexType index() const
133 { return localScvfIdx_; }
134
135 bool boundary() const
136 { return boundary_; }
137
138 Scalar area() const
139 { return area_; }
140
143 {
144 return boundaryFlag_.get();
145 }
146
147private:
148 GlobalPosition center_;
149 GlobalPosition unitOuterNormal_;
150 Scalar area_;
151 LocalIndexType localScvfIdx_;
152 std::array<LocalIndexType, 2> scvIndices_;
153 bool boundary_;
154 BoundaryFlag boundaryFlag_;
155};
156
157
158} // end namespace Dumux
159
160#endif
Boundary flag to store e.g. in sub control volume faces.
Boundary flag to store e.g. in sub control volume faces.
Definition: boundaryflag.hh:55
std::size_t value_type
Definition: boundaryflag.hh:39
The SCVF implementation for diamond.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:63
bool boundary() const
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:135
std::size_t numOutsideScvs() const
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:129
GridIndexType insideScvIdx() const
Index of the inside sub control volume.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:122
const GlobalPosition unitOuterNormal() const
The unit outer normal.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:118
const GlobalPosition & ipGlobal() const
The integration point of the sub control volume face.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:114
Scalar area() const
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, const BoundaryFlag &bFlag)
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:94
T Traits
state the traits public and thus export all types
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:72
GridIndexType index() const
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:132
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:142
GridIndexType outsideScvIdx() const
index of the outside sub control volume
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:126
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:79
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:110
typename T::GlobalPosition GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:74
Vector normal(const Vector &v)
Create a vector normal to the given one (v is expected to be non-zero)
Definition: normal.hh:26
Defines the index types used for grid and local indices.
A helper function for class member function introspection.
Definition: adapt.hh:17
Traits for an efficient corner storage for fc diamond method.
Definition: discretization/facecentered/diamond/geometryhelper.hh:29
Default traits class to be used for the sub-control volumes for the cell-centered finite volume schem...
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:40
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:45
static constexpr int dimWorld
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:43
typename CornerStorage::value_type GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:50
typename IndexTraits< GridView >::SmallLocalIndex LocalIndexType
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:46
typename Grid::ctype Scalar
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:47
typename FCDiamondMLGeometryTraits< Scalar >::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:49
static constexpr int dim
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:42
static constexpr Dune::GeometryType interiorGeometryType(Dune::GeometryType)
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:53
typename GridView::Grid Grid
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:41
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, FCDiamondMLGeometryTraits< Scalar > > Geometry
Definition: discretization/facecentered/diamond/subcontrolvolumeface.hh:48
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
std::uint_least8_t SmallLocalIndex
Definition: indextraits.hh:29
Base class for a sub control volume face.