#798: allow calculations in parameter assignments in parameter files -------------------------+-------------------------------------------------- Reporter: rhaas | Owner: Type: enhancement | Status: new Priority: optional | Milestone: Component: Cactus | Version: Keywords: | -------------------------+-------------------------------------------------- The attached patch extends the parameter file parser and SetParameter routine to allow things like: {{{ foo::bar = "=2*sin(foo:baz)" }}}
ie. arithmetic and access to already set parameters. The new behaviour is triggered if the parameter string (for real, boolean and int parameters) starts with an "=" sign. Otherwise it branches off into the old code.
The largest change is actually in the expression parser which has been extended to handle eg. exponential notation and negations. It now uses a state machine to parse its input.
I have been using this for a while and had no ill side effects (but then really only accumulators are currently using the expression parser).
Eventually I'd like to make the schedule IF/WHILE statements accept expressions using both parameters and grid scalars as well. This would be useful to simplify scheduling things only in the last MoL substep or in all but the last substep.