version 3.11-dev
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-FileCopyrightText: 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
23
24namespace Dumux {
25
32template<class GridView>
34{
35 using Grid = typename GridView::Grid;
36 static constexpr int dim = Grid::dimension;
37 static constexpr int dimWorld = Grid::dimensionworld;
40 using Scalar = typename Grid::ctype;
42 using Geometry = Dune::MultiLinearGeometry<Scalar, dim-1, dimWorld, GeometryTraits>;
43 using CornerStorage = typename GeometryTraits::template CornerStorage<dim-1, dimWorld>::Type;
44 using GlobalPosition = typename CornerStorage::value_type;
46};
47
55template<class GV,
58{
60 using GridIndexType = typename T::GridIndexType;
61 using LocalIndexType = typename T::LocalIndexType;
62 using Scalar = typename T::Scalar;
63 using CornerStorage = typename T::CornerStorage;
64 using Geometry = typename T::Geometry;
65 using BoundaryFlag = typename T::BoundaryFlag;
66
67public:
69 using GlobalPosition = typename T::GlobalPosition;
71 using Traits = T;
72
75
78 const Scalar area,
80 const std::array<LocalIndexType, 2>& scvIndices,
81 const LocalIndexType localScvfIdx,
82 bool overlapping = false)
83 : center_(center)
84 , unitOuterNormal_(normal)
85 , area_(area)
86 , localScvfIdx_(localScvfIdx)
87 , scvIndices_(scvIndices)
88 , boundary_(false)
89 , overlapping_(overlapping)
90 , boundaryFlag_{}
91 { }
92
95 const Scalar area,
97 const std::array<LocalIndexType, 2>& scvIndices,
98 const LocalIndexType localScvfIdx,
99 const BoundaryFlag& bFlag,
100 bool overlapping = false)
101 : center_(center)
102 , unitOuterNormal_(normal)
103 , area_(area)
104 , localScvfIdx_(localScvfIdx)
105 , scvIndices_(scvIndices)
106 , boundary_(true)
107 , overlapping_(overlapping)
108 , boundaryFlag_(bFlag)
109 {}
110
112 const GlobalPosition& center() const
113 { return center_; }
114
117 { return center_; }
118
120 Scalar area() const
121 { return area_; }
122
124 bool isOverlapping() const
125 { return overlapping_; }
126
127 bool boundary() const
128 { return boundary_; }
129
132 { return unitOuterNormal_; }
133
135 GridIndexType insideScvIdx() const
136 { return scvIndices_[0]; }
137
139 GridIndexType outsideScvIdx() const
140 { return scvIndices_[1]; }
141
143 std::size_t numOutsideScvs() const
144 { return static_cast<std::size_t>(!boundary()); }
145
147 LocalIndexType index() const
148 { return localScvfIdx_; }
149
152 { return boundaryFlag_.get(); }
153
154private:
155 GlobalPosition center_;
156 GlobalPosition unitOuterNormal_;
157 Scalar area_;
158 LocalIndexType localScvfIdx_;
159 std::array<LocalIndexType, 2> scvIndices_;
160 bool boundary_;
161 bool overlapping_;
162 BoundaryFlag boundaryFlag_;
163};
164
165} // end namespace Dumux
166
167#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:58
std::size_t value_type
Definition: boundaryflag.hh:28
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:58
typename T::GlobalPosition GlobalPosition
export the type used for global coordinates
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:69
std::size_t numOutsideScvs() const
The number of scvs on the outside of this face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:143
const GlobalPosition & center() const
The center of the sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:112
T Traits
state the traits public and thus export all types
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:71
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:94
bool boundary() const
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:127
bool isOverlapping() const
returns true if the sub control volume face is overlapping with another scv
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:124
GridIndexType outsideScvIdx() const
index of the outside sub control volume
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:139
const GlobalPosition unitOuterNormal() const
The unit outer normal.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:131
LocalIndexType index() const
The local index of this sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:147
PQ1BubbleSubControlVolumeFace()=default
The default constructor.
BoundaryFlag::value_type boundaryFlag() const
Return the boundary flag.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:151
const GlobalPosition & ipGlobal() const
The integration point for flux evaluations in global coordinates.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:116
GridIndexType insideScvIdx() const
Index of the inside sub control volume.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:135
Scalar area() const
The area of the sub control volume face.
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:120
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:77
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:34
static constexpr int dim
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:36
typename GeometryTraits::template CornerStorage< dim-1, dimWorld >::Type CornerStorage
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:43
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:38
typename GridView::Grid Grid
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:35
typename Grid::ctype Scalar
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:40
typename CornerStorage::value_type GlobalPosition
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:44
Dune::MultiLinearGeometry< Scalar, dim-1, dimWorld, GeometryTraits > Geometry
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:42
static constexpr int dimWorld
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:37
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/pq1bubble/subcontrolvolumeface.hh:39
Traits for an efficient corner storage for the PQ1Bubble method.
Definition: discretization/pq1bubble/geometryhelper.hh:35