some of you might have noticed that there is a cmake option "WITH_LUA" available in Elmer. Setting that to true will compile and link Lua 5.1 (https://www.lua.org/) in to elmer solver library. Typically, evaluating Lua expressions is around 5 times faster than their matc counterparts and there are features only available to Lua and not for matc scripting.
Lua functionality is not yet enabled in Windows nor Launchpad builds. If the Lua functionality does not introduce any strange bugs we are likely to turn it on in Windows/Launchpad builds as well.
Lua can be used pretty much same way as MATC in elmer with few exceptions.
!LUA BEGIN
! --- lua line 1
! --- lua line 2
! ...
!LUA END
The lua script equivalent of "$" (in matc) is "#". For example "permittivity of vacuum = # epsilon" will evaluate "epsilon" as a lua expression, convert result into a string and insert that in place of "# epsilon"
variables in 'real Lua "..."' always referred to tx[0], tx[1], ..., tx[n] in lua code instead of "tx(0), ..., tx(n)" or "tx" (in case of just one variable)
Output order in Lua for tensorial keywords is row-wise (This is possibly the same as in matc)
some of you might have noticed that there is a cmake option "WITH_LUA" available in Elmer. Setting that to true will compile and link Lua 5.1 (https://www.lua.org/official) in to elmer solver library. Typically, evaluating Lua expressions is around 5 times faster than their matc counterparts and there are features only available to Lua and not for matc scripting.
Lua functionality is not yet enabled in Windows nor Launchpad builds. If the Lua functionality does not introduce any strange bugs we are likely to turn it on in Windows/Launchpad builds as well.
Hello kataja,
Thanks for this, I've just started working with Lua 5.1
Had to rename the posix_c.so to posix.so due to the bug issue report on Debian.
Is there a way to disable Lua, once installed? I used PPA package for installation which doesn't gives a choice to not have it. Sorry, if its a basic question. I'm relatively new to Linux.
Thanks for your response. I have been trying to install Elmer using cmake and have been running into one error after another. PPA installation works fine but it has LUA activated. I'm picking up some work that I did a couple of years back and with LUA active the old SIF files are not working. If there was a PPA package with LUA disabled, it would have been great, but I couldn't find one.
if I understand corrctly, if you don't use LUA, it will not be active and you should see no difference due to LUA. So either your old sif files contain expressions which activate LUA unintentionnally, or there is another problem.
You might post the sif file and the error message here so that some expert can have a look...