MoDeNa-EUProject / MoDeNa

Software Framework for MOdelling of morphology DEvelopment of micro- and NAnostructures (MoDeNa)
17 stars 19 forks source link

Implement surrogate function with an algebra parser #10

Open henrus opened 9 years ago

henrus commented 9 years ago

Create the surrogate function with an algebra parser. Both C-code and input/output/parameter spec can be generated automatically. This becomes are new class derived from CFunction

sigveka commented 9 years ago

Check the pull request (modelModules) for a simple draft of this functionality (example in idealGas.py). Right now I am explicitly using "Input, output and parameter" provided by the user, but this can be changed.

henrus commented 9 years ago

This shows quite well what we are aiming for. We will certainly need more syntax and possibly ifs and loops. There may be some limits to what we should allow as we also want to generate derivatives. As far as I know, automatic differentiation will work across loops, but differentiating the syntax tree will not.

Guess the next step is to write down a proper specification of what the 'function' should be able to do. Then we can check for modules (e.g. parsers/lexers) to pull in. Heinz also mentioned a toy parser written in python which may be a route to go.