Make cellPartition() Return Reference To Const

We don't need to copy this array on every call.
This commit is contained in:
Bård Skaflestad 2022-05-31 17:38:35 +02:00
parent 0bb293aeb0
commit 4e5745bf4a

View File

@ -101,10 +101,11 @@ public:
*/
const CartesianIndexMapper& equilCartesianIndexMapper() const;
std::vector<int> cellPartition() const
const std::vector<int>& cellPartition() const
{
return cell_part_;
return this->cell_part_;
}
protected:
/*!
* \brief Distribute the simulation grid over multiple processes
@ -143,7 +144,7 @@ protected:
std::unique_ptr<CartesianIndexMapper> equilCartesianIndexMapper_;
int mpiRank;
std::vector<int> cell_part_;
std::vector<int> cell_part_{};
};
} // namespace Opm