Open eschnett opened 14 years ago
Would a good alternative be to check for storage for those variables instead of having a separate parameter or grid scalar? Which option would be better? Since the numerical value probably doesn't matter for these variables, the only problem they could cause would be a segfault due to lack of storage. This would mean you didn't need to communicate to Kranc a controlling parameter or grid scalar, just the fact that these variables should be assumed to be zero if they don't have storage.
There is now an internal mechanism to only access certain grid function if a certain variable is set. This is currently used for the Jacobians and the stress-energy hack. What we need now is a nice interface for the user to indicate that certain variables should be treated in this way.
This mechanism should exist already in Cactus, i.e. conditional inheritance. But alas, it doesn't.
Querying storage is not a good idea. Someone may allocate storage for all variables, and this should not affect the behaviour .
Teach Kranc that certain grid functions may have predicates. They can only be accessed if a certain parameter or grid scalar is set; otherwise, these grid functions cannot be accessed are are assumed to have the value zero.
This is useful e.g. for TmunuBase.