From a8aeded4eb641ffcd1223305e657c9ff58dafecd Mon Sep 17 00:00:00 2001 From: Antonella Ritorto Date: Mon, 30 Sep 2024 11:59:44 +0200 Subject: [PATCH] Chage size(0) for logicalCartesianSize() multiplication --- tests/cpgrid/adapt_cpgrid_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/cpgrid/adapt_cpgrid_test.cpp b/tests/cpgrid/adapt_cpgrid_test.cpp index 1c2b79efb..6d08ae94b 100644 --- a/tests/cpgrid/adapt_cpgrid_test.cpp +++ b/tests/cpgrid/adapt_cpgrid_test.cpp @@ -211,7 +211,8 @@ void markAndAdapt_check(Dune::CpGrid& coarse_grid, auto itMin = std::min_element((data.back() -> global_cell_).begin(), (data.back()-> global_cell_).end()); auto itMax = std::max_element((data.back() -> global_cell_).begin(), (data.back() -> global_cell_).end()); BOOST_CHECK_EQUAL( *itMin, 0); - BOOST_CHECK_EQUAL( *itMax, data.front()-> size(0) -1); + const auto& maxCartesianIdx = coarse_grid.logicalCartesianSize()[0]*coarse_grid.logicalCartesianSize()[1]*coarse_grid.logicalCartesianSize()[2] -1; + BOOST_CHECK_EQUAL( *itMax, maxCartesianIdx); for(const auto& element: elements(grid_view)) { // postAdapt() has been called, therefore every element gets marked with 0 @@ -377,7 +378,8 @@ void markAndAdapt_check(Dune::CpGrid& coarse_grid, auto itMinLevel = std::min_element((data[level] -> global_cell_).begin(), (data[level] -> global_cell_).end()); auto itMaxLevel = std::max_element((data[level] -> global_cell_).begin(), (data[level] -> global_cell_).end()); BOOST_CHECK_EQUAL( *itMinLevel, 0); - BOOST_CHECK_EQUAL( *itMaxLevel, data[level]-> size(0) -1); + const auto& maxCartesianIdxLevel = data[level]->logical_cartesian_size_[0]*data[level]->logical_cartesian_size_[1]* data[level]->logical_cartesian_size_[2] -1; + BOOST_CHECK_EQUAL( *itMaxLevel, maxCartesianIdxLevel); } std::set allIds_set;