Calculate yup/ydown on demand - #1342
Conversation
Only calculate yup/ydown fields in ShiftedMetric::calcYUpDown() and FCI::calcYUpDown, FCI::integrateYUpDown if they are not already set.
Want to allow calling calcYupYdown() within Grad_par operators, etc., just before yup/ydown fields are needed. Allows methods that calculate yup_field/ydown_field to be marked as const, or take 'const Field3D' as argument.
Now will just call as-needed.
Calls calcYupYdown on the field through its Mesh* pointer.
|
I don't think this is the correct thing to do. I think this would only be acceptable if the parallel slices were completely hidden from the user, i.e. they were an implementation detail. Having a |
|
Think @ZedThree is right. For example if a user wanted to force a function to use the field-aligned version instead of yup/ydown while using ShiftedMetric everywhere else, this implementation would prevent them from doing so because the Closing this, but I'll take over the |
Call calcYUpDown wherever yup/ydown fields are required (it now does nothing if yup/ydown are already present and valid), instead of in Mesh::communicate().
yup_fieldandydown_fieldmembers of Field3Dmutablemutable bool has_yup_ydownto Field3D, so that inSolver::load_vars()we can mark the yup/ydown fields as invalid without deleting themField3D& ynextMutable(int dir) constwhich can be used to get non-constversions of the mutableyup_fieldandydown_fieldfrom aconst Field3DcalcYUpDown()methods take aconst Field3Das argument