I updated Poisson and HyperElasticity on the wiki page [1], since NavierStokes has three ufl files, so the change would make the example almost unreadable. While at it I noticed that trailing whitespace prevents ufl files from compiling when it appears
after a line continuation character, i.e. a backslash. I addressed the issue and provided a patch on the patch tracker [2].
When working on MixedPoisson I found out that ufl is not capable of writing to an ufl file a line such as:
(sigma, u) = TrialFunctions(W)
This is due to the parser rules, since the corresponding Octave line is:
>> ufl (sigma, u) = TrialFunctions(W)
where the first ufl (sigma, u) is interpreted as a call to a function, leading to a syntax error. I tried some possible solutions, like escaping brackets with a backslash or enclosing them in apices, but to no avail. After my attempts, I think that the
only way to prevent the parsing error is to enclose both the brackets and their content in quotes or apices, like:
>> ufl "(sigma, u)" = TrialFunctions(W)
This approach requires no further effort on the implementation side, but puts on users the burden of checking whether their ufl code has parentheses before an equal sign and edit it accordingly. I would proceed pointing out this issue in the help string
for the ufl function, unless a more experienced developer comes out with advice on an alternative approach.