version 3.8
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// 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_FACECENTERED_DIAMOND_SUBCONTROLVOLUME_HH
13#define DUMUX_DISCRETIZATION_FACECENTERED_DIAMOND_SUBCONTROLVOLUME_HH
14
15#include <array>
16#include <utility>
17#include <typeinfo>
18
19#include <dune/geometry/multilineargeometry.hh>
20
22#include "geometryhelper.hh"
23
24namespace Dumux {
25
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;
42 using Geometry = Dune::MultiLinearGeometry<Scalar, dim, dimWorld, FCDiamondMLGeometryTraits<Scalar>>;
43
45 using GlobalPosition = typename CornerStorage::value_type;
46
47 static constexpr Dune::GeometryType geometryType(Dune::GeometryType elementType)
48 {
49 if (elementType == Dune::GeometryTypes::hexahedron)
50 return Dune::GeometryTypes::pyramid;
51 else
52 return Dune::GeometryTypes::simplex(dim);
53 }
54};
55
60template<class GridView, class T = FaceCenteredDiamondScvGeometryTraits<GridView>>
62{
63 using Scalar = typename T::Scalar;
64 using GridIndexType = typename T::GridIndexType;
65 using LocalIndexType = typename T::LocalIndexType;
66
67public:
68 using GlobalPosition = typename T::GlobalPosition;
70 using Traits = T;
71
73
77 const LocalIndexType indexInElement,
78 const GridIndexType eIdx,
79 const GridIndexType dofIdx)
80 : center_(center)
81 , dofPosition_(dofPosition)
82 , volume_(volume)
83 , indexInElement_(indexInElement)
84 , eIdx_(eIdx)
85 , dofIdx_(dofIdx)
86 {}
87
89 const GlobalPosition& center() const
90 { return center_; }
91
94 { return dofPosition_; }
95
96 Scalar volume() const
97 { return volume_; }
98
99 GridIndexType dofIndex() const
100 { return dofIdx_; }
101
102 LocalIndexType indexInElement() const
103 { return indexInElement_; }
104
105 GridIndexType elementIndex() const
106 { return eIdx_; }
107
108 LocalIndexType localDofIndex() const
109 { return indexInElement_; }
110
111private:
112 GlobalPosition center_;
113 GlobalPosition dofPosition_;
114 Scalar volume_;
115 LocalIndexType indexInElement_;
116 GridIndexType eIdx_;
117 GridIndexType dofIdx_;
118};
119
120} // end namespace Dumux
121
122#endif
Face centered diamond subcontrolvolume face.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:62
LocalIndexType indexInElement() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:102
GridIndexType dofIndex() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:99
const GlobalPosition & dofPosition() const
The position of the degree of freedom.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:93
GridIndexType elementIndex() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:105
LocalIndexType localDofIndex() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:108
const GlobalPosition & center() const
The center of the sub control volume.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:89
Scalar volume() const
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:96
typename T::GlobalPosition GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:68
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:74
T Traits
state the traits public and thus export all types
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:70
Defines the index types used for grid and local indices.
Definition: adapt.hh:17
Helper class constructing the dual grid finite volume geometries for the box discrete fracture model.
Traits for an efficient corner storage for fc diamond method.
Definition: discretization/facecentered/diamond/geometryhelper.hh:29
Default traits class to be used for the sub-control volumes.
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:33
static const int dim
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:36
typename Grid::ctype Scalar
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:41
typename FCDiamondMLGeometryTraits< Scalar >::template CornerStorage< dim, dimWorld >::Type CornerStorage
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:44
typename IndexTraits< GridView >::SmallLocalIndex LocalIndexType
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:40
static constexpr Dune::GeometryType geometryType(Dune::GeometryType elementType)
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:47
typename CornerStorage::value_type GlobalPosition
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:45
typename IndexTraits< GridView >::GridIndex GridIndexType
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:39
typename GridView::Grid Grid
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:34
Dune::MultiLinearGeometry< Scalar, dim, dimWorld, FCDiamondMLGeometryTraits< Scalar > > Geometry
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:42
static const int dimWorld
Definition: discretization/facecentered/diamond/subcontrolvolume.hh:37
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
std::uint_least8_t SmallLocalIndex
Definition: indextraits.hh:29