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 ac95480 commit 84593f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions opm/grid/cpgrid/Entity.hpp
Original file line number Diff line number Diff line change
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 84593f2

Please sign in to comment.