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

@@ -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));
}