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
256ab1ce
Commit
256ab1ce
authored
Oct 26, 2021
by
Kilian Weishaupt
Browse files
[staggered][gridGeometry] Make scvs(fvGeometry) iterate directly over global vector
parent
219fc32e
Changes
2
Show whitespace changes
Inline
Side-by-side
dumux/discretization/facecentered/staggered/fvelementgeometry.hh
View file @
256ab1ce
...
...
@@ -105,12 +105,7 @@ public:
//! for (auto&& scv : scvs(fvGeometry))
friend
inline
auto
scvs
(
const
FaceCenteredStaggeredFVElementGeometry
&
fvGeometry
)
{
using
IndexContainerType
=
std
::
decay_t
<
decltype
(
fvGeometry
.
scvIndices_
())
>
;
using
ScvIterator
=
Dumux
::
ScvIterator
<
SubControlVolume
,
IndexContainerType
,
ThisType
>
;
return
Dune
::
IteratorRange
<
ScvIterator
>
(
ScvIterator
(
fvGeometry
.
scvIndices_
().
begin
(),
fvGeometry
),
ScvIterator
(
fvGeometry
.
scvIndices_
().
end
(),
fvGeometry
));
}
{
return
fvGeometry
.
gridGeometry
().
scvs
(
fvGeometry
);
}
//! iterator range for sub control volumes faces. Iterates over
//! all scvfs of the bound element.
...
...
dumux/discretization/facecentered/staggered/fvgridgeometry.hh
View file @
256ab1ce
...
...
@@ -199,6 +199,15 @@ public:
const
SubControlVolume
&
scv
(
GridIndexType
scvIdx
)
const
{
return
scvs_
[
scvIdx
];
}
//! Iterator range for sub control volumes. Iterates over
//! all scvs of the element-local fvGeometry.
auto
scvs
(
const
LocalView
&
fvGeometry
)
const
{
const
auto
begin
=
scvs_
.
cbegin
()
+
numScvsPerElement
*
fvGeometry
.
elementIndex
();
const
auto
end
=
begin
+
numScvsPerElement
;
return
Dune
::
IteratorRange
<
decltype
(
begin
)
>
(
begin
,
end
);
}
//! Get a sub control volume face with a global scvf index
const
SubControlVolumeFace
&
scvf
(
GridIndexType
scvfIdx
)
const
{
return
scvfs_
[
scvfIdx
];
}
...
...
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