Expression: unable to compile C++ code

Hi

I want to use a expression to define a time-depending load. Something like this:

T = 3
p01 = -1.
p03 = -1.
cutoff_Tc = 1
 # Define the loading as an expression depending on t
p1 = Expression(("0", "t <= tc ? p01*t/tc : p03", "0"), t=0, tc=cutoff_Tc, p01=p01, p03=p03, degree=0)

But I get a RuntimeError as follows:

RuntimeError: Unable to compile C++ code with dijitso

Fenics 2019.1.0 on Ubuntu

What did I wrong?
Thanks for help

I’m not getting any error with the MWE. The following runs for me using FEniCS 2019.1.0:

from dolfin import *
T = 3
p01 = -1.
p03 = -1.
cutoff_Tc = 1
 # Define the loading as an expression depending on t
p1 = Expression(("0", "t <= tc ? p01*t/tc : p03", "0"),
                t=0, tc=cutoff_Tc, p01=p01, p03=p03, degree=0)
for i in range(0,3):
    print(assemble(p1[i]*dx(domain=UnitIntervalMesh(1))))

Maybe do a quick

dijitso clean

This will clear the cache and recompile from scratch.

Thanks for your help, but it still does not work…
I tried also: dijitso.cmdline.cmd_clean() …here I am not sure what the arguments should be in dijitso.cmdline.cmd_clean(args, params)

Do you have an other idea?

you probably need to write a class.

ditjitso clean can be called in a terminal.

The error message should also have a file name of the compilation log which could help you.

Hi nate

The error.log file says that there is no Expression.h file, but it exists.
And it worked before…

    /tmp/tmpi1ft54_x/dolfin_expression_c724df7a690a4ccbba6d7cc00af10c2b.cpp:13:10: fatal error: dolfin/function/Expression.h: No such file or directory
 #include <dolfin/function/Expression.h>
      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.