[ET Trac] [Einstein Toolkit] #798: allow calculations in parameter assignments in parameter files

Einstein Toolkit trac-noreply at einsteintoolkit.org
Wed Apr 11 11:35:42 CDT 2012


#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.

-- 
Ticket URL: <https://trac.einsteintoolkit.org/ticket/798>
Einstein Toolkit <http://einsteintoolkit.org>
The Einstein Toolkit


More information about the Trac mailing list