Skip to content

Commit

Permalink
Cleanup: Removed unused type and collected assertions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kjetilly committed Feb 3, 2025
1 parent 353f143 commit 0eb13c4
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions opm/grid/LookUpData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ std::vector<IntType> Opm::LookUpData<Grid,GridView>::assignFieldPropsIntOnLeaf(c
const bool& needsTranslation,
std::function<void(IntType, int)> valueCheck) const
{
using IndexType = typename Dune::MultipleCodimMultipleGeomTypeMapper<GridView>::Index;
std::vector<IntType> fieldPropOnLeaf;
unsigned int numElements = gridView_.size(0);
fieldPropOnLeaf.resize(numElements);
Expand Down Expand Up @@ -376,8 +375,8 @@ auto Opm::LookUpData<Grid,GridView>::getFieldPropIdx(const IndexType& elementOrI
{
constexpr static bool isIntegral = std::is_integral_v<IndexType>;
if constexpr (std::is_same_v<GridType, Dune::CpGrid>) {
static_assert(std::is_same_v<Grid,GridType>);
if constexpr (isIntegral) {
static_assert(std::is_same_v<Grid,GridType>);
const auto& elem = Dune::cpgrid::Entity<0>(*(gridView_.grid().currentData().back()), elementOrIndex, true);
if (isFieldPropInLgr_ && elem.level()) { // level > 0 == true ; level == 0 == false
// In case some LGRs do not have refined field properties, the next line need to be modified.
Expand All @@ -387,7 +386,6 @@ auto Opm::LookUpData<Grid,GridView>::getFieldPropIdx(const IndexType& elementOrI
return elem.getOrigin().index();
}
} else {
static_assert(std::is_same_v<Grid,GridType>);
static_assert(std::is_same_v<IndexType, Dune::cpgrid::Entity<0>>);
if (isFieldPropInLgr_ && elementOrIndex.level()) { // level > 0 == true ; level == 0 == false
// In case some LGRs do not have refined field properties, the next line need to be modified.
Expand All @@ -398,13 +396,12 @@ auto Opm::LookUpData<Grid,GridView>::getFieldPropIdx(const IndexType& elementOrI
}
}
} else {
static_assert(std::is_same_v<Grid,GridType>);
if constexpr (isIntegral) {
static_assert(std::is_same_v<Grid,GridType>);
// Check there are no LGRs. LGRs (level>0) only supported for CpGrid.
assert(gridView_.grid().maxLevel() == 0);
return elementOrIndex;
} else {
static_assert(std::is_same_v<Grid,GridType>);
assert(elementOrIndex.level() == 0); // LGRs (level>0) only supported for CpGrid.
return this-> elemMapper_.index(elementOrIndex);
}
Expand Down

0 comments on commit 0eb13c4

Please sign in to comment.