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
6a59d0f8
Commit
6a59d0f8
authored
Oct 09, 2019
by
Bernd Flemisch
Committed by
Katharina Heck
Oct 10, 2019
Browse files
[cleanup] use local variables gridGeoemtry instead of fvGridGeometry
parent
57cdca8e
Changes
338
Hide whitespace changes
Inline
Side-by-side
dumux/adaptive/initializationindicator.hh
View file @
6a59d0f8
...
...
@@ -66,14 +66,14 @@ public:
* - Adaptive.RefineAtSource If to refine where source terms are specified (default: true)
* - Adaptive.BCRefinementThreshold The threshold above which fluxes are treated as non-zero (default: 1e-10)
* \param problem The problem object
* \param
fvG
ridGeometry The finite volume geometry of the grid
* \param
g
ridGeometry The finite volume geometry of the grid
* \param gridVariables The secondary variables on the grid
*/
GridAdaptInitializationIndicator
(
std
::
shared_ptr
<
const
Problem
>
problem
,
std
::
shared_ptr
<
const
GridGeometry
>
fvG
ridGeometry
,
std
::
shared_ptr
<
const
GridGeometry
>
g
ridGeometry
,
std
::
shared_ptr
<
const
GridVariables
>
gridVariables
)
:
problem_
(
problem
)
,
fvGridGeometry_
(
fvG
ridGeometry
)
,
fvGridGeometry_
(
g
ridGeometry
)
,
gridVariables_
(
gridVariables
)
,
minLevel_
(
getParamFromGroup
<
int
>
(
problem
->
paramGroup
(),
"Adaptive.MinLevel"
))
,
maxLevel_
(
getParamFromGroup
<
int
>
(
problem
->
paramGroup
(),
"Adaptive.MaxLevel"
))
...
...
dumux/assembly/cclocalassembler.hh
View file @
6a59d0f8
...
...
@@ -170,13 +170,13 @@ public:
// get some aliases for convenience
const
auto
&
element
=
this
->
element
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
fvG
ridGeometry
=
this
->
assembler
().
gridGeometry
();
const
auto
&
g
ridGeometry
=
this
->
assembler
().
gridGeometry
();
auto
&&
curElemVolVars
=
this
->
curElemVolVars
();
auto
&&
elemFluxVarsCache
=
this
->
elemFluxVarsCache
();
// get stencil informations
const
auto
globalI
=
fvG
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
&
connectivityMap
=
fvG
ridGeometry
.
connectivityMap
();
const
auto
globalI
=
g
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
&
connectivityMap
=
g
ridGeometry
.
connectivityMap
();
const
auto
numNeighbors
=
connectivityMap
[
globalI
].
size
();
// container to store the neighboring elements
...
...
@@ -203,7 +203,7 @@ public:
unsigned
int
j
=
1
;
for
(
const
auto
&
dataJ
:
connectivityMap
[
globalI
])
{
neighborElements
[
j
-
1
]
=
fvG
ridGeometry
.
element
(
dataJ
.
globalJ
);
neighborElements
[
j
-
1
]
=
g
ridGeometry
.
element
(
dataJ
.
globalJ
);
for
(
const
auto
scvfIdx
:
dataJ
.
scvfsJ
)
origResiduals
[
j
]
+=
evalNeighborFlux
(
neighborElements
[
j
-
1
],
fvGeometry
.
scvf
(
scvfIdx
));
...
...
@@ -221,7 +221,7 @@ public:
const
auto
origVolVars
=
curVolVars
;
// element solution container to be deflected
auto
elemSol
=
elementSolution
(
element
,
curSol
,
fvG
ridGeometry
);
auto
elemSol
=
elementSolution
(
element
,
curSol
,
g
ridGeometry
);
// 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
...
...
@@ -349,11 +349,11 @@ public:
// get some aliases for convenience
const
auto
&
element
=
this
->
element
();
const
auto
&
fvGeometry
=
this
->
fvGeometry
();
const
auto
&
fvG
ridGeometry
=
this
->
assembler
().
gridGeometry
();
const
auto
&
g
ridGeometry
=
this
->
assembler
().
gridGeometry
();
auto
&&
curElemVolVars
=
this
->
curElemVolVars
();
// reference to the element's scv (needed later) and corresponding vol vars
const
auto
globalI
=
fvG
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
globalI
=
g
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
&
scv
=
fvGeometry
.
scv
(
globalI
);
auto
&
curVolVars
=
ParentType
::
getVolVarAccess
(
gridVariables
.
curGridVolVars
(),
curElemVolVars
,
scv
);
...
...
@@ -364,7 +364,7 @@ public:
const
auto
origVolVars
=
curVolVars
;
// element solution container to be deflected
auto
elemSol
=
elementSolution
(
element
,
curSol
,
fvG
ridGeometry
);
auto
elemSol
=
elementSolution
(
element
,
curSol
,
g
ridGeometry
);
NumEqVector
partialDeriv
;
...
...
dumux/assembly/fvlocalresidual.hh
View file @
6a59d0f8
...
...
@@ -88,18 +88,18 @@ public:
* \param problem The problem to solve
* \param element The DUNE Codim<0> entity for which the storage
* term ought to be calculated
* \param
fvG
ridGeometry The finite-volume grid geometry
* \param
g
ridGeometry The finite-volume grid geometry
* \param gridVariables The grid variables (volume and flux variables)
* \param sol The solution vector
*/
ElementResidualVector
evalStorage
(
const
Problem
&
problem
,
const
Element
&
element
,
const
GridGeometry
&
fvG
ridGeometry
,
const
GridGeometry
&
g
ridGeometry
,
const
GridVariables
&
gridVariables
,
const
SolutionVector
&
sol
)
const
{
// make sure FVElementGeometry and volume variables are bound to the element
auto
fvGeometry
=
localView
(
fvG
ridGeometry
);
auto
fvGeometry
=
localView
(
g
ridGeometry
);
fvGeometry
.
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
());
...
...
dumux/assembly/partialreassembler.hh
View file @
6a59d0f8
...
...
@@ -115,10 +115,10 @@ public:
const
std
::
vector
<
Scalar
>&
distanceFromLastLinearization
,
Scalar
threshold
)
{
const
auto
&
fvG
ridGeometry
=
assembler
.
gridGeometry
();
const
auto
&
gridView
=
fvG
ridGeometry
.
gridView
();
const
auto
&
elementMapper
=
fvG
ridGeometry
.
elementMapper
();
const
auto
&
vertexMapper
=
fvG
ridGeometry
.
vertexMapper
();
const
auto
&
g
ridGeometry
=
assembler
.
gridGeometry
();
const
auto
&
gridView
=
g
ridGeometry
.
gridView
();
const
auto
&
elementMapper
=
g
ridGeometry
.
elementMapper
();
const
auto
&
vertexMapper
=
g
ridGeometry
.
vertexMapper
();
// set all vertices to green
vertexColor_
.
assign
(
vertexColor_
.
size
(),
EntityColor
::
green
);
...
...
@@ -318,9 +318,9 @@ public:
const
std
::
vector
<
Scalar
>&
distanceFromLastLinearization
,
Scalar
threshold
)
{
const
auto
&
fvG
ridGeometry
=
assembler
.
gridGeometry
();
const
auto
&
gridView
=
fvG
ridGeometry
.
gridView
();
const
auto
&
elementMapper
=
fvG
ridGeometry
.
elementMapper
();
const
auto
&
g
ridGeometry
=
assembler
.
gridGeometry
();
const
auto
&
gridView
=
g
ridGeometry
.
gridView
();
const
auto
&
elementMapper
=
g
ridGeometry
.
elementMapper
();
// mark the red elements
for
(
const
auto
&
element
:
elements
(
gridView
))
...
...
@@ -340,7 +340,7 @@ public:
}
// mark the neighbors also red
const
auto
&
connectivityMap
=
fvG
ridGeometry
.
connectivityMap
();
const
auto
&
connectivityMap
=
g
ridGeometry
.
connectivityMap
();
for
(
unsigned
eIdx
=
0
;
eIdx
<
elementColor_
.
size
();
++
eIdx
)
{
if
(
elementColor_
[
eIdx
]
==
EntityColor
::
red
)
...
...
@@ -440,9 +440,9 @@ public:
:
engine_
(
assembler
)
,
greenElems_
(
0
)
{
const
auto
&
fvG
ridGeometry
=
assembler
.
gridGeometry
();
totalElems_
=
fvG
ridGeometry
.
elementMapper
().
size
();
totalElems_
=
fvG
ridGeometry
.
gridView
().
comm
().
sum
(
totalElems_
);
const
auto
&
g
ridGeometry
=
assembler
.
gridGeometry
();
totalElems_
=
g
ridGeometry
.
elementMapper
().
size
();
totalElems_
=
g
ridGeometry
.
gridView
().
comm
().
sum
(
totalElems_
);
}
/*!
...
...
dumux/common/pointsource.hh
View file @
6a59d0f8
...
...
@@ -277,13 +277,13 @@ class BoundingBoxTreePointSourceHelper
public:
//! calculate a DOF index to point source map from given vector of point sources
template
<
class
GridGeometry
,
class
PointSource
,
class
PointSourceMap
>
static
void
computePointSourceMap
(
const
GridGeometry
&
fvG
ridGeometry
,
static
void
computePointSourceMap
(
const
GridGeometry
&
g
ridGeometry
,
std
::
vector
<
PointSource
>&
sources
,
PointSourceMap
&
pointSourceMap
)
{
constexpr
bool
isBox
=
GridGeometry
::
discMethod
==
DiscretizationMethod
::
box
;
const
auto
&
boundingBoxTree
=
fvG
ridGeometry
.
boundingBoxTree
();
const
auto
&
boundingBoxTree
=
g
ridGeometry
.
boundingBoxTree
();
for
(
auto
&&
source
:
sources
)
{
...
...
@@ -298,7 +298,7 @@ public:
{
// check in which subcontrolvolume(s) we are
const
auto
element
=
boundingBoxTree
.
entitySet
().
entity
(
eIdx
);
auto
fvGeometry
=
localView
(
fvG
ridGeometry
);
auto
fvGeometry
=
localView
(
g
ridGeometry
);
fvGeometry
.
bindElement
(
element
);
const
auto
globalPos
=
source
.
position
();
...
...
dumux/common/staggeredfvproblem.hh
View file @
6a59d0f8
...
...
@@ -73,11 +73,11 @@ class StaggeredFVProblem : public FVProblem<TypeTag>
public:
/*!
* \brief Constructor
* \param
fvG
ridGeometry The finite volume grid geometry
* \param
g
ridGeometry The finite volume grid geometry
* \param paramGroup The parameter group in which to look for runtime parameters first (default is "")
*/
StaggeredFVProblem
(
std
::
shared_ptr
<
const
GridGeometry
>
fvG
ridGeometry
,
const
std
::
string
&
paramGroup
=
""
)
:
ParentType
(
fvG
ridGeometry
,
paramGroup
)
StaggeredFVProblem
(
std
::
shared_ptr
<
const
GridGeometry
>
g
ridGeometry
,
const
std
::
string
&
paramGroup
=
""
)
:
ParentType
(
g
ridGeometry
,
paramGroup
)
{
}
/*!
...
...
dumux/discretization/box/elementsolution.hh
View file @
6a59d0f8
...
...
@@ -51,9 +51,9 @@ public:
//! Constructor with element and solution and grid geometry
template
<
class
SolutionVector
>
BoxElementSolution
(
const
Element
&
element
,
const
SolutionVector
&
sol
,
const
GridGeometry
&
fvG
ridGeometry
)
const
GridGeometry
&
g
ridGeometry
)
{
update
(
element
,
sol
,
fvG
ridGeometry
);
update
(
element
,
sol
,
g
ridGeometry
);
}
//! Constructor with element and elemVolVars and fvGeometry
...
...
@@ -70,12 +70,12 @@ public:
//! extract the element solution from the solution vector using a mapper
template
<
class
SolutionVector
>
void
update
(
const
Element
&
element
,
const
SolutionVector
&
sol
,
const
GridGeometry
&
fvG
ridGeometry
)
const
GridGeometry
&
g
ridGeometry
)
{
const
auto
numVert
=
element
.
subEntities
(
GridView
::
dimension
);
priVars_
.
resize
(
numVert
);
for
(
int
vIdx
=
0
;
vIdx
<
numVert
;
++
vIdx
)
priVars_
[
vIdx
]
=
sol
[
fvG
ridGeometry
.
vertexMapper
().
subIndex
(
element
,
vIdx
,
GridView
::
dimension
)];
priVars_
[
vIdx
]
=
sol
[
g
ridGeometry
.
vertexMapper
().
subIndex
(
element
,
vIdx
,
GridView
::
dimension
)];
}
//! extract the element solution from the solution vector using a local fv geometry
...
...
dumux/discretization/box/gridfluxvariablescache.hh
View file @
6a59d0f8
...
...
@@ -79,7 +79,7 @@ public:
BoxGridFluxVariablesCache
(
const
Problem
&
problem
)
:
problemPtr_
(
&
problem
)
{}
template
<
class
GridGeometry
,
class
GridVolumeVariables
,
class
SolutionVector
>
void
update
(
const
GridGeometry
&
fvG
ridGeometry
,
void
update
(
const
GridGeometry
&
g
ridGeometry
,
const
GridVolumeVariables
&
gridVolVars
,
const
SolutionVector
&
sol
,
bool
forceUpdate
=
false
)
...
...
@@ -87,12 +87,12 @@ public:
// Here, we do not do anything unless it is a forced update
if
(
forceUpdate
)
{
fluxVarsCache_
.
resize
(
fvG
ridGeometry
.
gridView
().
size
(
0
));
for
(
const
auto
&
element
:
elements
(
fvG
ridGeometry
.
gridView
()))
fluxVarsCache_
.
resize
(
g
ridGeometry
.
gridView
().
size
(
0
));
for
(
const
auto
&
element
:
elements
(
g
ridGeometry
.
gridView
()))
{
auto
eIdx
=
fvG
ridGeometry
.
elementMapper
().
index
(
element
);
auto
eIdx
=
g
ridGeometry
.
elementMapper
().
index
(
element
);
// bind the geometries and volume variables to the element (all the elements in stencil)
auto
fvGeometry
=
localView
(
fvG
ridGeometry
);
auto
fvGeometry
=
localView
(
g
ridGeometry
);
fvGeometry
.
bind
(
element
);
auto
elemVolVars
=
localView
(
gridVolVars
);
...
...
@@ -145,7 +145,7 @@ public:
BoxGridFluxVariablesCache
(
const
Problem
&
problem
)
:
problemPtr_
(
&
problem
)
{}
template
<
class
GridGeometry
,
class
GridVolumeVariables
,
class
SolutionVector
>
void
update
(
const
GridGeometry
&
fvG
ridGeometry
,
void
update
(
const
GridGeometry
&
g
ridGeometry
,
const
GridVolumeVariables
&
gridVolVars
,
const
SolutionVector
&
sol
,
bool
forceUpdate
=
false
)
{}
...
...
dumux/discretization/box/gridvolumevariables.hh
View file @
6a59d0f8
...
...
@@ -75,18 +75,18 @@ public:
BoxGridVolumeVariables
(
const
Problem
&
problem
)
:
problemPtr_
(
&
problem
)
{}
template
<
class
GridGeometry
,
class
SolutionVector
>
void
update
(
const
GridGeometry
&
fvG
ridGeometry
,
const
SolutionVector
&
sol
)
void
update
(
const
GridGeometry
&
g
ridGeometry
,
const
SolutionVector
&
sol
)
{
volumeVariables_
.
resize
(
fvG
ridGeometry
.
gridView
().
size
(
0
));
for
(
const
auto
&
element
:
elements
(
fvG
ridGeometry
.
gridView
()))
volumeVariables_
.
resize
(
g
ridGeometry
.
gridView
().
size
(
0
));
for
(
const
auto
&
element
:
elements
(
g
ridGeometry
.
gridView
()))
{
auto
eIdx
=
fvG
ridGeometry
.
elementMapper
().
index
(
element
);
auto
eIdx
=
g
ridGeometry
.
elementMapper
().
index
(
element
);
auto
fvGeometry
=
localView
(
fvG
ridGeometry
);
auto
fvGeometry
=
localView
(
g
ridGeometry
);
fvGeometry
.
bindElement
(
element
);
// get the element solution
auto
elemSol
=
elementSolution
(
element
,
sol
,
fvG
ridGeometry
);
auto
elemSol
=
elementSolution
(
element
,
sol
,
g
ridGeometry
);
// update the volvars of the element
volumeVariables_
[
eIdx
].
resize
(
fvGeometry
.
numScv
());
...
...
@@ -140,7 +140,7 @@ public:
BoxGridVolumeVariables
(
const
Problem
&
problem
)
:
problemPtr_
(
&
problem
)
{}
template
<
class
GridGeometry
,
class
SolutionVector
>
void
update
(
const
GridGeometry
&
fvG
ridGeometry
,
const
SolutionVector
&
sol
)
{}
void
update
(
const
GridGeometry
&
g
ridGeometry
,
const
SolutionVector
&
sol
)
{}
const
Problem
&
problem
()
const
{
return
*
problemPtr_
;}
...
...
dumux/discretization/box/scvftoscvboundarytypes.hh
View file @
6a59d0f8
...
...
@@ -46,16 +46,16 @@ public:
// only do something for box
if
(
discMethod
==
DiscretizationMethod
::
box
)
{
const
auto
&
fvG
ridGeometry
=
problem
.
gridGeometry
();
scvBoundaryTypes
.
resize
(
fvG
ridGeometry
.
vertexMapper
().
size
());
const
auto
&
g
ridGeometry
=
problem
.
gridGeometry
();
scvBoundaryTypes
.
resize
(
g
ridGeometry
.
vertexMapper
().
size
());
// set all equations to Neumann by default
for
(
std
::
size_t
vIdx
=
0
;
vIdx
<
scvBoundaryTypes
.
size
();
vIdx
++
)
scvBoundaryTypes
[
vIdx
].
setAllNeumann
();
for
(
const
auto
&
element
:
elements
(
fvG
ridGeometry
.
gridView
()))
for
(
const
auto
&
element
:
elements
(
g
ridGeometry
.
gridView
()))
{
// iterate over the scvfs
auto
fvGeometry
=
localView
(
fvG
ridGeometry
);
auto
fvGeometry
=
localView
(
g
ridGeometry
);
fvGeometry
.
bindElement
(
element
);
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
...
...
dumux/discretization/cellcentered/connectivitymap.hh
View file @
6a59d0f8
...
...
@@ -73,22 +73,22 @@ public:
/*!
* \brief Initialize the ConnectivityMap object.
*
* \param
fvG
ridGeometry The grid's finite volume geometry.
* \param
g
ridGeometry The grid's finite volume geometry.
*/
void
update
(
const
GridGeometry
&
fvG
ridGeometry
)
void
update
(
const
GridGeometry
&
g
ridGeometry
)
{
map_
.
clear
();
map_
.
resize
(
fvG
ridGeometry
.
gridView
().
size
(
0
));
map_
.
resize
(
g
ridGeometry
.
gridView
().
size
(
0
));
// container to store for each element J the elements I which have J in their flux stencil
Dune
::
ReservedVector
<
std
::
pair
<
GridIndexType
,
DataJ
>
,
maxElemStencilSize
>
dataJForI
;
for
(
const
auto
&
element
:
elements
(
fvG
ridGeometry
.
gridView
()))
for
(
const
auto
&
element
:
elements
(
g
ridGeometry
.
gridView
()))
{
// We are looking for the elements I, for which this element J is in the flux stencil
const
auto
globalJ
=
fvG
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
globalJ
=
g
ridGeometry
.
elementMapper
().
index
(
element
);
auto
fvGeometry
=
localView
(
fvG
ridGeometry
);
auto
fvGeometry
=
localView
(
g
ridGeometry
);
fvGeometry
.
bindElement
(
element
);
// obtain the data of J in elements I
...
...
dumux/discretization/cellcentered/elementsolution.hh
View file @
6a59d0f8
...
...
@@ -52,8 +52,8 @@ public:
//! Constructor with element, solution vector and grid geometry
template
<
class
SolutionVector
>
CCElementSolution
(
const
Element
&
element
,
const
SolutionVector
&
sol
,
const
GridGeometry
&
fvG
ridGeometry
)
:
CCElementSolution
(
sol
[
fvG
ridGeometry
.
elementMapper
().
index
(
element
)])
const
GridGeometry
&
g
ridGeometry
)
:
CCElementSolution
(
sol
[
g
ridGeometry
.
elementMapper
().
index
(
element
)])
{}
//! Constructor with element, element volume variables and fv element geometry
...
...
@@ -76,9 +76,9 @@ public:
//! extract the element solution from the solution vector using a mapper
template
<
class
SolutionVector
>
void
update
(
const
Element
&
element
,
const
SolutionVector
&
sol
,
const
GridGeometry
&
fvG
ridGeometry
)
const
GridGeometry
&
g
ridGeometry
)
{
priVars_
=
sol
[
fvG
ridGeometry
.
elementMapper
().
index
(
element
)];
priVars_
=
sol
[
g
ridGeometry
.
elementMapper
().
index
(
element
)];
}
//! return the size of the element solution
...
...
dumux/discretization/cellcentered/gridvolumevariables.hh
View file @
6a59d0f8
...
...
@@ -65,19 +65,19 @@ public:
CCGridVolumeVariables
(
const
Problem
&
problem
)
:
problemPtr_
(
&
problem
)
{}
template
<
class
GridGeometry
,
class
SolutionVector
>
void
update
(
const
GridGeometry
&
fvG
ridGeometry
,
const
SolutionVector
&
sol
)
void
update
(
const
GridGeometry
&
g
ridGeometry
,
const
SolutionVector
&
sol
)
{
const
auto
numScv
=
fvG
ridGeometry
.
numScv
();
const
auto
numScv
=
g
ridGeometry
.
numScv
();
volumeVariables_
.
resize
(
numScv
);
for
(
const
auto
&
element
:
elements
(
fvG
ridGeometry
.
gridView
()))
for
(
const
auto
&
element
:
elements
(
g
ridGeometry
.
gridView
()))
{
auto
fvGeometry
=
localView
(
fvG
ridGeometry
);
auto
fvGeometry
=
localView
(
g
ridGeometry
);
fvGeometry
.
bindElement
(
element
);
for
(
auto
&&
scv
:
scvs
(
fvGeometry
))
{
const
auto
elemSol
=
elementSolution
(
element
,
sol
,
fvG
ridGeometry
);
const
auto
elemSol
=
elementSolution
(
element
,
sol
,
g
ridGeometry
);
volumeVariables_
[
scv
.
dofIndex
()].
update
(
elemSol
,
problem
(),
element
,
scv
);
}
}
...
...
@@ -137,7 +137,7 @@ public:
CCGridVolumeVariables
(
const
Problem
&
problem
)
:
problemPtr_
(
&
problem
)
{}
template
<
class
GridGeometry
,
class
SolutionVector
>
void
update
(
const
GridGeometry
&
fvG
ridGeometry
,
const
SolutionVector
&
sol
)
{}
void
update
(
const
GridGeometry
&
g
ridGeometry
,
const
SolutionVector
&
sol
)
{}
//! The problem we are solving
const
Problem
&
problem
()
const
...
...
dumux/discretization/cellcentered/mpfa/elementfluxvariablescache.hh
View file @
6a59d0f8
...
...
@@ -162,8 +162,8 @@ public:
std
::
size_t
numSecondaryIv
;
numSecondaryIv
=
0
;
std
::
size_t
numCaches
;
numCaches
=
0
;
const
auto
&
fvG
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
gridIvIndexSets
=
fvG
ridGeometry
.
gridInteractionVolumeIndexSets
();
const
auto
&
g
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
gridIvIndexSets
=
g
ridGeometry
.
gridInteractionVolumeIndexSets
();
// lambda to check if a scvf was handled already
auto
scvfHandled
=
[
&
]
(
auto
idx
)
...
...
@@ -191,21 +191,21 @@ public:
// search for ivs at boundary vertices
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
fvG
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
())
?
g
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
())
?
handleScvf
(
scvf
,
gridIvIndexSets
.
secondaryIndexSet
(
scvf
),
true
)
:
handleScvf
(
scvf
,
gridIvIndexSets
.
primaryIndexSet
(
scvf
),
false
)
;
// skip the rest if there are no boundary caches to be created
if
(
numCaches
>
0
)
{
const
auto
&
assemblyMapI
=
fvG
ridGeometry
.
connectivityMap
()[
fvG
ridGeometry
.
elementMapper
().
index
(
element
)];
const
auto
&
assemblyMapI
=
g
ridGeometry
.
connectivityMap
()[
g
ridGeometry
.
elementMapper
().
index
(
element
)];
for
(
const
auto
&
dataJ
:
assemblyMapI
)
{
for
(
const
auto
&
scvfJIdx
:
dataJ
.
scvfsJ
)
{
const
auto
&
scvfJ
=
fvGeometry
.
scvf
(
scvfJIdx
);
if
(
fvG
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvfJ
.
vertexIndex
()))
if
(
g
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvfJ
.
vertexIndex
()))
handleScvf
(
scvfJ
,
gridIvIndexSets
.
secondaryIndexSet
(
scvfJ
),
true
);
else
handleScvf
(
scvfJ
,
gridIvIndexSets
.
primaryIndexSet
(
scvfJ
),
false
);
...
...
@@ -320,9 +320,9 @@ private:
template
<
class
SubControlVolumeFace
>
bool
isEmbeddedInBoundaryIV_
(
const
SubControlVolumeFace
&
scvf
)
const
{
const
auto
&
fvG
ridGeometry
=
gridFluxVarsCachePtr_
->
problem
().
gridGeometry
();
const
auto
&
gridIvIndexSets
=
fvG
ridGeometry
.
gridInteractionVolumeIndexSets
();
if
(
fvG
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
()))
const
auto
&
g
ridGeometry
=
gridFluxVarsCachePtr_
->
problem
().
gridGeometry
();
const
auto
&
gridIvIndexSets
=
g
ridGeometry
.
gridInteractionVolumeIndexSets
();
if
(
g
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
()))
return
gridIvIndexSets
.
secondaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
()
>
0
;
else
return
gridIvIndexSets
.
primaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
()
>
0
;
...
...
@@ -397,10 +397,10 @@ public:
// some references for convenience
const
auto
&
problem
=
gridFluxVarsCache
().
problem
();
const
auto
&
fvG
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
g
ridGeometry
=
fvGeometry
.
gridGeometry
();
// the assembly map of the given element
const
auto
&
assemblyMapI
=
fvG
ridGeometry
.
connectivityMap
()[
fvG
ridGeometry
.
elementMapper
().
index
(
element
)];
const
auto
&
assemblyMapI
=
g
ridGeometry
.
connectivityMap
()[
g
ridGeometry
.
elementMapper
().
index
(
element
)];
// reserve memory for scvf index container
unsigned
int
numNeighborScvfs
=
0
;
...
...
@@ -445,7 +445,7 @@ public:
for
(
const
auto
&
dataJ
:
assemblyMapI
)
{
const
auto
elementJ
=
fvG
ridGeometry
.
element
(
dataJ
.
globalJ
);
const
auto
elementJ
=
g
ridGeometry
.
element
(
dataJ
.
globalJ
);
for
(
const
auto
scvfIdx
:
dataJ
.
scvfsJ
)
{
auto
&
scvfCache
=
fluxVarsCache_
[
i
++
];
...
...
@@ -485,8 +485,8 @@ public:
if
(
FluxVariablesCacheFiller
::
isSolDependent
)
{
const
auto
&
problem
=
gridFluxVarsCache
().
problem
();
const
auto
&
fvG
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
assemblyMapI
=
fvG
ridGeometry
.
connectivityMap
()[
fvG
ridGeometry
.
elementMapper
().
index
(
element
)];
const
auto
&
g
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
assemblyMapI
=
g
ridGeometry
.
connectivityMap
()[
g
ridGeometry
.
elementMapper
().
index
(
element
)];
// helper class to fill flux variables caches
FluxVariablesCacheFiller
filler
(
problem
);
...
...
@@ -506,7 +506,7 @@ public:
for
(
const
auto
&
dataJ
:
assemblyMapI
)
{
const
auto
elementJ
=
fvG
ridGeometry
.
element
(
dataJ
.
globalJ
);
const
auto
elementJ
=
g
ridGeometry
.
element
(
dataJ
.
globalJ
);
for
(
const
auto
scvfIdx
:
dataJ
.
scvfsJ
)
{
auto
&
scvfCache
=
fluxVarsCache_
[
i
++
];
...
...
dumux/discretization/cellcentered/mpfa/elementvolumevariables.hh
View file @
6a59d0f8
...
...
@@ -48,13 +48,13 @@ namespace CCMpfa {
template
<
class
FVElementGeometry
>
std
::
size_t
maxNumBoundaryVolVars
(
const
FVElementGeometry
&
fvGeometry
)
{
const
auto
&
fvG
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
gridIvIndexSets
=
fvG
ridGeometry
.
gridInteractionVolumeIndexSets
();
const
auto
&
g
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
gridIvIndexSets
=
g
ridGeometry
.
gridInteractionVolumeIndexSets
();
std
::
size_t
numBoundaryVolVars
=
0
;
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
{
if
(
!
fvG
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
()))
if
(
!
g
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
()))
numBoundaryVolVars
+=
gridIvIndexSets
.
primaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
();
else
numBoundaryVolVars
+=
gridIvIndexSets
.
secondaryIndexSet
(
scvf
).
nodalIndexSet
().
numBoundaryScvfs
();
...
...
@@ -138,12 +138,12 @@ namespace CCMpfa {
const
typename
FVElemGeom
::
GridGeometry
::
GridView
::
template
Codim
<
0
>
::
Entity
&
element
,
const
FVElemGeom
&
fvGeometry
)
{
const
auto
&
fvG
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
g
ridGeometry
=
fvGeometry
.
gridGeometry
();
// treat the BCs inside the element
if
(
fvGeometry
.
hasBoundaryScvf
())
{
const
auto
boundElemIdx
=
fvG
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
boundElemIdx
=
g
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
&
scvI
=
fvGeometry
.
scv
(
boundElemIdx
);
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
...
...
@@ -168,10 +168,10 @@ namespace CCMpfa {
}
// Update boundary volume variables in the neighbors
const
auto
&
gridIvIndexSets
=
fvG
ridGeometry
.
gridInteractionVolumeIndexSets
();
const
auto
&
gridIvIndexSets
=
g
ridGeometry
.
gridInteractionVolumeIndexSets
();
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
{
if
(
!
fvG
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
()))
if
(
!
g
ridGeometry
.
vertexUsesSecondaryInteractionVolume
(
scvf
.
vertexIndex
()))
addBoundaryVolVarsAtNode
(
volVars
,
volVarIndices
,
problem
,
element
,
fvGeometry
,
gridIvIndexSets
.
primaryIndexSet
(
scvf
).
nodalIndexSet
()
);
else
...
...
@@ -307,11 +307,11 @@ public:
clear
();
const
auto
&
problem
=
gridVolVars
().
problem
();
const
auto
&
fvG
ridGeometry
=
fvGeometry
.
gridGeometry
();
const
auto
&
g
ridGeometry
=
fvGeometry
.
gridGeometry
();
// stencil information
const
auto
globalI
=
fvG
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
&
assemblyMapI
=
fvG
ridGeometry
.
connectivityMap
()[
globalI
];
const
auto
globalI
=
g
ridGeometry
.
elementMapper
().
index
(
element
);
const
auto
&
assemblyMapI
=
g
ridGeometry
.
connectivityMap
()[
globalI
];
const
auto
numVolVars
=
assemblyMapI
.
size
()
+
1
;
// resize local containers to the required size (for internal elements)
...
...
@@ -321,7 +321,7 @@ public:
VolumeVariables
volVars
;
const
auto
&
scvI
=
fvGeometry
.
scv
(
globalI
);
volVars
.
update
(
elementSolution
(
element
,
sol
,
fvG
ridGeometry
),
volVars
.
update
(
elementSolution
(
element
,
sol
,
g
ridGeometry
),
problem
,
element
,
scvI
);
...
...
@@ -332,10 +332,10 @@ public:
// Update the volume variables of the neighboring elements
for
(
auto
&&
dataJ
:
assemblyMapI
)
{
const
auto
&
elementJ
=
fvG
ridGeometry
.
element
(
dataJ
.
globalJ
);
const
auto
&
elementJ
=
g
ridGeometry
.
element
(
dataJ
.
globalJ
);
const
auto
&
scvJ
=
fvGeometry
.
scv
(
dataJ
.
globalJ
);
VolumeVariables
volVarsJ
;
volVarsJ
.
update
(
elementSolution
(
elementJ
,
sol
,
fvG
ridGeometry
),
volVarsJ
.
update
(
elementSolution
(
elementJ
,
sol
,
g
ridGeometry
),
problem
,
elementJ
,
scvJ
);
...
...
@@ -357,11 +357,11 @@ public:
// volVarIndices_.reserve(volVarIndices_.size() + additionalDofDependencies.size());
// for (auto globalJ : additionalDofDependencies)
// {
// const auto& elementJ =
fvG
ridGeometry.element(globalJ);
// const auto& elementJ =
g
ridGeometry.element(globalJ);
// const auto& scvJ = fvGeometry.scv(globalJ);
// VolumeVariables additionalVolVars;
// additionalVolVars.update(elementSolution(elementJ, sol,
fvG
ridGeometry),
// additionalVolVars.update(elementSolution(elementJ, sol,
g
ridGeometry),
// problem,