3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
discretization/facecentered/diamond/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_FACECENTERED_DIAMOND_SUBCONTROLVOLUME_HH
25#define DUMUX_DISCRETIZATION_FACECENTERED_DIAMOND_SUBCONTROLVOLUME_HH
26
27#include <array>
28#include <utility>
29#include <typeinfo>
30
31#include <dune/geometry/multilineargeometry.hh>
32
34#include "geometryhelper.hh"
35
36namespace Dumux {
37
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;
54 using Geometry = Dune::MultiLinearGeometry<Scalar, dim, dimWorld, FCDiamondMLGeometryTraits<Scalar>>;
55
57 using GlobalPosition = typename CornerStorage::value_type;
58
59 static constexpr Dune::GeometryType geometryType(Dune::GeometryType elementType)
60 {
61 if (elementType == Dune::GeometryTypes::hexahedron)
62 return Dune::GeometryTypes::pyramid;
63 else
64 return Dune::GeometryTypes::simplex(dim);
65 }
66};
67
72template<class GridView, class T = FaceCenteredDiamondScvGeometryTraits<GridView>>
74{
75 using Scalar = typename T::Scalar;
76 using GridIndexType = typename T::GridIndexType;
77 using LocalIndexType = typename T::LocalIndexType;
78
79public:
80 using GlobalPosition = typename T::GlobalPosition;
82 using Traits = T;
83
85
89 const LocalIndexType indexInElement,
90 const GridIndexType eIdx,
91 const GridIndexType dofIdx)
92 : center_(center)
93 , dofPosition_(dofPosition)
94 , volume_(volume)
95 , indexInElement_(indexInElement)
96 , eIdx_(eIdx)
97 , dofIdx_(dofIdx)
98 {}
99
101 const GlobalPosition& center() const
102 { return center_; }
103
106 { return dofPosition_; }
107
108 Scalar volume() const
109 { return volume_; }
110
111 GridIndexType dofIndex() const
112 { return dofIdx_; }
113
114 LocalIndexType indexInElement() const
115 { return indexInElement_; }
116
117 GridIndexType elementIndex() const
118 { return eIdx_; }
119
120 LocalIndexType localDofIndex() const
121 { return indexInElement_; }
122
123private:
124 GlobalPosition center_;
125 GlobalPosition dofPosition_;
126 Scalar volume_;
127 LocalIndexType indexInElement_;
128 GridIndexType eIdx_;
129 GridIndexType dofIdx_;
130};
131
132} // end namespace Dumux
133
134#endif
Defines the index types used for grid and local indices.
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
std::uint_least8_t SmallLocalIndex
Definition: indextraits.hh:41
Traits for an efficient corner storage for fc diamond method.
Definition: discretization/facecentered/diamond/geometryhelper.hh:41
Default traits class to be used for the sub-control volumes.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:45
static const int dim
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:48
typename Grid::ctype Scalar
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:53
typename FCDiamondMLGeometryTraits< Scalar >::template CornerStorage< dim, dimWorld >::Type CornerStorage
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:56
typename IndexTraits< GridView >::SmallLocalIndex LocalIndexType
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:52
static constexpr Dune::GeometryType geometryType(Dune::GeometryType elementType)
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:59
typename CornerStorage::value_type GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:57
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:51
typename GridView::Grid Grid
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:46
Dune::MultiLinearGeometry< Scalar, dim, dimWorld, FCDiamondMLGeometryTraits< Scalar > > Geometry
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:54
static const int dimWorld
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:49
Face centered diamond subcontrolvolume face.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:74
LocalIndexType indexInElement() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:114
GridIndexType dofIndex() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:111
const GlobalPosition & dofPosition() const
The position of the degree of freedom.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:105
GridIndexType elementIndex() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:117
LocalIndexType localDofIndex() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:120
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:101
Scalar volume() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:108
typename T::GlobalPosition GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:80
FaceCenteredDiamondSubControlVolume(const Scalar &volume, const GlobalPosition &dofPosition, const GlobalPosition &center, const LocalIndexType indexInElement, const GridIndexType eIdx, const GridIndexType dofIdx)
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:86
T Traits
state the traits public and thus export all types
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:82
Helper class constructing the dual grid finite volume geometries for the box discrete fracture model.