caching
File Purpose: caching quantities
this is non-trivial because they need to be associated with behavior attrs.
E.g., cached value for ‘n’ may be associated with ‘fluid’, ‘snap’, ‘units’, …
additionally, note that set_var may cache a different var than the one entered,
if the entered var has a known_setter.
E.g. for eppic, set_var(‘n’, fluid=1) may cache a value for ‘den1’ instead of ‘n’.
[TODO] detect when behavior is a relevant sublist of dimensions of another behavior,
e.g. quantity with fluid=1 should be incorporated into getting value with fluid=[0,1,2,3].
and, quantity with fluid=[0,1,2,3] should be incorporated into getting value with fluid=1.
The main code can then check relevant_sublist, and if one is available,
load_across_dims() for the dims with relevant sublists in cache.
Classes
|
quantity, with value and associated behavior. |
|
cache of vars. |
|
cache of vars, where each cached quantity represents a single point (in dimension space). |