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
219fc32e
Commit
219fc32e
authored
Oct 26, 2021
by
Kilian Weishaupt
Browse files
[staggered][gridGeometry] Use lambda to get global scv index
parent
20e7c629
Changes
1
Hide whitespace changes
Inline
Side-by-side
dumux/discretization/facecentered/staggered/fvgridgeometry.hh
View file @
219fc32e
...
...
@@ -361,10 +361,12 @@ private:
for
(
const
auto
&
element
:
elements
(
this
->
gridView
()))
{
const
auto
eIdx
=
this
->
elementMapper
().
index
(
element
);
const
auto
&
globalScvIndices
=
scvIndicesOfElement_
[
eIdx
];
const
auto
&
globalScvfIndices
=
scvfIndicesOfElement_
[
eIdx
];
scvfOfScvInfo_
[
eIdx
].
reserve
(
globalScvfIndices
.
size
());
auto
globalScvIdx
=
[
&
](
const
auto
elementIdx
,
const
auto
localScvIdx
)
{
return
numScvsPerElement
*
elementIdx
+
localScvIdx
;
};
SmallLocalIndexType
localScvIdx
=
0
;
// also corresponds to local element face index (one scv per face)
SmallLocalIndexType
localScvfIdx
=
0
;
for
(
const
auto
&
intersection
:
intersections
(
this
->
gridView
(),
element
))
...
...
@@ -406,7 +408,7 @@ private:
// the sub control volume
scvs_
.
emplace_back
(
elementGeometry
,
intersectionGeometry
,
globalScvI
ndices
[
localScvIdx
]
,
globalScvI
dx
(
eIdx
,
localScvIdx
)
,
localScvIdx
,
dofIndex
,
Dumux
::
normalAxis
(
intersection
.
centerUnitOuterNormal
()),
...
...
@@ -416,7 +418,7 @@ private:
// the frontal sub control volume face at the element center
scvfs_
.
emplace_back
(
elementGeometry
,
intersectionGeometry
,
std
::
array
{
globalScvI
ndices
[
localScvIdx
]
,
globalScvI
ndices
[
localOppositeScvIdx
]
},
std
::
array
{
globalScvI
dx
(
eIdx
,
localScvIdx
)
,
globalScvI
dx
(
eIdx
,
localOppositeScvIdx
)
},
localScvfIdx
,
globalScvfIndices
[
localScvfIdx
],
intersection
.
centerUnitOuterNormal
(),
...
...
@@ -447,14 +449,13 @@ private:
{
const
auto
parallelElemIdx
=
this
->
elementMapper
().
index
(
lateralIntersection
.
outside
());
const
auto
localOutsideScvIdx
=
geometryHelper
.
localFaceIndexInOtherElement
(
localScvIdx
);
const
auto
&
globalScvIndicesOfNeighborElement
=
scvIndicesOfElement_
[
parallelElemIdx
];
return
globalScvIndicesOfNeighborElement
[
localOutsideScvIdx
];
return
globalScvIdx
(
parallelElemIdx
,
localOutsideScvIdx
);
}
else
return
numInteriorScvs
+
outSideBoundaryVolVarIdx_
++
;
}();
return
std
::
array
{
globalScvI
ndices
[
localScvIdx
]
,
globalOutsideScvIdx
};
return
std
::
array
{
globalScvI
dx
(
eIdx
,
localScvIdx
)
,
globalOutsideScvIdx
};
}();
scvfs_
.
emplace_back
(
elementGeometry
,
...
...
@@ -490,7 +491,7 @@ private:
// the frontal sub control volume face at the boundary
scvfs_
.
emplace_back
(
element
.
geometry
(),
intersection
.
geometry
(),
std
::
array
{
globalScvI
ndices
[
localScvIdx
]
,
globalScvI
ndices
[
localScvIdx
]
},
// TODO outside boundary, periodic, parallel?
std
::
array
{
globalScvI
dx
(
eIdx
,
localScvIdx
)
,
globalScvI
dx
(
eIdx
,
localScvIdx
)
},
// TODO outside boundary, periodic, parallel?
localScvfIdx
,
globalScvfIndices
[
localScvfIdx
],
intersection
.
centerUnitOuterNormal
(),
...
...
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