Avoid compilation, mesh reading, etc. when executing script multiple times

Hi,

I have a FF++ script which solves a boundary value problem based on some inputs that can be passed as parameters p1, p2, . . . , pn when executing it. These parameters are generated in other code parts written in another programming language (Julia), so what I would do is generate a string FreeFem++ script.edp -p1 . . . and run the expression in Bash.

I know this is highly inefficient, but I couldn’t think of a better way. My main two concerns are that the script needs to be compiled every time, and also that time is spent reading a mesh, etc.

Is there any way I can pre-compile a FreeFem++ program? Also that I do not have to read the mesh each time?

As far as I am aware, no. It sounds like the best thing to do would be to write as much of your workflow as possible in a single .edp that only compiles and loads the mesh once.

1 Like