This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

I am getting error like NameError: name 'has_cgal' is not defined while running this given code.

0 votes
from dolfin import *


if not has_cgal():
    print "DOLFIN must be compiled with CGAL to run this demo."
    exit(0)


# Define 3D geometry
box = Box(0, 0, 0, 1, 1, 1)
sphere = Sphere(Point(0, 0, 0), 0.3)
cone = Cone(Point(0, 0, -1), Point(0, 0, 1), 1., .5)

g3d = box + cone - sphere

# Test printing
info("\nCompact output of 3D geometry:")
info(g3d)
info("\nVerbose output of 3D geometry:")
info(g3d, True)

# Plot geometry
plot(g3d, "3D geometry (surface)")

# Generate and plot mesh
mesh3d = Mesh(g3d, 32)
info(mesh3d)
plot(mesh3d, "3D mesh")

interactive()
asked Jun 10, 2017 by Divyansh FEniCS Novice (140 points)

1 Answer

0 votes

It is a long time since DOLFIN used CGAL and therefore has_cgal does not exist anymore.

You should be able to do what you want with mshr.

answered Jun 13, 2017 by johannr FEniCS Expert (17,350 points)
...