Skip to content
Snippets Groups Projects
Commit 94015683 authored by Oliver Sander's avatar Oliver Sander
Browse files

[!342] Change type of volume method to typedef

Merge branch 'santiago.ospina/dune-grid-feature/change-type-of-volume-method-to-typedef' into 'master'

ref:core/dune-grid This is a rebased version of [!305] \-\-- I seem unable to
rebase that one in situ.

See merge request [!342]

  [!305]: gitlab.dune-project.org/NoneNone/merge_requests/305
  [!342]: gitlab.dune-project.org/core/dune-grid/merge_requests/342
parents 6f10b0ec e06f16d8
No related branches found
No related tags found
1 merge request!342Change type of volume method to typedef
Pipeline #18857 passed
......@@ -64,6 +64,12 @@
- The Capability `hasBackupRestoreFacilities<GeometryGrid<HG, CoordFunction>>`
now returns `false` in case the `CoordFunction` is not default-constructible.
- The `Geometry` interface now provides the type `Volume` for the return value of the
method of the same name. Note that this may be different from `ctype` if you care
about dimensions. In that case `ctype` is a length, and not appropriate for
a quantity that is a volume.
# Release 2.6
- The deprecated `EntityPointer` has been removed completely and `EntityIterator`
......
......@@ -100,6 +100,9 @@ namespace Dune
//! type of the global coordinates
typedef FieldVector< ctype, cdim > GlobalCoordinate;
//! Number type used for the geometry volume
typedef decltype(std::declval<Implementation>().volume()) Volume;
/**
* \brief type of jacobian inverse transposed
*
......@@ -202,7 +205,7 @@ namespace Dune
}
/** \brief return volume of geometry */
ctype volume () const
Volume volume () const
{
return impl().volume();
}
......@@ -307,6 +310,9 @@ namespace Dune
typedef FieldVector< ctype, mydim > LocalCoordinate;
typedef FieldVector< ctype, cdim > GlobalCoordinate;
//! Number type used for the geometry volume
typedef ctype Volume;
//! type of jacobian inverse transposed
typedef FieldMatrix< ctype, cdim, mydim > JacobianInverseTransposed;
......@@ -314,7 +320,7 @@ namespace Dune
typedef FieldMatrix< ctype, mydim, cdim > JacobianTransposed;
//! return volume of the geometry
ctype volume () const
Volume volume () const
{
GeometryType type = asImp().type();
......@@ -365,6 +371,7 @@ namespace Dune
typedef FieldVector< ctype, mydim > LocalCoordinate;
typedef FieldVector< ctype, cdim > GlobalCoordinate;
typedef ctype Volume;
//! type of jacobian inverse transposed
typedef FieldMatrix< ctype, cdim, mydim > JacobianInverseTransposed;
......@@ -385,9 +392,9 @@ namespace Dune
}
//! return volume of the geometry
ctype volume () const
Volume volume () const
{
return 1.0;
return Volume(1.0);
}
//! return center of the geometry
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment