Mentions légales du service

Skip to content
  • GILLES Sebastien's avatar
    #1302 LuaOptionFile: shorten the file by making the selection of a parameter more simple. · 987c119e
    GILLES Sebastien authored
    Previously, you had to fill each individual type of possibility for a Parameter, regardless of the one finally chosen. For instance, you had something like (skipping the documentation...):
    
    VolumicMass
    {
        nature = "constant"
        scalar = 1.
        lua_function = none
        piecewise_constant_domain_id = { }
        piecewise_constant_domain_value = { }
    }
    
    and each of these entries should be filled (a shortcut 'none' was however created for lua_function).
    
    This made the Lua files rather heavy, and moreover signaled the non used fields (here VolumicMass.lua_function, VolumicMass.piecewise_constant_domain_id and VolumicMass.piecewise_constant_domain_value) as unused.
    
    Now using up the strength of newly introduced in C++17 std::variant (or boost::variant for Apple Clang currently - see #1305), a more synthetic writing ha been introduced:
    
    VolumicMass
    {
        nature = "constant"
        value = 1.
    }
    
    where 'value' type depends on the...
    987c119e