### CutFEM library error in the compilation of an expression

94
views
0
8 weeks ago by
I am facing an anormal error after having installed and used cutfem library.
Here is the beginning of my code :

from __future__ import print_function
from fenics import *
from dolfin import *
from cutfem import *

# Have the compiler generate code for evaluating derivatives
parameters["form_compiler"]["no-evaluate_basis_derivatives"] = False

# MESH AND RELATED PROPERTIES

N = 50
# Larger mesh than the domain we want to study
mesh = RectangleMesh(Point(-0.1,-0.1),Point(1.1,1.1),N,N)
# Mesh Properties
norm = FacetNormal(mesh)
h = CellSize(mesh)
# Level set expression for the interface
level_set = Expression("x[0]>=x[1] ? abs(x[0]-0.5)-0.5 : abs(x[1]-0.5)-0.5 ", degree = 2)

​

I have an issue with the compilation of the level set expression :

RuntimeError: In instant.recompile: The module did not compile with command 'make VERBOSE=1', see '/home/fenics/.instant/error/dolfin_compile_code_7ce13d1666a8f5cad6df25c7b6df367a432dd016/compile.log'
​

Thank you in advance for your help.

Community: FEniCS Project

0
8 weeks ago by
When I use the floating-point absolute-value function fabs() in the C++ code, it compiles for me using version 2017.2:
 ​level_set = Expression("x[0]>=x[1] ? fabs(x[0]-0.5)-0.5 : fabs(x[1]-0.5)-0.5 ", degree = 2)

(However, it appears that you may be using an older version of FEniCS, since I need to remove the import of cutfem and I get deprecation warnings about CellSize().)

Actually, all my reference codes in CutFEM call CellSize(), I kept it inasmuch as I didn't really give interest to it with my issue with Expression.
I tried fabs() but I have another error :

OSError: [Errno 13] Permission denied: '/home/fenics/.cache/fenics/instant'
​
written 8 weeks ago by Matthieu Diaz
And if I change the expression with something "basic" like x[0]-0.5 only, I get the same error message
written 8 weeks ago by Matthieu Diaz
That sounds like an installation/setup error.  (Is your username "fenics"?)  If the error resolves when removing the import from cutfem, that might narrow things a little bit.  Perhaps there was a path name that needed to be specified in the library installation, or it assumes people are using the Docker container.  (However, when I Google "cutfem", all I find are journal publications and a website that says "Coming soon!", so I'm not sure what exactly you installed.)
written 8 weeks ago by David Kamensky
does invoking the namespace std::abs work?
written 8 weeks ago by Nate