Log function as Expression
The log function is no longer functional in FEniCS. For instance, f = Expression("log(x[0])", degree=2) yields the following error:
Moving new file over differing existing file:
src: /Users/jaddoghman/PycharmProjects/pythonProject/jitfailure-dolfin_expression_f60265c862d87700218c841a812dafcb/error.log.6ea03de6066b4b9d83ac2b8ded7b64d0
dst: /Users/jaddoghman/PycharmProjects/pythonProject/jitfailure-dolfin_expression_f60265c862d87700218c841a812dafcb/error.log
backup: /Users/jaddoghman/PycharmProjects/pythonProject/jitfailure-dolfin_expression_f60265c862d87700218c841a812dafcb/error.log.old
------------------- Start compiler output ------------------------
/var/folders/ss/zp8nt0fj6sq7cbyhdz9w52q40000gp/T/tmpi7ash_kk/dolfin_expression_f60265c862d87700218c841a812dafcb.cpp:61:23: error: no matching function for call to 'log'
values[0] = log(x[0]);
^~~
/Users/jaddoghman/opt/anaconda3/envs/fenics2018/include/dolfin/log/log.h:103:8: note: candidate function not viable: requires at least 2 arguments, but 1 was provided
void log(int debug_level, std::string msg, ...);
^
1 error generated.
------------------- End compiler output ------------------------
Compilation failed! Sources, command, and errors have been written to: /Users/jaddoghman/PycharmProjects/pythonProject/jitfailure-dolfin_expression_f60265c862d87700218c841a812dafcb
Traceback (most recent call last):
File "/Users/jaddoghman/opt/anaconda3/envs/fenics2018/lib/python3.7/site-packages/dolfin/jit/jit.py", line 167, in compile_class
mpi_comm=mpi_comm)
File "/Users/jaddoghman/opt/anaconda3/envs/fenics2018/lib/python3.7/site-packages/dolfin/jit/jit.py", line 47, in mpi_jit
return local_jit(*args, **kwargs)
File "/Users/jaddoghman/opt/anaconda3/envs/fenics2018/lib/python3.7/site-packages/dolfin/jit/jit.py", line 103, in dijitso_jit
return dijitso.jit(*args, **kwargs)
File "/Users/jaddoghman/opt/anaconda3/envs/fenics2018/lib/python3.7/site-packages/dijitso/jit.py", line 217, in jit
% err_info['fail_dir'], err_info)
dijitso.jit.DijitsoError: Dijitso JIT compilation failed, see '/Users/jaddoghman/PycharmProjects/pythonProject/jitfailure-dolfin_expression_f60265c862d87700218c841a812dafcb' for details
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "", line 1, in
Is there any alternative? Thanks!
For whom it may concern, the function log1p may be a good alternative for log. For instance, log1p(x) = log(x + 1), so it suffices to consider log1p(x - 1).