In the python documentation ( http://fenicsproject.org/documentation/dolfin/1.6.0/python/demo/documented/cahn-hilliard/python/documentation.html ) of the Cahn-Hilliard demo the free energy function f is defined as f = 100 * c2 * (1-c)2
Trying to replace it in the python code with the following function fails: N = 1 k = 1 TT = 2 TTc = 3 w = 2 * k * TTc f = NkTT * ( clog(c) + (1-c)log(1-c) ) + Nw * c(1 - c)
As a result the runtime throws the following error: TypeError: nb_float should return float object
Any help is appreciated.
Kind regards.
I think you need ln(c) for the natural logarithm of c (log is a utility function that prints debug messages to a log file).
ln(c)
c
log