Skip to content
GitLab
Menu
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
7fd1d079
Commit
7fd1d079
authored
Aug 13, 2021
by
Kilian Weishaupt
Committed by
Timo Koch
Aug 17, 2021
Browse files
[discretization] Make local view calls with bind const
parent
dda73f24
Changes
98
Hide whitespace changes
Inline
Side-by-side
dumux/adaptive/initializationindicator.hh
View file @
7fd1d079
...
...
@@ -163,11 +163,11 @@ public:
continue
;
// get the fvGeometry and elementVolVars needed for the bc and source interfaces
auto
fvGeometry
=
localView
(
*
gridGeometry_
).
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVariables_
->
curGridVolVars
()).
bind
(
element
,
fvGeometry
,
sol
);
const
auto
fvGeometry
=
localView
(
*
gridGeometry_
).
bind
(
element
);
const
auto
elemVolVars
=
localView
(
gridVariables_
->
curGridVolVars
()).
bind
(
element
,
fvGeometry
,
sol
);
// elemFluxVarsCache for neumann interface
auto
elemFluxVarsCache
=
localView
(
gridVariables_
->
gridFluxVarsCache
()).
bind
(
element
,
fvGeometry
,
elemVolVars
);
const
auto
elemFluxVarsCache
=
localView
(
gridVariables_
->
gridFluxVarsCache
()).
bind
(
element
,
fvGeometry
,
elemVolVars
);
//! Check if we have to refine around a source term
if
(
refineAtSource_
)
...
...
dumux/assembly/fvlocalresidual.hh
View file @
7fd1d079
...
...
@@ -102,8 +102,8 @@ public:
const
SolutionVector
&
sol
)
const
{
// make sure FVElementGeometry and volume variables are bound to the element
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
()).
bind
(
element
,
fvGeometry
,
sol
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
const
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
()).
bind
(
element
,
fvGeometry
,
sol
);
ElementResidualVector
storage
(
fvGeometry
.
numScv
());
...
...
dumux/assembly/jacobianpattern.hh
View file @
7fd1d079
...
...
@@ -142,7 +142,7 @@ auto getJacobianPattern(const GridGeometry& gridGeometry)
else
{
static
constexpr
auto
faceIdx
=
GridGeometry
::
faceIdx
();
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
// loop over sub control faces
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
...
...
dumux/common/pointsource.hh
View file @
7fd1d079
...
...
@@ -307,7 +307,7 @@ public:
{
// check in which subcontrolvolume(s) we are
const
auto
element
=
boundingBoxTree
.
entitySet
().
entity
(
eIdx
);
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
globalPos
=
source
.
position
();
// loop over all sub control volumes and check if the point source is inside
...
...
dumux/common/staggeredfvproblem.hh
View file @
7fd1d079
...
...
@@ -175,7 +175,7 @@ public:
for
(
const
auto
&
element
:
elements
(
this
->
gridGeometry
().
gridView
()))
{
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
// loop over sub control volumes
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
...
...
dumux/discretization/box/gridfluxvariablescache.hh
View file @
7fd1d079
...
...
@@ -93,8 +93,8 @@ public:
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
// bind the geometries and volume variables to the element (all the elements in stencil)
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
const
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
fluxVarsCache_
[
eIdx
].
resize
(
fvGeometry
.
numScvf
());
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
...
...
dumux/discretization/box/gridvolumevariables.hh
View file @
7fd1d079
...
...
@@ -81,7 +81,7 @@ public:
for
(
const
auto
&
element
:
elements
(
gridGeometry
.
gridView
()))
{
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
// get the element solution
auto
elemSol
=
elementSolution
(
element
,
sol
,
gridGeometry
);
...
...
dumux/discretization/box/scvftoscvboundarytypes.hh
View file @
7fd1d079
...
...
@@ -55,7 +55,7 @@ public:
for
(
const
auto
&
element
:
elements
(
gridGeometry
.
gridView
()))
{
// iterate over the scvfs
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
{
...
...
dumux/discretization/cellcentered/connectivitymap.hh
View file @
7fd1d079
...
...
@@ -88,7 +88,7 @@ public:
// We are looking for the elements I, for which this element J is in the flux stencil
const
auto
globalJ
=
gridGeometry
.
elementMapper
().
index
(
element
);
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
// obtain the data of J in elements I
dataJForI
.
clear
();
...
...
dumux/discretization/cellcentered/gridvolumevariables.hh
View file @
7fd1d079
...
...
@@ -72,7 +72,7 @@ public:
for
(
const
auto
&
element
:
elements
(
gridGeometry
.
gridView
()))
{
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
const
auto
elemSol
=
elementSolution
(
element
,
sol
,
gridGeometry
);
...
...
dumux/discretization/cellcentered/mpfa/gridfluxvariablescache.hh
View file @
7fd1d079
...
...
@@ -160,8 +160,8 @@ public:
for
(
const
auto
&
element
:
elements
(
gridGeometry
.
gridView
()))
{
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
const
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
// Prepare all caches of the scvfs inside the corresponding interaction volume. Skip
// those ivs that are touching a boundary, we only store the data on interior ivs here.
...
...
dumux/discretization/cellcentered/mpfa/scvgradients.hh
View file @
7fd1d079
...
...
@@ -179,9 +179,9 @@ private:
continue
;
// compute gradients in all scvs of all interaction volumes in this element
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
()).
bind
(
element
,
fvGeometry
,
x
);
auto
elemFluxVarsCache
=
localView
(
gridVariables
.
gridFluxVarsCache
()).
bind
(
element
,
fvGeometry
,
elemVolVars
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
const
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
()).
bind
(
element
,
fvGeometry
,
x
);
const
auto
elemFluxVarsCache
=
localView
(
gridVariables
.
gridFluxVarsCache
()).
bind
(
element
,
fvGeometry
,
elemVolVars
);
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
{
...
...
dumux/discretization/cellcentered/tpfa/gridfluxvariablescache.hh
View file @
7fd1d079
...
...
@@ -103,8 +103,8 @@ public:
for
(
const
auto
&
element
:
elements
(
gridGeometry
.
gridView
()))
{
// Prepare the geometries within the elements of the stencil
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
const
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
...
...
dumux/discretization/staggered/freeflow/connectivitymap.hh
View file @
7fd1d079
...
...
@@ -71,7 +71,7 @@ public:
for
(
auto
&&
element
:
elements
(
gridGeometry
.
gridView
()))
{
// restrict the FvGeometry locally and bind to the element
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
// loop over sub control faces
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
...
...
dumux/discretization/staggered/freeflow/gridvolumevariables.hh
View file @
7fd1d079
...
...
@@ -172,7 +172,7 @@ public:
for
(
const
auto
&
element
:
elements
(
gridGeometry
.
gridView
()))
{
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
...
...
dumux/discretization/staggered/gridfacevariables.hh
View file @
7fd1d079
...
...
@@ -89,7 +89,7 @@ public:
for
(
auto
&&
element
:
elements
(
gridGeometry
.
gridView
()))
{
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bindElement
(
element
);
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
...
...
dumux/discretization/staggered/gridfluxvariablescache.hh
View file @
7fd1d079
...
...
@@ -117,8 +117,8 @@ public:
for
(
const
auto
&
element
:
elements
(
gridGeometry
.
gridView
()))
{
// Prepare the geometries within the elements of the stencil
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
const
auto
fvGeometry
=
localView
(
gridGeometry
).
bind
(
element
);
const
auto
elemVolVars
=
localView
(
gridVolVars
).
bind
(
element
,
fvGeometry
,
sol
);
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
...
...
dumux/freeflow/rans/oneeq/problem.hh
View file @
7fd1d079
...
...
@@ -96,7 +96,7 @@ public:
{
unsigned
int
elementIdx
=
this
->
gridGeometry
().
elementMapper
().
index
(
element
);
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
const
int
dofIdx
=
scv
.
dofIndex
();
...
...
@@ -129,7 +129,7 @@ public:
}
// Adjust for dirichlet boundary conditions
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
const
unsigned
int
normDim
=
scvf
.
directionIndex
();
...
...
dumux/freeflow/rans/problem.hh
View file @
7fd1d079
...
...
@@ -457,7 +457,7 @@ private:
// calculate cell-center-averaged velocities
for
(
const
auto
&
element
:
elements
(
this
->
gridGeometry
().
gridView
()))
{
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
unsigned
int
elementIdx
=
this
->
gridGeometry
().
elementMapper
().
index
(
element
);
// calculate velocities
...
...
@@ -497,7 +497,7 @@ private:
}
}
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
for
(
auto
&&
scvf
:
scvfs
(
fvGeometry
))
{
// adapt calculations for Dirichlet condition
...
...
@@ -684,7 +684,7 @@ private:
for
(
const
auto
&
element
:
elements
(
this
->
gridGeometry
().
gridView
()))
{
unsigned
int
elementIdx
=
this
->
gridGeometry
().
elementMapper
().
index
(
element
);
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
const
int
dofIdx
=
scv
.
dofIndex
();
...
...
dumux/freeflow/rans/twoeq/kepsilon/problem.hh
View file @
7fd1d079
...
...
@@ -122,7 +122,7 @@ public:
{
unsigned
int
elementIdx
=
this
->
gridGeometry
().
elementMapper
().
index
(
element
);
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
const
auto
fvGeometry
=
localView
(
this
->
gridGeometry
()).
bindElement
(
element
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
const
int
dofIdx
=
scv
.
dofIndex
();
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment