FFC compiling UFL file error (Can't extract "unknown")

Hi,

I’m trying to write with C++ api. And I’m writing a non-linear problem with multiple Coefficients in .ufl file. (When I test it with python API, I have multiple Functions, and it works fine with Python api). But I got the following error.

Exception: Can't extract 'unknown'. The Coefficient representing the unknown must be labelled by 'unknown' for nonlinear problems.
u   = Coefficient(V)
u0  = Coefficient(V)
ut  = TestFunction(V)

I know u is my “unknown”/to be solved for and u0 is intermediate solution. But I couldn’t find any document stating how to label it as “unknown”. Any one could help?

Regards
Karl

Have you considered how the Cahn-Hilliard-demo is written for C++ ?

1 Like

Hi, dokken, Thanks for answer, I realized that I mistaken -e option for error information. Removed -e option, code runs and result aligns with Python version. My mistake.