The cname property is a string array where you provide names of constants as input parameters. The
clist property is a string array where you provide values for constants as input parameters. The
clist array must have the same length as the
cname array. These constants overrule any previous definition (for example, from Global Definitions). Each string is evaluated as a list of values. This means, for example, that the
range() operator, units, and global expressions are supported. The first entry in each of these lists will be used to temporarily set the corresponding parameter as given by
cname. This parameter can be a new or an existing global parameter. The constant is temporary in the sense that it is only defined during the solver run. It cannot be evaluated during postprocessing; in fact, it will be unknown if it is not an existing global parameter, and it will use its default value if it is. This is similar to other solver parameters, like
t and
timestep, behave.
also works, but in the COMSOL Desktop you will get an error about "foo" for not being recognized in the evaluation context. And if you use a circular dependency like
If "a" and
"b" are already defined as global parameters and, say,
b=a+1; then redefining
"a" to a new value through
cname and
clist leads to that the value for
"b" is redefined (correctly).