4. Defining values and evaluating expressions#
It is possible to assign values to python variables in order to use them as simple keyword arguments: these variables are called parameters in EFICAS. They can contain integer, real, complex values, texts, or lists of these types.
Example:
young = 2.E+11
mat = DEFI_MATERIAU (ELAS = _F (E = young, NU = 0.3))
At the end of execution, the Python context is saved with the database. So, in the continuation that follows, the parameters will still be present, with their predefined values, just like concepts ASTER.
It is possible to perform operations in Python on simple keyword arguments:
Piur2 = ft/2.
mat = MA_COMMANDE (VALE = Pisur2)
or:
var = 'world'
matt = MA_COMMANDE (VALE = ft/2. ,
VALE2 = PiSUR2+cos (30. ),
TEXTE = “hello”+var)