3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
fluxvariablesbase.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_FLUXVARIABLESBASE_HH
25#define DUMUX_DISCRETIZATION_FLUXVARIABLESBASE_HH
26
27#include <vector>
28
29namespace Dumux {
30
40template<class Problem,
41 class FVElementGeometry,
42 class ElementVolumeVariables,
43 class ElementFluxVariablesCache>
45{
46 using GridView = typename FVElementGeometry::GridGeometry::GridView;
47 using Element = typename GridView::template Codim<0>::Entity;
48 using Stencil = std::vector<std::size_t>;
49 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
50
51public:
52
54 void init(const Problem& problem,
55 const Element& element,
56 const FVElementGeometry& fvGeometry,
57 const ElementVolumeVariables& elemVolVars,
58 const SubControlVolumeFace &scvFace,
59 const ElementFluxVariablesCache& elemFluxVarsCache)
60 {
61 problemPtr_ = &problem;
62 elementPtr_ = &element;
63 scvFacePtr_ = &scvFace;
64 fvGeometryPtr_ = &fvGeometry;
65 elemVolVarsPtr_ = &elemVolVars;
66 elemFluxVarsCachePtr_ = &elemFluxVarsCache;
67 }
68
69 const Problem& problem() const
70 { return *problemPtr_; }
71
72 const Element& element() const
73 { return *elementPtr_; }
74
75 const SubControlVolumeFace& scvFace() const
76 { return *scvFacePtr_; }
77
78 const FVElementGeometry& fvGeometry() const
79 { return *fvGeometryPtr_; }
80
81 const ElementVolumeVariables& elemVolVars() const
82 { return *elemVolVarsPtr_; }
83
84 const ElementFluxVariablesCache& elemFluxVarsCache() const
85 { return *elemFluxVarsCachePtr_; }
86
87private:
88 const Problem* problemPtr_;
89 const Element* elementPtr_;
90 const FVElementGeometry* fvGeometryPtr_;
91 const SubControlVolumeFace* scvFacePtr_;
92 const ElementVolumeVariables* elemVolVarsPtr_;
93 const ElementFluxVariablesCache* elemFluxVarsCachePtr_;
94};
95
96} // end namespace Dumux
97
98#endif
Definition: adapt.hh:29
Base class for the flux variables living on a sub control volume face.
Definition: fluxvariablesbase.hh:45
const ElementVolumeVariables & elemVolVars() const
Definition: fluxvariablesbase.hh:81
const SubControlVolumeFace & scvFace() const
Definition: fluxvariablesbase.hh:75
const ElementFluxVariablesCache & elemFluxVarsCache() const
Definition: fluxvariablesbase.hh:84
void init(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvFace, const ElementFluxVariablesCache &elemFluxVarsCache)
Initialize the flux variables storing some temporary pointers.
Definition: fluxvariablesbase.hh:54
const FVElementGeometry & fvGeometry() const
Definition: fluxvariablesbase.hh:78
const Element & element() const
Definition: fluxvariablesbase.hh:72
const Problem & problem() const
Definition: fluxvariablesbase.hh:69