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
6c690a5f
Commit
6c690a5f
authored
Mar 05, 2021
by
Dennis Gläser
Browse files
[test][gridgeom] test isBound()/element() in local views
parent
bd45aa39
Changes
3
Hide whitespace changes
Inline
Side-by-side
test/discretization/box/test_boxfvgeometry.cc
View file @
6c690a5f
...
@@ -81,7 +81,16 @@ int main (int argc, char *argv[])
...
@@ -81,7 +81,16 @@ int main (int argc, char *argv[])
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
std
::
cout
<<
std
::
endl
<<
"Checking fvGeometry of element "
<<
eIdx
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Checking fvGeometry of element "
<<
eIdx
<<
std
::
endl
;
auto
fvGeometry
=
localView
(
gridGeometry
);
auto
fvGeometry
=
localView
(
gridGeometry
);
// bind the local view to the element
if
(
fvGeometry
.
isBound
())
DUNE_THROW
(
Dune
::
Exception
,
"Local view should not be bound at this point"
);
fvGeometry
.
bind
(
element
);
fvGeometry
.
bind
(
element
);
if
(
!
fvGeometry
.
isBound
())
DUNE_THROW
(
Dune
::
Exception
,
"Local view should be bound at this point"
);
// make sure the bound element fits
auto
eIdxBound
=
gridGeometry
.
elementMapper
().
index
(
fvGeometry
.
element
());
if
(
eIdx
!=
eIdxBound
)
DUNE_THROW
(
Dune
::
Exception
,
"Bound element index does not match"
);
auto
range
=
scvs
(
fvGeometry
);
auto
range
=
scvs
(
fvGeometry
);
Detail
::
NoopFunctor
<
SubControlVolume
>
op
;
Detail
::
NoopFunctor
<
SubControlVolume
>
op
;
...
...
test/discretization/cellcentered/tpfa/test_tpfafvgeometry.cc
View file @
6c690a5f
...
@@ -82,7 +82,16 @@ int main (int argc, char *argv[])
...
@@ -82,7 +82,16 @@ int main (int argc, char *argv[])
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
std
::
cout
<<
std
::
endl
<<
"Checking fvGeometry of element "
<<
eIdx
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Checking fvGeometry of element "
<<
eIdx
<<
std
::
endl
;
auto
fvGeometry
=
localView
(
gridGeometry
);
auto
fvGeometry
=
localView
(
gridGeometry
);
// bind the local view to the element
if
(
fvGeometry
.
isBound
())
DUNE_THROW
(
Dune
::
Exception
,
"Local view should not be bound at this point"
);
fvGeometry
.
bind
(
element
);
fvGeometry
.
bind
(
element
);
if
(
!
fvGeometry
.
isBound
())
DUNE_THROW
(
Dune
::
Exception
,
"Local view should be bound at this point"
);
// make sure the bound element fits
auto
eIdxBound
=
gridGeometry
.
elementMapper
().
index
(
fvGeometry
.
element
());
if
(
eIdx
!=
eIdxBound
)
DUNE_THROW
(
Dune
::
Exception
,
"Bound element index does not match"
);
auto
range
=
scvs
(
fvGeometry
);
auto
range
=
scvs
(
fvGeometry
);
Detail
::
NoopFunctor
<
SubControlVolume
>
op
;
Detail
::
NoopFunctor
<
SubControlVolume
>
op
;
...
...
test/discretization/staggered/test_staggeredfvgeometry.cc
View file @
6c690a5f
...
@@ -132,8 +132,21 @@ int main (int argc, char *argv[])
...
@@ -132,8 +132,21 @@ int main (int argc, char *argv[])
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
auto
eIdx
=
gridGeometry
.
elementMapper
().
index
(
element
);
std
::
cout
<<
std
::
endl
<<
"Checking fvGeometry of element "
<<
eIdx
<<
std
::
endl
;
std
::
cout
<<
std
::
endl
<<
"Checking fvGeometry of element "
<<
eIdx
<<
std
::
endl
;
auto
fvGeometry
=
localView
(
gridGeometry
);
auto
fvGeometry
=
localView
(
gridGeometry
);
// bind the local view to the element
if
(
fvGeometry
.
isBound
())
DUNE_THROW
(
Dune
::
Exception
,
"Local view should not be bound at this point"
);
fvGeometry
.
bind
(
element
);
fvGeometry
.
bind
(
element
);
if
(
!
fvGeometry
.
isBound
())
DUNE_THROW
(
Dune
::
Exception
,
"Local view should be bound at this point"
);
// make sure the bound element fits
auto
eIdxBound
=
gridGeometry
.
elementMapper
().
index
(
fvGeometry
.
element
());
if
(
eIdx
!=
eIdxBound
)
DUNE_THROW
(
Dune
::
Exception
,
"Bound element index does not match"
);
auto
range
=
scvs
(
fvGeometry
);
auto
range
=
scvs
(
fvGeometry
);
Detail
::
NoopFunctor
<
SubControlVolume
>
op
;
Detail
::
NoopFunctor
<
SubControlVolume
>
op
;
if
(
0
!=
testForwardIterator
(
range
.
begin
(),
range
.
end
(),
op
))
if
(
0
!=
testForwardIterator
(
range
.
begin
(),
range
.
end
(),
op
))
...
...
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