opm-simulators
Toggle main menu visibility
Loading...
Searching...
No Matches
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 <dune/common/fvector.hh>
32
33
#include <
opm/models/discretization/common/fvbaseproperties.hh
>
34
35
namespace
Opm
{
36
42
template
<
class
TypeTag>
43
class
FvBaseConstraintsContext
44
{
45
using
Problem =
GetPropType<TypeTag, Properties::Problem>
;
46
using
Model =
GetPropType<TypeTag, Properties::Model>
;
47
using
ElementContext =
GetPropType<TypeTag, Properties::ElementContext>
;
48
using
GridView =
GetPropType<TypeTag, Properties::GridView>
;
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
56
public
:
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
112
protected
:
113
const
ElementContext& elemCtx_;
114
};
115
116
}
// namespace Opm
117
118
#endif
Opm::FvBaseConstraintsContext::globalSpaceIndex
int globalSpaceIndex(int dofIdx, int timeIdx) const
Definition
fvbaseconstraintscontext.hh:103
Opm::FvBaseConstraintsContext::gridView
const GridView & gridView() const
Definition
fvbaseconstraintscontext.hh:79
Opm::FvBaseConstraintsContext::numDof
int numDof(int timeIdx) const
Definition
fvbaseconstraintscontext.hh:91
Opm::FvBaseConstraintsContext::FvBaseConstraintsContext
FvBaseConstraintsContext(const ElementContext &elemCtx)
The constructor.
Definition
fvbaseconstraintscontext.hh:60
Opm::FvBaseConstraintsContext::model
const Model & model() const
Definition
fvbaseconstraintscontext.hh:73
Opm::FvBaseConstraintsContext::problem
const Problem & problem() const
Definition
fvbaseconstraintscontext.hh:67
Opm::FvBaseConstraintsContext::pos
GlobalPosition pos(int dofIdx, int timeIdx) const
Definition
fvbaseconstraintscontext.hh:109
Opm::FvBaseConstraintsContext::element
const Element & element() const
Definition
fvbaseconstraintscontext.hh:85
Opm::FvBaseConstraintsContext::numInteriorFaces
int numInteriorFaces(int timeIdx) const
Definition
fvbaseconstraintscontext.hh:97
fvbaseproperties.hh
Declare the properties used by the infrastructure code of the finite volume discretizations.
Opm
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition
blackoilbioeffectsmodules.hh:43
Opm::GetPropType
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:233
opm
models
discretization
common
fvbaseconstraintscontext.hh
Generated by
1.17.0