geodynamics / aspect

A parallel, extensible finite element code to simulate convection in both 2D and 3D models.
https://aspect.geodynamics.org/
Other
227 stars 237 forks source link

Make normalize_pressure()/denormalize_pressure() more intuitive #1229

Closed bangerth closed 7 years ago

bangerth commented 8 years ago

As mentioned at http://lists.geodynamics.org/pipermail/aspect-devel/2016-September/001407.html it isn't quite clear any more what these two functions do in the first place :-)

But we could at least make them a bit more intuitive by ensuring that normalize_pressure() only works on the arguments it gets, rather than secretly also storing something that will then at a later time be used again by denormalize_pressure(). My vision would be that the two functions become const and have a more "functional programming" interface in which they only work on data they explicitly receive, or which they return explicitly. This would imply that normalize_pressure() returns the pressure adjustment to the place where it is called, and denormalize_pressure() would use this adjustment at a later time. The Simulator::pressure_adjustment variable could then go the way of the dodo.

I would do this right away if I didn't know that @MFraters is currently struggling with all of this.

bangerth commented 8 years ago

(...struggling with this and is rewriting the various places where these functions are being used.)