ianhinder / Kranc

A Mathematica package for generating code for solving time dependent partial differential equations
http://kranccode.org
GNU General Public License v2.0
28 stars 10 forks source link

No error given when MoL is not active #94

Open eschnett opened 11 years ago

eschnett commented 11 years ago

I set up a parameter file that uses a Kranc-generated thorn, but did not activate MoL. There was no error message. However, nothing happened during evolution (unsurprisingly in hindsight).

This should be a fatal error during evolution.

ianhinder commented 11 years ago

I had assumed that Kranc thorns would inherit from MoL, but it turns out that this is not the case (and I think has never been the case). Kranc thorns do not always need MoL; they only need it if they contain evolution equations. I suppose even in that case, they might not need it if those equations are not used, but that is getting complicated. Actually, Kranc thorns don't need MoL; they just need something which provides the interface of MoL (Cactus is supposed to be modular with abstractions!). Kranc thorns "USE" certain aliased functions, e.g. "USES FUNCTION MoLRegisterEvolved". Are Cactus thorns allowed to use functions from inactive thorns? Should it be required to inherit from an implementation to use aliased functions, or are aliased functions not a part of the "implementation" (i.e. the interface)?

eschnett commented 11 years ago

I guess MoL's aliased functions are only used in routines scheduled in groups provided by MoL, which don't exist if MoL is inactive.

No, aliased functions are not part of the interface of a thorn.

I think that sharing a parameter from MoL should require inheriting from it.

I would make Kranc-generated thorns inherit from MoL if they register evolved variables.