Geometry volumes
Feature request
What does this feature / why does DuMux need it:
When building dune geometries and calling geometry.volume()
this only yields a rough estimate of the real volume,
at least for non-tetrahedral geometries. This is also clearly stated for example when looking at MultiLinearGeometry
class:
/** \brief obtain the volume of the mapping's image
*
* \note The current implementation just returns
* \code
* integrationElement( refElement().position( 0, 0 ) ) * refElement().volume()
* \endcode
* which is wrong for n-linear surface maps and other nonlinear maps.
*/
Volume volume () const
{
return integrationElement( refElement().position( 0, 0 ) ) * refElement().volume();
}
I think we should therefore check our code and see where this is used and replace it, if possible, with Dumux::volume(...)
.
At least I forgot that recently and used it to calculate barycenters, which then gave me wrong results (leading to non-convergence).
The same also holds for faces in 3D.
Some options to discuss:
We could do the following
- Fix volume function and check if geometry if affine
- Pass volume / center / normal to contructor of scvs/scvfs which we get from geometryHelper. I think this is anyways better. (We partly do this already for other CVFE schemes)
- We can then easily exchange the geometry helper to be more exact...
- Provide
integrate
andaverage
functions over geometries that prevent inconsistencies. Main source of error is by for example integrating exactly but then dividing by wrong volume.
Edited by Martin Schneider