Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix?] Add overlap cell even if intersection has zero transmissibility #726

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 21 additions & 27 deletions opm/grid/common/GridPartitioning.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,37 +429,31 @@ void addOverlapLayer(const CpGrid& grid, int index, const CpGrid::Codim<0>::Enti
for (CpGrid::LeafIntersectionIterator iit = e.ileafbegin(); iit != e.ileafend(); ++iit) {
if ( iit->neighbor() ) {
int faceId = iit->id();
int nb_index = ix.index(iit->outside());
if ( cell_part[nb_index]!=owner )
{
// Note: multiple adds for same process are possible
exportList.emplace_back(nb_index, owner, AttributeSet::copy);
exportList.emplace_back(index, cell_part[nb_index], AttributeSet::copy);

// If the transmissibility on a cell interface is zero we do not add the neighbor cell
// to the overlap layer. The reason for this is that
// zero transmissibility -> no flux over the face -> zero offdiagonal.
// This is a reservoir simulation spesific thing that reduce parallel overhead.
if ( trans[faceId] != 0.0 ) {
int nb_index = ix.index(iit->outside());
if ( cell_part[nb_index]!=owner )
if ( recursion_deps>0 )
{
// Note: multiple adds for same process are possible
exportList.emplace_back(nb_index, owner, AttributeSet::copy);
exportList.emplace_back(index, cell_part[nb_index], AttributeSet::copy);
if ( recursion_deps>0 )
{
// Add another layer
addOverlapLayerNoZeroTrans(grid, nb_index, e, owner, cell_part,
exportList, addCornerCells, recursion_deps-1, trans);
}
else if (addCornerCells)
// Add another layer
addOverlapLayerNoZeroTrans(grid, nb_index, e, owner, cell_part,
exportList, addCornerCells, recursion_deps-1, trans);
}
else if (addCornerCells)
{
// Add cells to the overlap that just share a corner with e.
for (CpGrid::LeafIntersectionIterator iit2 = iit->outside().ileafbegin();
iit2 != iit->outside().ileafend(); ++iit2)
{
// Add cells to the overlap that just share a corner with e.
for (CpGrid::LeafIntersectionIterator iit2 = iit->outside().ileafbegin();
iit2 != iit->outside().ileafend(); ++iit2)
if ( iit2->neighbor() )
{
if ( iit2->neighbor() )
{
int nb_index2 = ix.index(iit2->outside());
if( cell_part[nb_index2]!=owner ) {
addOverlapCornerCell(grid, owner, e, iit2->outside(),
cell_part, exportList);
}
int nb_index2 = ix.index(iit2->outside());
if( cell_part[nb_index2]!=owner ) {
addOverlapCornerCell(grid, owner, e, iit2->outside(),
cell_part, exportList);
}
}
}
Expand Down