version 3.8
discretization/pq1bubble/subcontrolvolume.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_SUBCONTROLVOLUME_HH
13#define DUMUX_DISCRETIZATION_PQ1BUBBLE_SUBCONTROLVOLUME_HH
14
15#include <dune/geometry/type.hh>
16#include <dune/geometry/multilineargeometry.hh>
17
18#include <dumux/common/math.hh>
22
23namespace Dumux {
24
31template<class GridView>
33{
34 using Grid = typename GridView::Grid;
35
36 static const int dim = Grid::dimension;
37 static const int dimWorld = Grid::dimensionworld;
38
41 using Scalar = typename Grid::ctype;
43 using Geometry = Dune::MultiLinearGeometry<Scalar, dim, dimWorld, GeometryTraits>;
44 using CornerStorage = typename GeometryTraits::template CornerStorage<dim, dimWorld>::Type;
45 using GlobalPosition = typename CornerStorage::value_type;
46};
47
54template<class GridView, class T = PQ1BubbleDefaultScvGeometryTraits<GridView>>
56{
57 using GlobalPosition = typename T::GlobalPosition;
58 using Scalar = typename T::Scalar;
59 using GridIndexType = typename T::GridIndexType;
60 using LocalIndexType = typename T::LocalIndexType;
61
62public:
64 using Traits = T;
65
67
69 const GlobalPosition& dofPosition,
70 const GlobalPosition& center,
71 const LocalIndexType indexInElement,
72 const GridIndexType eIdx,
73 const GridIndexType dofIdx,
74 bool overlapping = false)
75
76 : center_(center)
77 , dofPosition_(dofPosition)
78 , volume_(volume)
79 , indexInElement_(indexInElement)
80 , eIdx_(eIdx)
81 , dofIdx_(dofIdx)
82 , overlapping_(overlapping)
83 {}
84
86 const GlobalPosition& center() const
87 { return center_; }
88
90 const GlobalPosition& dofPosition() const
91 { return dofPosition_; }
92
93 Scalar volume() const
94 { return volume_; }
95
97 bool isOverlapping() const
98 { return overlapping_; }
99
100 GridIndexType dofIndex() const
101 { return dofIdx_; }
102
103 LocalIndexType indexInElement() const
104 { return indexInElement_; }
105
106 GridIndexType elementIndex() const
107 { return eIdx_; }
108
109 LocalIndexType localDofIndex() const
110 { return indexInElement_; }
111
112private:
113 GlobalPosition center_;
114 GlobalPosition dofPosition_;
115 Scalar volume_;
116 LocalIndexType indexInElement_;
117 GridIndexType eIdx_;
118 GridIndexType dofIdx_;
119 bool overlapping_;
120};
121
122} // end namespace Dumux
123
124#endif
the sub control volume for the pq1bubble scheme
Definition: discretization/pq1bubble/subcontrolvolume.hh:56
PQ1BubbleSubControlVolume(const Scalar &volume, const GlobalPosition &dofPosition, const GlobalPosition &center, const LocalIndexType indexInElement, const GridIndexType eIdx, const GridIndexType dofIdx, bool overlapping=false)
Definition: discretization/pq1bubble/subcontrolvolume.hh:68
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/pq1bubble/subcontrolvolume.hh:86
GridIndexType dofIndex() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:100
Scalar volume() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:93
const GlobalPosition & dofPosition() const
The position of the degree of freedom.
Definition: discretization/pq1bubble/subcontrolvolume.hh:90
LocalIndexType localDofIndex() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:109
bool isOverlapping() const
returns true if the sub control volume is overlapping with another scv
Definition: discretization/pq1bubble/subcontrolvolume.hh:97
T Traits
state the traits public and thus export all types
Definition: discretization/pq1bubble/subcontrolvolume.hh:64
LocalIndexType indexInElement() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:103
GridIndexType elementIndex() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:106
Helper class constructing the dual grid finite volume geometries for the cvfe discretizazion method.
Defines the index types used for grid and local indices.
Define some often used mathematical functions.
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 volumes for the pq1bubble scheme.
Definition: discretization/pq1bubble/subcontrolvolume.hh:33
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/pq1bubble/subcontrolvolume.hh:39
static const int dimWorld
Definition: discretization/pq1bubble/subcontrolvolume.hh:37
typename CornerStorage::value_type GlobalPosition
Definition: discretization/pq1bubble/subcontrolvolume.hh:45
static const int dim
Definition: discretization/pq1bubble/subcontrolvolume.hh:36
typename Grid::ctype Scalar
Definition: discretization/pq1bubble/subcontrolvolume.hh:41
typename GridView::Grid Grid
Definition: discretization/pq1bubble/subcontrolvolume.hh:34
typename GeometryTraits::template CornerStorage< dim, dimWorld >::Type CornerStorage
Definition: discretization/pq1bubble/subcontrolvolume.hh:44
Dune::MultiLinearGeometry< Scalar, dim, dimWorld, GeometryTraits > Geometry
Definition: discretization/pq1bubble/subcontrolvolume.hh:43
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/pq1bubble/subcontrolvolume.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.