psydac
psydac copied to clipboard
Make code generation robust by using "safe" variable names
When we generate the AST for assembly of scalars (norms), vectors (linear forms), and matrices (bilinear forms), we always create some new symbolic variables, which are usually elements of a given function space. In order to avoid unexpected behavior, we must choose names for these variables that are not already used in the user-defined expressions.
Unfortunately, so far we have used the name Nj to identify basis functions, and w for NURBS weights, without performing any check. This will raise issues if the same names Nj and w are already used in the expressions to be evaluated.
See https://github.com/pyccel/psydac/pull/51#discussion_r340212209.