version 3.8
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// 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_PQ1BUBBLE_SUBCONTROLVOLUMEFACE_HH
13#define DUMUX_DISCRETIZATION_PQ1BUBBLE_SUBCONTROLVOLUMEFACE_HH
14
15#include <utility>
16
17#include <dune/geometry/type.hh>
18#include <dune/geometry/multilineargeometry.hh>
19
24
25namespace Dumux {
26
33template<class GridView>
35{
36 using Grid = typename GridView::Grid;
37 static constexpr int dim = Grid::dimension;
38 static constexpr int dimWorld = Grid::dimensionworld;
41 using Scalar = typename Grid::ctype;
43 using Geometry = Dune::MultiLinearGeometry<Scalar, dim-1, dimWorld, GeometryTraits>;
44 using CornerStorage = typename GeometryTraits::template CornerStorage<dim-1, dimWorld>::Type;
45 using GlobalPosition = typename CornerStorage::value_type;
47};
48
56template<class GV,
59: public SubControlVolumeFaceBase<PQ1BubbleSubControlVolumeFace<GV, T>, T>
60{
63 using GridIndexType = typename T::GridIndexType;
64 using LocalIndexType = typename T::LocalIndexType;
65 using Scalar = typename T::Scalar;
66 using CornerStorage = typename T::CornerStorage;
67 using Geometry = typename T::Geometry;
68 using BoundaryFlag = typename T::BoundaryFlag;
69
70public:
72 using GlobalPosition = typename T::GlobalPosition;
74 using Traits = T;
75
78
81 const Scalar area,
83 const std::array<LocalIndexType, 2>& scvIndices,
84 const LocalIndexType localScvfIdx,
85 bool overlapping = false)
86 : center_(center)
87 , unitOuterNormal_(normal)
88 , area_(area)
89 , localScvfIdx_(localScvfIdx)
90 , scvIndices_(scvIndices)
91 , boundary_(false)
92 , overlapping_(overlapping)
93 , boundaryFlag_{}
94 { }
95
98 const Scalar area,
100 const std::array<LocalIndexType, 2>& scvIndices,
101 const LocalIndexType localScvfIdx,
102 const BoundaryFlag& bFlag,
103 bool overlapping = false)
104 : center_(center)
105 , unitOuterNormal_(normal)
106 , area_(area)
107 , localScvfIdx_(localScvfIdx)
108 , scvIndices_(scvIndices)
109 , boundary_(true)
110 , overlapping_(overlapping)
111 , boundaryFlag_(bFlag)
112 {}
113
115 const GlobalPosition& center() const
116 { return center_; }
117
120 { return center_; }
121
123 Scalar area() const
124 { return area_; }
125
127 bool isOverlapping() const
128 { return overlapping_; }
129
130 bool boundary() const
131 { return boundary_; }
132
135 { return unitOuterNormal_; }
136
138 GridIndexType insideScvIdx() const
139 { return scvIndices_[0]; }
140
142 GridIndexType outsideScvIdx() const
143 { return scvIndices_[1]; }
144
146 std::size_t numOutsideScvs() const
147 { return static_cast<std::size_t>(!boundary()); }
148
150 LocalIndexType index() const
151 { return localScvfIdx_; }
152
155 { return boundaryFlag_.get(); }
156
157private:
158 GlobalPosition center_;
159 GlobalPosition unitOuterNormal_;
160 Scalar area_;
161 LocalIndexType localScvfIdx_;
162 std::array<LocalIndexType, 2> scvIndices_;
163 bool boundary_;
164 bool overlapping_;
165 BoundaryFlag boundaryFlag_;
166};
167
168} // end namespace Dumux
169
170#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
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:60
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:72
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:146
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:115
T Traits
state the traits public and thus export all types
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:74
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:97
bool boundary() const
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:130
bool isOverlapping() const
returns true if the sub control volume face is overlapping with another scv
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:127
GridIndexType outsideScvIdx() const
index of the outside sub control volume
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:142
const GlobalPosition unitOuterNormal() const
The unit outer normal.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:134
LocalIndexType index() const
The local index of this sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:150
PQ1BubbleSubControlVolumeFace()=default
The default constructor.
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:154
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:119
GridIndexType insideScvIdx() const
Index of the inside sub control volume.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:138
Scalar area() const
The area of the sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:123
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:80
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
Helper class constructing the dual grid finite volume geometries for the cvfe discretizazion method.
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.
Definition: adapt.hh:17
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28
Default traits class to be used for the sub-control volume faces for the cvfe scheme.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:35
static constexpr int dim
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:37
typename GeometryTraits::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:44
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:39
typename GridView::Grid Grid
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:36
typename Grid::ctype Scalar
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:41
typename CornerStorage::value_type GlobalPosition
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:45
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, GeometryTraits > Geometry
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:43
static constexpr int dimWorld
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:38
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:40
Traits for an efficient corner storage for the PQ1Bubble method.
Definition: discretization/pq1bubble/geometryhelper.hh:34
Base class for a sub control volume face.