Commit 6c690a5f authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[test][gridgeom] test isBound()/element() in local views

parent bd45aa39
......@@ -81,7 +81,16 @@ int main (int argc, char *argv[])
auto eIdx = gridGeometry.elementMapper().index(element);
std::cout << std::endl << "Checking fvGeometry of element " << eIdx << std::endl;
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);
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);
Detail::NoopFunctor<SubControlVolume> op;
......
......@@ -82,7 +82,16 @@ int main (int argc, char *argv[])
auto eIdx = gridGeometry.elementMapper().index(element);
std::cout << std::endl << "Checking fvGeometry of element " << eIdx << std::endl;
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);
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);
Detail::NoopFunctor<SubControlVolume> op;
......
......@@ -132,8 +132,21 @@ int main (int argc, char *argv[])
auto eIdx = gridGeometry.elementMapper().index(element);
std::cout << std::endl << "Checking fvGeometry of element " << eIdx << std::endl;
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);
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);
Detail::NoopFunctor<SubControlVolume> op;
if(0 != testForwardIterator(range.begin(), range.end(), op))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment