Skip to content

Commit 8cb1da3

Browse files
authored
Merge pull request #1049 from vkip/thconr_mpi_issue_fix
Fix thermal conductivity in parallel Closes #726.
2 parents 14dcabb + 49d59a5 commit 8cb1da3

4 files changed

Lines changed: 13 additions & 5 deletions

File tree

opm/grid/CpGrid.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -957,11 +957,13 @@ namespace Dune
957957
const double* transmissibilities = nullptr, bool ownersFirst=false,
958958
bool addCornerCells=false, int overlapLayers=1, int partitionMethod = Dune::PartitionMethod::zoltanGoG,
959959
double imbalanceTol = 1.1,
960-
bool allowDistributedWells = false)
960+
bool allowDistributedWells = false,
961+
bool useTransToFilterOverlap = true)
961962
{
962963
auto ret = scatterGrid(method, ownersFirst, wells, possibleFutureConnections, serialPartitioning, transmissibilities,
963964
addCornerCells, overlapLayers, partitionMethod, imbalanceTol, allowDistributedWells,
964-
/* input_cell_parts = */ std::vector<int>{}, /* level = */ 0);
965+
/* input_cell_parts = */ std::vector<int>{}, /* level = */ 0,
966+
useTransToFilterOverlap);
965967
using std::get;
966968
if (get<0>(ret))
967969
{
@@ -1478,7 +1480,8 @@ namespace Dune
14781480
double imbalanceTol = 1.1,
14791481
bool allowDistributedWells = true,
14801482
const std::vector<int>& input_cell_part = {},
1481-
int level = -1);
1483+
int level = -1,
1484+
bool useTransToFilterOverlap = true);
14821485

14831486
/** @brief The data stored in the grid.
14841487
*

opm/grid/common/GridPartitioning.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ int addOverlapLayer([[maybe_unused]] const CpGrid& grid,
558558
[[maybe_unused]] const Communication<Dune::MPIHelper::MPICommunicator>& cc,
559559
[[maybe_unused]] bool addCornerCells,
560560
[[maybe_unused]] const double* trans,
561+
[[maybe_unused]] bool useTransToFilterOverlap,
561562
[[maybe_unused]] int layers,
562563
[[maybe_unused]] int level)
563564
{
@@ -576,7 +577,7 @@ int addOverlapLayer([[maybe_unused]] const CpGrid& grid,
576577
int index = ix.index(*it);
577578
auto owner = cell_part[index];
578579
exportProcs.insert(std::make_pair(owner, 0));
579-
if ( trans ) {
580+
if ( trans && useTransToFilterOverlap ) {
580581
addOverlapLayerNoZeroTrans(grid, index, *it, owner, cell_part, exportList, addCornerCells, layers-1, trans, level);
581582
}
582583
else {

opm/grid/common/GridPartitioning.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ namespace Dune
108108
/// \param[in] cc The communication object
109109
/// \param[in] addCornerCells Switch for adding corner cells to overlap layer.
110110
/// \param[in] trans The transmissibilities on cell faces. When trans[i]==0, no overlap is added.
111+
/// \param[in] useTransToFilterOverlap If true, zero transmissibility faces are skipped in overlap construction.
111112
/// \param[in] layers Number of overlap layers
112113
/// \param[in] level Indicating level grid that is partitioned. Default -1 for leaf grid view.
113114
int addOverlapLayer(const CpGrid& grid,
@@ -117,6 +118,7 @@ namespace Dune
117118
const Communication<Dune::MPIHelper::MPICommunicator>& cc,
118119
bool addCornerCells,
119120
const double* trans,
121+
bool useTransToFilterOverlap = true,
120122
int layers = 1,
121123
int level = -1);
122124

opm/grid/cpgrid/CpGrid.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ CpGrid::scatterGrid(EdgeWeightMethod method,
217217
double imbalanceTol,
218218
[[maybe_unused]] bool allowDistributedWells,
219219
[[maybe_unused]] const std::vector<int>& input_cell_part,
220-
int level)
220+
int level,
221+
[[maybe_unused]] bool useTransToFilterOverlap)
221222
{
222223
// Silence any unused argument warnings that could occur with various configurations.
223224
static_cast<void>(wells);
@@ -397,6 +398,7 @@ CpGrid::scatterGrid(EdgeWeightMethod method,
397398
cc,
398399
addCornerCells,
399400
transmissibilities,
401+
useTransToFilterOverlap,
400402
1 /*layers*/,
401403
level);
402404
// importList contains all the indices that will be here.

0 commit comments

Comments
 (0)