replace autoPtr/tmp combination with refPtr
Some of the optimization code uses a combination of autoPtr and tmp to manage the referenced or local turbulence fields. This is ugly but works and was previously the only way to handle these variants.
In the meantime have a refPtr
(formerly called tmpNrc) which can wrap a reference or handle pointer management. Both tmp
and refPtr
now have three types of storage:
- PTR : Managing a pointer (not ref-counted)
- CREF : Using (const) reference to an object
- REF : Using (non-const) reference to an object
Can thus have storage with deletion, reference an external object, or a nullptr.
Using a refPtr
instead of a tmp
means that we shouldn't accidentally clear memory. Also no reference counting to get in the way.