add equality operator to GridDims

also make it default constructible
This commit is contained in:
Arne Morten Kvarving
2020-02-25 12:31:27 +01:00
parent e747ce86b7
commit 84e5f7ccbf
2 changed files with 7 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ namespace Opm {
{
public:
GridDims();
explicit GridDims(std::array<int, 3> xyz);
GridDims(size_t nx, size_t ny, size_t nz);
@@ -56,9 +57,9 @@ namespace Opm {
void assertIJK(size_t i, size_t j, size_t k) const;
protected:
GridDims();
bool operator==(const GridDims& data) const;
protected:
size_t m_nx;
size_t m_ny;
size_t m_nz;

View File

@@ -147,4 +147,8 @@ namespace Opm {
m_nz = dimens[2];
}
bool GridDims::operator==(const GridDims& data) const {
return this->getNXYZ() == data.getNXYZ();
}
}