Skip to content

Commit

Permalink
Let Entity return geometry as a copy.
Browse files Browse the repository at this point in the history
Geometry is lightweight enough and this is what DUNE's grid interface
mandates.
  • Loading branch information
blattms committed Aug 3, 2018
1 parent 4d17438 commit e7aa2af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opm/grid/cpgrid/Entity.hpp
Expand Up @@ -149,7 +149,7 @@ namespace Dune
}

/// Returns the geometry of the entity (does not depend on its orientation).
const Geometry& geometry() const;
Geometry geometry() const;

/// We do not support refinement, so level() is always 0.
int level() const
Expand Down Expand Up @@ -431,7 +431,7 @@ unsigned int Entity<codim>::subEntities ( const unsigned int cc ) const
}

template <int codim>
const typename Entity<codim>::Geometry& Entity<codim>::geometry() const
typename Entity<codim>::Geometry Entity<codim>::geometry() const
{
return pgrid_->geomVector<codim>()[*this];
}
Expand Down

0 comments on commit e7aa2af

Please sign in to comment.