Kranc icon indicating copy to clipboard operation
Kranc copied to clipboard

Allow predicates for accessing grid functions

Open eschnett opened this issue 15 years ago • 4 comments

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.

eschnett avatar Mar 01 '10 22:03 eschnett

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.

ianhinder avatar Dec 01 '10 13:12 ianhinder

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.

ianhinder avatar Jun 02 '11 14:06 ianhinder

This mechanism should exist already in Cactus, i.e. conditional inheritance. But alas, it doesn't.

eschnett avatar Jun 02 '11 23:06 eschnett

Querying storage is not a good idea. Someone may allocate storage for all variables, and this should not affect the behaviour .

eschnett avatar Jun 28 '11 17:06 eschnett