fvbaseconstraintscontext.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 This file is part of the Open Porous Media project (OPM).
5
6 OPM 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 2 of the License, or
9 (at your option) any later version.
10
11 OPM 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 OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
28#ifndef EWOMS_FV_BASE_CONSTRAINTS_CONTEXT_HH
29#define EWOMS_FV_BASE_CONSTRAINTS_CONTEXT_HH
30
31#include "fvbaseproperties.hh"
32
33#include <dune/common/fvector.hh>
34
35namespace Opm {
36
42template<class TypeTag>
44{
49 using Element = typename GridView::template Codim<0>::Entity;
50
51 enum { dimWorld = GridView::dimensionworld };
52
53 using CoordScalar = typename GridView::ctype;
54 using GlobalPosition = Dune::FieldVector<CoordScalar, dimWorld>;
55
56public:
60 explicit FvBaseConstraintsContext(const ElementContext& elemCtx)
61 : elemCtx_(elemCtx)
62 { }
63
67 const Problem& problem() const
68 { return elemCtx_.problem(); }
69
73 const Model& model() const
74 { return elemCtx_.model(); }
75
79 const GridView& gridView() const
80 { return elemCtx_.gridView(); }
81
85 const Element& element() const
86 { return elemCtx_.element(); }
87
91 int numDof(int timeIdx) const
92 { return elemCtx_.numDof(timeIdx); }
93
97 int numInteriorFaces(int timeIdx) const
98 { return elemCtx_.numInteriorFaces(timeIdx); }
99
103 int globalSpaceIndex(int dofIdx, int timeIdx) const
104 { return elemCtx_.globalSpaceIndex(dofIdx, timeIdx); }
105
109 GlobalPosition pos(int dofIdx, int timeIdx) const
110 { return elemCtx_.pos(dofIdx, timeIdx); }
111
112protected:
113 const ElementContext& elemCtx_;
114};
115
116} // namespace Opm
117
118#endif
Represents all quantities which available for calculating constraints.
Definition: fvbaseconstraintscontext.hh:44
int globalSpaceIndex(int dofIdx, int timeIdx) const
Definition: fvbaseconstraintscontext.hh:103
const ElementContext & elemCtx_
Definition: fvbaseconstraintscontext.hh:113
const GridView & gridView() const
Definition: fvbaseconstraintscontext.hh:79
int numDof(int timeIdx) const
Definition: fvbaseconstraintscontext.hh:91
FvBaseConstraintsContext(const ElementContext &elemCtx)
The constructor.
Definition: fvbaseconstraintscontext.hh:60
const Model & model() const
Definition: fvbaseconstraintscontext.hh:73
const Problem & problem() const
Definition: fvbaseconstraintscontext.hh:67
GlobalPosition pos(int dofIdx, int timeIdx) const
Definition: fvbaseconstraintscontext.hh:109
const Element & element() const
Definition: fvbaseconstraintscontext.hh:85
int numInteriorFaces(int timeIdx) const
Definition: fvbaseconstraintscontext.hh:97
Declare the properties used by the infrastructure code of the finite volume discretizations.
Definition: blackoilboundaryratevector.hh:37
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:235