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.
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 bydenormalize_pressure()
. My vision would be that the two functions becomeconst
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 thatnormalize_pressure()
returns the pressure adjustment to the place where it is called, anddenormalize_pressure()
would use this adjustment at a later time. TheSimulator::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.