evaluate steered value as formula in AEIThorns::Trigger

Issue #1077 open
Roland Haas created an issue

the attached patch adds functionality to Trigger to use a formula (same syntax as parameters in parameter files) instead of a constant value for its steered values. It supports both grid scalars and parameters as variables. I also include an updated test suite to test the functionality.

Keyword: AEIThorn::Trigger

Comments (6)

  1. Roland Haas reporter
    • removed comment

    please ignore the check_for_storage.patch. it has already been applied before.

  2. Frank Löffler
    • removed comment

    The patch looks ok, but duplicates code from the flesh. However, those flesh functions are not accessible to thorns, so that's currently the only way.

    Roland: What would it take to provide a function within the flesh which is similar to CCTK_ParameterSet (which already knows about expressions) but which doesn't actually set a parameter but returns what would be set? This could then be used in Trigger so that Trigger wouldn't have to know about how Cactus parses expressions.

  3. Roland Haas reporter
    • removed comment

    One could make the code in src/eval.c part of the flesh I'd think. It does a bit more than the parameter evaluator since it also uses grid scalars as variables which is not always possible for parameters (since parameters are evaluated before the grid functions have storage for example).

    The other option would be to extract code from the beginning of src/main/Parameters.c/ParameterSet* to handle the different parameter types. This is more or less what the proposed patch does for trigger.

    If we make it part of the flesh I think it might be useful to expose the two halves (expression parsing and expression evaluation) separately just in case some one wants to apply this to a whole grid function.

  4. Frank Löffler
    • removed comment

    It would be nice to have a general Cactus interface for parameter parsing, which the flesh itself, but also thorns use - maybe using a flag whether usage of grid scalars is allowed or not.

  5. Log in to comment