Skip to content

Commit 968479a

Browse files
committed
Add explict check cell-to-face and face-to-cell in simple grid, with 1x2x1 children per parent
1 parent fb16cf3 commit 968479a

3 files changed

Lines changed: 492 additions & 267 deletions

File tree

opm/grid/cpgrid/LgrFaultHelpers.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,10 @@ struct FieldVectorLess {
104104
bool operator()(const Dune::FieldVector<double,3>& v,
105105
const Dune::FieldVector<double,3>& w) const
106106
{
107+
double tolerance = 1e-8;
107108
for (int i = 0; i < 3; ++i) {
108-
if (v[i] < w[i]) return true;
109-
if (v[i] > w[i]) return false;
109+
if (v[i] < w[i] - tolerance) return true;
110+
if (v[i] > w[i] + tolerance) return false;
110111
}
111112
return false;
112113
}

opm/grid/cpgrid/LgrHelpers.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,7 +1393,7 @@ void populateRefinedCells(const Dune::cpgrid::CpGridData& current_data,
13931393
if (!Opm::Lgr::areClose(w,v)) {
13941394
continue;
13951395
}
1396-
else { std::cout<< v[0]<< " " << v[1] << " " << v[2] <<std::endl;
1396+
else {
13971397
return lastCellAndCorner;
13981398
}
13991399
}
@@ -1553,7 +1553,7 @@ void populateLeafGridFaces(const Dune::cpgrid::CpGridData& current_data,
15531553
if (!Opm::Lgr::areClose(w,v)) {
15541554
continue;
15551555
}
1556-
else { std::cout<< v[0]<< " " << v[1] << " " << v[2] <<std::endl;
1556+
else {
15571557
return lastCellAndCorner;
15581558
}
15591559
}
@@ -1667,7 +1667,7 @@ void populateLeafGridCells(const Dune::cpgrid::CpGridData& current_data,
16671667
if (!Opm::Lgr::areClose(w,v)) {
16681668
continue;
16691669
}
1670-
else { std::cout<< v[0]<< " " << v[1] << " " << v[2] <<std::endl;
1670+
else {
16711671
return lastCellAndCorner;
16721672
}
16731673
}

0 commit comments

Comments
 (0)