Skip to content

Commit

Permalink
added: option to allow for empty grid partitions
Browse files Browse the repository at this point in the history
  • Loading branch information
akva2 committed Dec 6, 2022
1 parent dff7c2f commit b6b77da
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions ebos/eclbasevanguard.hh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ struct OwnerCellsFirst {
using type = UndefinedProperty;
};

template<class TypeTag, class MyTypeTag>
struct AllowEmptyPartitions {
using type = UndefinedProperty;
};

template<class TypeTag, class MyTypeTag>
struct SerialPartitioning {
using type = UndefinedProperty;
Expand Down Expand Up @@ -158,6 +163,10 @@ struct OwnerCellsFirst<TypeTag, TTag::EclBaseVanguard> {
static constexpr bool value = true;
};
template<class TypeTag>
struct AllowEmptyPartitions<TypeTag, TTag::EclBaseVanguard> {
static constexpr bool value = false;
};
template<class TypeTag>
struct SerialPartitioning<TypeTag, TTag::EclBaseVanguard> {
static constexpr bool value = false;
};
Expand Down Expand Up @@ -245,6 +254,8 @@ public:

EWOMS_REGISTER_PARAM(TypeTag, bool, OwnerCellsFirst,
"Order cells owned by rank before ghost/overlap cells.");
EWOMS_REGISTER_PARAM(TypeTag, bool, AllowEmptyPartitions,
"Allow ranks with no grid cells.");
#if HAVE_MPI
EWOMS_REGISTER_PARAM(TypeTag, bool, SerialPartitioning,
"Perform partitioning for parallel runs on a single process.");
Expand All @@ -258,6 +269,7 @@ public:
"See https://sandialabs.github.io/Zoltan/ug_html/ug.html "
"for available Zoltan options.");
EWOMS_HIDE_PARAM(TypeTag, ZoltanParams);
EWOMS_HIDE_PARAM(TypeTag, AllowEmptyPartitions);
#endif
EWOMS_REGISTER_PARAM(TypeTag, bool, AllowDistributedWells,
"Allow the perforations of a well to be distributed to interior of multiple processes");
Expand All @@ -283,6 +295,7 @@ public:
#endif

ownersFirst_ = EWOMS_GET_PARAM(TypeTag, bool, OwnerCellsFirst);
allowEmptyPartitions_ = EWOMS_GET_PARAM(TypeTag, bool, AllowEmptyPartitions);
#if HAVE_MPI
serialPartitioning_ = EWOMS_GET_PARAM(TypeTag, bool, SerialPartitioning);
zoltanImbalanceTol_ = EWOMS_GET_PARAM(TypeTag, double, ZoltanImbalanceTol);
Expand Down Expand Up @@ -624,6 +637,9 @@ protected:
/*! \brief Whether a cells is in the interior.
*/
std::vector<int> is_interior_;

//! \brief Allow empty grid partitions.
bool allowEmptyPartitions_;
};

} // namespace Opm
Expand Down
1 change: 1 addition & 0 deletions ebos/eclcpgridvanguard.hh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public:
: EclBaseVanguard<TypeTag>(simulator)
{
this->callImplementationInit();
this->grid().setAllowEmptyPartitions(this->allowEmptyPartitions_);
}

/*!
Expand Down

0 comments on commit b6b77da

Please sign in to comment.