Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
85222dda
Commit
85222dda
authored
Mar 05, 2018
by
Timo Koch
Browse files
[elementsolution] Use free elementSolution function in dumux
parent
3e6de64c
Changes
47
Hide whitespace changes
Inline
Side-by-side
dumux/assembly/boxlocalassembler.hh
View file @
85222dda
...
...
@@ -36,6 +36,7 @@
#include
<dumux/assembly/fvlocalassemblerbase.hh>
#include
<dumux/assembly/partialreassembler.hh>
#include
<dumux/assembly/entitycolor.hh>
#include
<dumux/discretization/box/elementsolution.hh>
namespace
Dumux
{
...
...
@@ -216,7 +217,6 @@ class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/tr
using
ThisType
=
BoxLocalAssembler
<
TypeTag
,
Assembler
,
DiffMethod
::
numeric
,
true
>
;
using
ParentType
=
BoxLocalAssemblerBase
<
TypeTag
,
Assembler
,
ThisType
,
true
>
;
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
GridVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVariables
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
JacobianMatrix
=
typename
GET_PROP_TYPE
(
TypeTag
,
JacobianMatrix
);
...
...
@@ -260,7 +260,7 @@ public:
//////////////////////////////////////////////////////////////////////////////////////////////////
// create the element solution
ElementSolutionVector
elemSol
(
element
,
curSol
,
fvGeometry
);
auto
elemSol
=
elementSolution
(
element
,
curSol
,
fvGeometry
.
fvGridGeometry
()
);
// create the vector storing the partial derivatives
ElementResidualVector
partialDerivs
(
element
.
subEntities
(
dim
));
...
...
@@ -336,7 +336,6 @@ class BoxLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/fa
using
ThisType
=
BoxLocalAssembler
<
TypeTag
,
Assembler
,
DiffMethod
::
numeric
,
false
>
;
using
ParentType
=
BoxLocalAssemblerBase
<
TypeTag
,
Assembler
,
ThisType
,
false
>
;
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
GridVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVariables
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
JacobianMatrix
=
typename
GET_PROP_TYPE
(
TypeTag
,
JacobianMatrix
);
...
...
@@ -381,7 +380,7 @@ public:
//////////////////////////////////////////////////////////////////////////////////////////////////
// create the element solution
ElementSolutionVector
elemSol
(
element
,
curSol
,
fvGeometry
);
auto
elemSol
=
elementSolution
(
element
,
curSol
,
fvGeometry
.
fvGridGeometry
()
);
// create the vector storing the partial derivatives
ElementResidualVector
partialDerivs
(
element
.
subEntities
(
dim
));
...
...
dumux/assembly/cclocalassembler.hh
View file @
85222dda
...
...
@@ -39,6 +39,7 @@
#include
<dumux/assembly/entitycolor.hh>
#include
<dumux/assembly/partialreassembler.hh>
#include
<dumux/discretization/fluxstencil.hh>
#include
<dumux/discretization/cellcentered/elementsolution.hh>
namespace
Dumux
{
...
...
@@ -134,9 +135,8 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/tru
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
LocalResidualValues
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
using
Element
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
)
::
template
Codim
<
0
>
::
Entity
;
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
GridVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVariables
);
using
JacobianMatrix
=
typename
GET_PROP_TYPE
(
TypeTag
,
JacobianMatrix
);
...
...
@@ -219,7 +219,7 @@ public:
const
auto
origVolVars
=
curVolVars
;
// element solution container to be deflected
ElementSolutionVector
elemSol
(
origPriVars
);
auto
elemSol
=
elementSolution
(
element
,
curSol
,
fvGridGeometry
);
// derivatives in the neighbors with repect to the current elements
// in index 0 we save the derivative of the element residual with respect to it's own dofs
...
...
@@ -313,7 +313,6 @@ class CCLocalAssembler<TypeTag, Assembler, DiffMethod::numeric, /*implicit=*/fal
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
LocalResidualValues
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
using
Element
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
)
::
template
Codim
<
0
>
::
Entity
;
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
GridVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVariables
);
using
JacobianMatrix
=
typename
GET_PROP_TYPE
(
TypeTag
,
JacobianMatrix
);
...
...
@@ -360,7 +359,8 @@ public:
const
auto
origVolVars
=
curVolVars
;
// element solution container to be deflected
ElementSolutionVector
elemSol
(
origPriVars
);
auto
elemSol
=
elementSolution
(
element
,
curSol
,
fvGridGeometry
);
LocalResidualValues
partialDeriv
;
// derivatives in the neighbors with repect to the current elements
...
...
dumux/assembly/staggeredlocalassembler.hh
View file @
85222dda
...
...
@@ -22,8 +22,8 @@
* \ingroup Assembly
* \brief An assembler for Jacobian and residual contribution per element (staggered FV method)
*/
#ifndef DUMUX_
CC
_LOCAL_ASSEMBLER_HH
#define DUMUX_
CC
_LOCAL_ASSEMBLER_HH
#ifndef DUMUX_
STAGGERED
_LOCAL_ASSEMBLER_HH
#define DUMUX_
STAGGERED
_LOCAL_ASSEMBLER_HH
#include
<dune/istl/matrixindexset.hh>
#include
<dune/istl/bvector.hh>
...
...
@@ -32,6 +32,7 @@
#include
<dumux/assembly/diffmethod.hh>
#include
<dumux/discretization/staggered/facesolution.hh>
#include
<dumux/discretization/staggered/elementsolution.hh>
#include
<dune/common/version.hh>
...
...
@@ -69,12 +70,12 @@ class StaggeredLocalAssembler<TypeTag,
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
NumEqVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
NumEqVector
);
using
ElementBoundaryTypes
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementBoundaryTypes
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
GridFaceVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridFaceVariables
);
using
ElementFluxVariablesCache
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementFluxVariablesCache
);
using
Element
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
)
::
template
Codim
<
0
>
::
Entity
;
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
ElementVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementVolumeVariables
);
using
GridVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVolumeVariables
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
...
...
@@ -341,7 +342,7 @@ protected:
const
Scalar
eps
=
numericEpsilon
(
priVars
[
pvIdx
],
cellCenterIdx
,
cellCenterIdx
);
priVars
[
pvIdx
]
+=
eps
;
ElementSolutionVector
elemSol
{
std
::
move
(
priVars
)
}
;
auto
elemSol
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
std
::
move
(
priVars
)
)
;
curVolVars
.
update
(
elemSol
,
problem
,
elementJ
,
scvJ
);
const
auto
deflectedResidual
=
localResidual
.
evalCellCenter
(
problem
,
element
,
fvGeometry
,
prevElemVolVars
,
curElemVolVars
,
...
...
@@ -468,7 +469,7 @@ protected:
const
Scalar
eps
=
numericEpsilon
(
priVars
[
pvIdx
],
faceIdx
,
cellCenterIdx
);
priVars
[
pvIdx
]
+=
eps
;
ElementSolutionVector
elemSol
{
std
::
move
(
priVars
)
}
;
auto
elemSol
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
std
::
move
(
priVars
)
)
;
curVolVars
.
update
(
elemSol
,
problem
,
elementJ
,
scvJ
);
const
auto
deflectedResidual
=
localResidual
.
evalFace
(
problem
,
element
,
fvGeometry
,
scvf
,
...
...
dumux/common/fvproblem.hh
View file @
85222dda
...
...
@@ -62,7 +62,6 @@ class FVProblem
using
PointSource
=
typename
GET_PROP_TYPE
(
TypeTag
,
PointSource
);
using
PointSourceHelper
=
typename
GET_PROP_TYPE
(
TypeTag
,
PointSourceHelper
);
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
ElementVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementVolumeVariables
);
...
...
@@ -520,9 +519,10 @@ public:
* thought as pipes with a cross section of 1 m^2 and 2D problems
* are assumed to extend 1 m to the back.
*/
Scalar
extrusionFactor
(
const
Element
&
element
,
const
SubControlVolume
&
scv
,
const
ElementSolutionVector
&
elemSol
)
const
template
<
class
ElementSolution
>
Scalar
extrusionFactor
(
const
Element
&
element
,
const
SubControlVolume
&
scv
,
const
ElementSolution
&
elemSol
)
const
{
// forward to generic interface
return
asImp_
().
extrusionFactorAtPos
(
scv
.
center
());
...
...
dumux/common/staggeredfvproblem.hh
View file @
85222dda
...
...
@@ -55,7 +55,6 @@ class StaggeredFVProblem : public FVProblem<TypeTag>
using
PrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
PrimaryVariables
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
ElementVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementVolumeVariables
);
using
Indices
=
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
...
...
dumux/discretization/box/elementvolumevariables.hh
View file @
85222dda
...
...
@@ -25,9 +25,9 @@
#include
<dumux/common/properties.hh>
#include
<dumux/discretization/methods.hh>
#include
<dumux/discretization/box/elementsolution.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup ImplicitModel
...
...
@@ -106,7 +106,6 @@ class BoxElementVolumeVariables<TypeTag, /*enableGlobalVolVarCache*/false>
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
IndexType
=
typename
GridView
::
IndexSet
::
IndexType
;
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
static
const
int
dim
=
GridView
::
dimension
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -133,7 +132,7 @@ public:
const
SolutionVector
&
sol
)
{
// get the solution at the dofs of the element
ElementSolutionVector
elemSol
(
element
,
sol
,
fvGeometry
);
auto
elemSol
=
elementSolution
(
element
,
sol
,
fvGeometry
.
fvGridGeometry
()
);
// resize volume variables to the required size
volumeVariables_
.
resize
(
fvGeometry
.
numScv
());
...
...
dumux/discretization/box/gridvolumevariables.hh
View file @
85222dda
...
...
@@ -25,6 +25,7 @@
#include
<dumux/common/properties.hh>
#include
<dumux/discretization/box/elementvolumevariables.hh>
#include
<dumux/discretization/box/elementsolution.hh>
//! make the local view function available whenever we use this class
#include
<dumux/discretization/localview.hh>
...
...
@@ -50,7 +51,6 @@ class BoxGridVolumeVariables<TypeTag,/*enableGlobalVolVarCache*/true>
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
IndexType
=
typename
GridView
::
IndexSet
::
IndexType
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
static
const
int
dim
=
GridView
::
dimension
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
...
...
@@ -75,7 +75,7 @@ public:
fvGeometry
.
bindElement
(
element
);
// get the element solution
ElementSolutionVector
elemSol
(
element
,
sol
,
fvGeometry
);
auto
elemSol
=
elementSolution
(
element
,
sol
,
fvG
ridG
eometry
);
// update the volvars of the element
volumeVariables_
[
eIdx
].
resize
(
fvGeometry
.
numScv
());
...
...
dumux/discretization/cellcentered/gridvolumevariables.hh
View file @
85222dda
...
...
@@ -28,6 +28,7 @@
//! make the local view function available whenever we use this class
#include
<dumux/discretization/localview.hh>
#include
<dumux/discretization/cellcentered/elementsolution.hh>
namespace
Dumux
{
...
...
@@ -51,7 +52,6 @@ class CCGridVolumeVariables<TypeTag, /*enableGridVolVarsCache*/true>
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
ElementSolution
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
IndexType
=
typename
GridView
::
IndexSet
::
IndexType
;
...
...
@@ -81,7 +81,7 @@ public:
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
const
E
lementSolution
elem
Sol
({
sol
[
scv
.
dofIndex
()]}
);
const
auto
elemSol
=
e
lementSolution
(
elem
ent
,
sol
,
fvGridGeometry
);
volumeVariables_
[
scv
.
dofIndex
()].
update
(
elemSol
,
problem
(),
element
,
scv
);
}
...
...
@@ -98,7 +98,7 @@ public:
{
const
auto
insideScvIdx
=
scvf
.
insideScvIdx
();
const
auto
&
insideScv
=
fvGeometry
.
scv
(
insideScvIdx
);
const
ElementSolution
dirichletPriVars
({
problem
().
dirichlet
(
element
,
scvf
)
}
);
const
auto
dirichletPriVars
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
problem
().
dirichlet
(
element
,
scvf
));
volumeVariables_
[
scvf
.
outsideScvIdx
()].
update
(
dirichletPriVars
,
problem
(),
...
...
dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh
View file @
85222dda
...
...
@@ -26,9 +26,9 @@
#include
<utility>
#include
<dumux/common/properties.hh>
#include
<dumux/discretization/cellcentered/elementsolution.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup CCMpfaDiscretization
...
...
@@ -102,14 +102,13 @@ class CCMpfaElementVolumeVariables<TypeTag, /*enableGridVolVarsCache*/false>
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
ElementSolution
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
GridVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVolumeVariables
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
GridIndexType
=
typename
GridView
::
IndexSet
::
IndexType
;
public:
//! Export type of the solution vector
using
SolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
);
...
...
@@ -141,7 +140,7 @@ public:
// update the volume variables of the element at hand
const
auto
&
scvI
=
fvGeometry
.
scv
(
globalI
);
volumeVariables_
[
localIdx
].
update
(
E
lementSolution
(
sol
[
globalI
]
),
volumeVariables_
[
localIdx
].
update
(
e
lementSolution
(
element
,
sol
,
fvGridGeometry
),
problem
,
element
,
scvI
);
...
...
@@ -153,7 +152,7 @@ public:
{
const
auto
&
elementJ
=
fvGridGeometry
.
element
(
dataJ
.
globalJ
);
const
auto
&
scvJ
=
fvGeometry
.
scv
(
dataJ
.
globalJ
);
volumeVariables_
[
localIdx
].
update
(
E
lementSolution
(
sol
[
dataJ
.
globalJ
]
),
volumeVariables_
[
localIdx
].
update
(
e
lementSolution
(
elementJ
,
sol
,
fvGridGeometry
),
problem
,
elementJ
,
scvJ
);
...
...
@@ -183,7 +182,8 @@ public:
{
// boundary volume variables
VolumeVariables
dirichletVolVars
;
dirichletVolVars
.
update
(
ElementSolution
(
problem
.
dirichlet
(
element
,
scvf
)),
dirichletVolVars
.
update
(
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
problem
.
dirichlet
(
element
,
scvf
)),
problem
,
element
,
scvI
);
...
...
@@ -226,7 +226,7 @@ public:
// const auto& scvJ = fvGeometry.scv(globalJ);
// VolumeVariables additionalVolVars;
// additionalVolVars.update(
E
lementSolution(elementJ, sol, fvGridGeometry),
// additionalVolVars.update(
e
lementSolution(elementJ, sol, fvGridGeometry),
// problem,
// elementJ,
// scvJ);
...
...
@@ -244,13 +244,14 @@ public:
{
clear
();
auto
eIdx
=
fvGeometry
.
fvGridGeometry
().
elementMapper
().
index
(
element
);
const
auto
&
fvGridGeometry
=
fvGeometry
.
fvGridGeometry
();
auto
eIdx
=
fvGridGeometry
.
elementMapper
().
index
(
element
);
volumeVariables_
.
resize
(
1
);
volVarIndices_
.
resize
(
1
);
// update the volume variables of the element
const
auto
&
scv
=
fvGeometry
.
scv
(
eIdx
);
volumeVariables_
[
0
].
update
(
E
lementSolution
(
sol
[
scv
.
dofIndex
()]
),
volumeVariables_
[
0
].
update
(
e
lementSolution
(
element
,
sol
,
fvGridGeometry
),
gridVolVars
().
problem
(),
element
,
scv
);
...
...
@@ -332,7 +333,8 @@ private:
{
VolumeVariables
dirichletVolVars
;
const
auto
&
ivScv
=
fvGeometry
.
scv
(
insideScvIdx
);
dirichletVolVars
.
update
(
ElementSolution
(
problem
.
dirichlet
(
insideElement
,
ivScvf
)),
dirichletVolVars
.
update
(
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
problem
.
dirichlet
(
insideElement
,
ivScvf
)),
problem
,
insideElement
,
ivScv
);
...
...
dumux/discretization/cellcentered/tpfa/elementvolumevariables.hh
View file @
85222dda
...
...
@@ -25,9 +25,9 @@
#define DUMUX_DISCRETIZATION_CCTPFA_ELEMENT_VOLUMEVARIABLES_HH
#include
<dumux/common/properties.hh>
#include
<dumux/discretization/cellcentered/elementsolution.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup CCTpfaDiscretization
...
...
@@ -48,7 +48,6 @@ class CCTpfaElementVolumeVariables<TypeTag, /*enableGridVolVarsCache*/true>
{
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
ElementSolution
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
GridVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVolumeVariables
);
...
...
@@ -103,11 +102,11 @@ class CCTpfaElementVolumeVariables<TypeTag, /*enableGridVolVarsCache*/false>
{
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
ElementSolution
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
GridVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVolumeVariables
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVGridGeometry
::
SubControlVolume
;
using
IndexType
=
typename
GridView
::
IndexSet
::
IndexType
;
static
const
int
dim
=
GridView
::
dimension
;
...
...
@@ -141,7 +140,7 @@ public:
// update the volume variables of the element at hand
auto
&&
scvI
=
fvGeometry
.
scv
(
globalI
);
volumeVariables_
[
localIdx
].
update
(
E
lementSolution
(
sol
[
globalI
]
),
volumeVariables_
[
localIdx
].
update
(
e
lementSolution
(
element
,
sol
,
fvGridGeometry
),
problem
,
element
,
scvI
);
...
...
@@ -153,7 +152,7 @@ public:
{
const
auto
&
elementJ
=
fvGridGeometry
.
element
(
dataJ
.
globalJ
);
auto
&&
scvJ
=
fvGeometry
.
scv
(
dataJ
.
globalJ
);
volumeVariables_
[
localIdx
].
update
(
E
lementSolution
(
sol
[
dataJ
.
globalJ
]
),
volumeVariables_
[
localIdx
].
update
(
e
lementSolution
(
elementJ
,
sol
,
fvGridGeometry
),
problem
,
elementJ
,
scvJ
);
...
...
@@ -172,7 +171,8 @@ public:
const
auto
bcTypes
=
problem
.
boundaryTypes
(
element
,
scvf
);
if
(
bcTypes
.
hasOnlyDirichlet
())
{
const
ElementSolution
dirichletPriVars
({
problem
.
dirichlet
(
element
,
scvf
)});
const
auto
dirichletPriVars
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
problem
.
dirichlet
(
element
,
scvf
));
volumeVariables_
.
resize
(
localIdx
+
1
);
volVarIndices_
.
resize
(
localIdx
+
1
);
...
...
@@ -197,7 +197,7 @@ public:
// const auto& elementJ = fvGridGeometry.element(globalJ);
// auto&& scvJ = fvGeometry.scv(globalJ);
// volumeVariables_[localIdx].update(
E
lementSolution(
sol[globalJ]
),
// volumeVariables_[localIdx].update(
e
lementSolution(
elementJ, sol, fvGridGeometry
),
// problem,
// elementJ,
// scvJ);
...
...
@@ -220,7 +220,7 @@ public:
// update the volume variables of the element
auto
&&
scv
=
fvGeometry
.
scv
(
eIdx
);
volumeVariables_
[
0
].
update
(
E
lementSolution
(
sol
[
eIdx
]
),
volumeVariables_
[
0
].
update
(
e
lementSolution
(
element
,
sol
,
fvGeometry
.
fvGridGeometry
()
),
gridVolVars
().
problem
(),
element
,
scv
);
...
...
dumux/discretization/staggered/elementvolumevariables.hh
View file @
85222dda
...
...
@@ -26,9 +26,9 @@
#include
<dune/common/exceptions.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/discretization/staggered/elementsolution.hh>
namespace
Dumux
{
namespace
Dumux
{
/*!
* \ingroup StaggeredDiscretization
...
...
@@ -107,12 +107,12 @@ class StaggeredElementVolumeVariables<TypeTag, /*enableGridVolVarsCache*/false>
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Indices
=
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
);
using
ElementSolution
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
VolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
VolumeVariables
);
using
CellCenterPrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
CellCenterPrimaryVariables
);
using
GridVolumeVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridVolumeVariables
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVGridGeometry
::
SubControlVolume
;
using
IndexType
=
typename
GridView
::
IndexSet
::
IndexType
;
static
const
int
dim
=
GridView
::
dimension
;
...
...
@@ -161,7 +161,7 @@ public:
auto
&&
scvJ
=
fvGeometry
.
scv
(
globalJ
);
CellCenterPrimaryVariables
priVars
(
0.0
);
priVars
=
sol
[
cellCenterIdx
][
globalJ
];
ElementSolution
elemSol
{
std
::
move
(
priVars
)
}
;
auto
elemSol
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
std
::
move
(
priVars
)
)
;
volumeVariables_
[
localIdx
].
update
(
elemSol
,
problem
,
elementJ
,
...
...
@@ -197,7 +197,7 @@ public:
volumeVariables_
.
resize
(
localIdx
+
1
);
volVarIndices_
.
resize
(
localIdx
+
1
);
ElementSolution
elemSol
{
std
::
move
(
boundaryPriVars
)
}
;
auto
elemSol
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
std
::
move
(
boundaryPriVars
)
)
;
volumeVariables_
[
localIdx
].
update
(
elemSol
,
problem
,
element
,
...
...
@@ -223,7 +223,7 @@ public:
auto
&&
scv
=
fvGeometry
.
scv
(
eIdx
);
CellCenterPrimaryVariables
priVars
(
0.0
);
priVars
=
sol
[
cellCenterIdx
][
eIdx
];
ElementSolution
elemSol
{
std
::
move
(
priVars
)
}
;
auto
elemSol
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
std
::
move
(
priVars
)
)
;
volumeVariables_
[
0
].
update
(
elemSol
,
gridVolVars
().
problem
(),
element
,
...
...
dumux/discretization/staggered/gridvolumevariables.hh
View file @
85222dda
...
...
@@ -29,6 +29,7 @@
//! make the local view function available whenever we use this class
#include
<dumux/discretization/localview.hh>
#include
<dumux/discretization/staggered/elementsolution.hh>
namespace
Dumux
{
...
...
@@ -63,7 +64,6 @@ class StaggeredGridVolumeVariables<TypeTag, /*enableGridVolVarsCache*/true>
static
const
int
dim
=
GridView
::
dimension
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
CellCenterPrimaryVariables
=
typename
GET_PROP_TYPE
(
TypeTag
,
CellCenterPrimaryVariables
);
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
enum
{
numEqCellCenter
=
GET_PROP_VALUE
(
TypeTag
,
NumEqCellCenter
)
};
...
...
@@ -92,7 +92,7 @@ public:
{
CellCenterPrimaryVariables
priVars
(
0.0
);
priVars
=
sol
[
cellCenterIdx
][
scv
.
dofIndex
()];
ElementSolutionVector
elemSol
{
std
::
move
(
priVars
)
}
;
auto
elemSol
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
std
::
move
(
priVars
)
)
;
volumeVariables_
[
scv
.
dofIndex
()].
update
(
elemSol
,
problem
(),
element
,
scv
);
}
...
...
@@ -121,7 +121,7 @@ public:
if
(
eqIdx
==
Indices
::
pressureIdx
)
DUNE_THROW
(
Dune
::
InvalidStateException
,
"Face at: "
<<
scvf
.
center
()
<<
" has neither Dirichlet nor Neumann BC."
);
}
ElementSolutionVector
elemSol
{
std
::
move
(
boundaryPriVars
)
}
;
auto
elemSol
=
elementSolution
<
SolutionVector
,
FVGridGeometry
>
(
std
::
move
(
boundaryPriVars
)
)
;
volumeVariables_
[
scvf
.
outsideScvIdx
()].
update
(
elemSol
,
problem
(),
element
,
insideScv
);
}
}
...
...
dumux/freeflow/navierstokes/volumevariables.hh
View file @
85222dda
...
...
@@ -28,8 +28,7 @@
#include
<dumux/common/properties.hh>
#include
<dumux/material/fluidstates/immiscible.hh>
namespace
Dumux
{
namespace
Dumux
{
// forward declaration
template
<
class
TypeTag
,
bool
enableEnergyBalance
>
...
...
@@ -54,7 +53,6 @@ class NavierStokesVolumeVariablesImplementation<TypeTag, false>
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
Indices
=
typename
GET_PROP_TYPE
(
TypeTag
,
Indices
);
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
...
...
@@ -75,7 +73,8 @@ public:
* \param element An element which contains part of the control volume
* \param scv The sub-control volume
*/
void
update
(
const
ElementSolutionVector
&
elemSol
,
template
<
class
ElementSolution
>
void
update
(
const
ElementSolution
&
elemSol
,
const
Problem
&
problem
,
const
Element
&
element
,
const
SubControlVolume
&
scv
)
...
...
@@ -88,14 +87,16 @@ public:
/*!
* \brief Returns the primary variables at the dof associated with a given scv.
*/
static
const
auto
&
extractDofPriVars
(
const
ElementSolutionVector
&
elemSol
,
template
<
class
ElementSolution
>
static
const
auto
&
extractDofPriVars
(
const
ElementSolution
&
elemSol
,
const
SubControlVolume
&
scv
)
{
return
elemSol
[
0
];
}
/*!
* \brief Update the fluid state
*/
static
void
completeFluidState
(
const
ElementSolutionVector
&
elemSol
,
template
<
class
ElementSolution
>
static
void
completeFluidState
(
const
ElementSolution
&
elemSol
,
const
Problem
&
problem
,
const
Element
&
element
,
const
SubControlVolume
&
scv
,
...
...
@@ -195,7 +196,8 @@ public:
{
return
fluidState_
;
}
//! The temperature is obtained from the problem as a constant for isothermal models
static
Scalar
temperature
(
const
ElementSolutionVector
&
elemSol
,
template
<
class
ElementSolution
>
static
Scalar
temperature
(
const
ElementSolution
&
elemSol
,
const
Problem
&
problem
,
const
Element
&
element
,
const
SubControlVolume
&
scv
)
...
...
@@ -231,7 +233,6 @@ class NavierStokesVolumeVariablesImplementation<TypeTag, true>
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ElementSolutionVector
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementSolutionVector
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FluidSystem
=
typename
GET_PROP_TYPE
(
TypeTag
,
FluidSystem
);
...
...
@@ -254,7 +255,8 @@ public:
* \param element An element which contains part of the control volume
* \param scv The sub-control volume
*/
void
update
(
const
ElementSolutionVector
&
elemSol
,
template
<
class
ElementSolution
>
void
update
(
const
ElementSolution
&
elemSol
,
const
Problem
&
problem
,
const
Element
&
element
,
const
SubControlVolume
&
scv
)
...
...
@@ -267,7 +269,8 @@ public:
/*!