siesta-project / flos

Interfacing SIESTA to Lua scripts using the flook code
https://siesta-project.github.io/flos/index.html
MIT License
6 stars 4 forks source link

Add new example with configurable NEB script #15

Closed albgar closed 1 year ago

albgar commented 1 year ago

Some Lua scripts (e.g. the NEB example driver) have hard-wired operational variables, such as the number of images, or the NEB spring constant.

A mechanism has been implemented to set those variables externally, through the use of a 'configuration file' (typically named 'config.lua') and a new variable environment.

A sample 'config.lua' file is provided for parametrizing the new script 'neb_configurable.lua', which adds configuration support to the 'neb_simple.lua' script. Note that both scripts must be present in the same directory. They have been put in a new "advanced" subdirectory in order not to complicate the existing examples.

This is just one possible mechanism. A simpler one is based on the 'dofile' command:

dofile("config.lua")

would make available to the current script the variables defined in "config.lua".

(Thanks to Nick Papior for the comments)

zerothi commented 1 year ago

Done, thanks!