3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * 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_PQ1BUBBLE_SUBCONTROLVOLUME_HH
25#define DUMUX_DISCRETIZATION_PQ1BUBBLE_SUBCONTROLVOLUME_HH
26
27#include <dune/geometry/type.hh>
28#include <dune/geometry/multilineargeometry.hh>
29
30#include <dumux/common/math.hh>
34
35namespace Dumux {
36
43template<class GridView>
45{
46 using Grid = typename GridView::Grid;
47
48 static const int dim = Grid::dimension;
49 static const int dimWorld = Grid::dimensionworld;
50
53 using Scalar = typename Grid::ctype;
55 using Geometry = Dune::MultiLinearGeometry<Scalar, dim, dimWorld, GeometryTraits>;
56 using CornerStorage = typename GeometryTraits::template CornerStorage<dim, dimWorld>::Type;
57 using GlobalPosition = typename CornerStorage::value_type;
58};
59
66template<class GridView, class T = PQ1BubbleDefaultScvGeometryTraits<GridView>>
68{
69 using GlobalPosition = typename T::GlobalPosition;
70 using Scalar = typename T::Scalar;
71 using GridIndexType = typename T::GridIndexType;
72 using LocalIndexType = typename T::LocalIndexType;
73
74public:
76 using Traits = T;
77
79
81 const GlobalPosition& dofPosition,
82 const GlobalPosition& center,
83 const LocalIndexType indexInElement,
84 const GridIndexType eIdx,
85 const GridIndexType dofIdx,
86 bool overlapping = false)
87
88 : center_(center)
89 , dofPosition_(dofPosition)
90 , volume_(volume)
91 , indexInElement_(indexInElement)
92 , eIdx_(eIdx)
93 , dofIdx_(dofIdx)
94 , overlapping_(overlapping)
95 {}
96
98 const GlobalPosition& center() const
99 { return center_; }
100
102 const GlobalPosition& dofPosition() const
103 { return dofPosition_; }
104
105 Scalar volume() const
106 { return volume_; }
107
109 bool isOverlapping() const
110 { return overlapping_; }
111
112 GridIndexType dofIndex() const
113 { return dofIdx_; }
114
115 LocalIndexType indexInElement() const
116 { return indexInElement_; }
117
118 GridIndexType elementIndex() const
119 { return eIdx_; }
120
121 LocalIndexType localDofIndex() const
122 { return indexInElement_; }
123
124private:
125 GlobalPosition center_;
126 GlobalPosition dofPosition_;
127 Scalar volume_;
128 LocalIndexType indexInElement_;
129 GridIndexType eIdx_;
130 GridIndexType dofIdx_;
131 bool overlapping_;
132};
133
134} // end namespace Dumux
135
136#endif
Defines the index types used for grid and local indices.
Define some often used mathematical functions.
Base class for a sub control volume.
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:39
unsigned int LocalIndex
Definition: indextraits.hh:40
Traits for an efficient corner storage for the PQ1Bubble method.
Definition: discretization/pq1bubble/geometryhelper.hh:46
Default traits class to be used for the sub-control volumes for the pq1bubble scheme.
Definition: discretization/pq1bubble/subcontrolvolume.hh:45
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/pq1bubble/subcontrolvolume.hh:51
static const int dimWorld
Definition: discretization/pq1bubble/subcontrolvolume.hh:49
typename CornerStorage::value_type GlobalPosition
Definition: discretization/pq1bubble/subcontrolvolume.hh:57
static const int dim
Definition: discretization/pq1bubble/subcontrolvolume.hh:48
typename Grid::ctype Scalar
Definition: discretization/pq1bubble/subcontrolvolume.hh:53
typename GridView::Grid Grid
Definition: discretization/pq1bubble/subcontrolvolume.hh:46
typename GeometryTraits::template CornerStorage< dim, dimWorld >::Type CornerStorage
Definition: discretization/pq1bubble/subcontrolvolume.hh:56
Dune::MultiLinearGeometry< Scalar, dim, dimWorld, GeometryTraits > Geometry
Definition: discretization/pq1bubble/subcontrolvolume.hh:55
typename IndexTraits< GridView >::LocalIndex LocalIndexType
Definition: discretization/pq1bubble/subcontrolvolume.hh:52
the sub control volume for the pq1bubble scheme
Definition: discretization/pq1bubble/subcontrolvolume.hh:68
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:80
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/pq1bubble/subcontrolvolume.hh:98
GridIndexType dofIndex() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:112
Scalar volume() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:105
const GlobalPosition & dofPosition() const
The position of the degree of freedom.
Definition: discretization/pq1bubble/subcontrolvolume.hh:102
LocalIndexType localDofIndex() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:121
bool isOverlapping() const
returns true if the sub control volume is overlapping with another scv
Definition: discretization/pq1bubble/subcontrolvolume.hh:109
T Traits
state the traits public and thus export all types
Definition: discretization/pq1bubble/subcontrolvolume.hh:76
LocalIndexType indexInElement() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:115
GridIndexType elementIndex() const
Definition: discretization/pq1bubble/subcontrolvolume.hh:118
Helper class constructing the dual grid finite volume geometries for the cvfe discretizazion method.