Separating LGRs in rank 0 cellCentroids_

This commit is contained in:
Antonella Ritorto 2023-09-28 11:12:44 +02:00
parent ffa7bc23ed
commit 92a1d3caab
4 changed files with 9 additions and 6 deletions

View File

@ -248,7 +248,7 @@ public:
std::function<std::array<double,dimensionworld>(int)>
cellCentroids() const
{
return this->cellCentroids_(this->cartesianIndexMapper());
return this->cellCentroids_(this->cartesianIndexMapper(), false);
}
const TransmissibilityType& globalTransmissibility() const

View File

@ -476,11 +476,14 @@ protected:
*/
template<class CartMapper>
std::function<std::array<double,dimensionworld>(int)>
cellCentroids_(const CartMapper& cartMapper) const
cellCentroids_(const CartMapper& cartMapper, const bool& isCpGrid) const
{
return [this, cartMapper](int elemIdx) {
return [this, cartMapper, isCpGrid](int elemIdx) {
std::array<double,dimensionworld> centroid;
if (this->gridView().comm().rank() == 0)
const auto rank = this->gridView().comm().rank();
const auto maxLevel = this->gridView().grid().maxLevel();
bool useEclipse = !isCpGrid || (isCpGrid && (rank == 0) && (maxLevel == 0));
if (useEclipse)
{
centroid = this->eclState().getInputGrid().getCellCenter(cartMapper.cartesianIndex(elemIdx));
}

View File

@ -239,7 +239,7 @@ public:
std::function<std::array<double,dimensionworld>(int)>
cellCentroids() const
{
return this->cellCentroids_(this->cartesianIndexMapper());
return this->cellCentroids_(this->cartesianIndexMapper(), true);
}
const std::vector<int>& globalCell()

View File

@ -222,7 +222,7 @@ public:
std::function<std::array<double,EclBaseVanguard<TypeTag>::dimensionworld>(int)>
cellCentroids() const
{
return this->cellCentroids_(this->cartesianIndexMapper());
return this->cellCentroids_(this->cartesianIndexMapper(), false);
}
std::vector<int> cellPartition() const