Hello there, I’m seeing the documentation from this dolfin documentation website: https://fenicsproject.org/olddocs/dolfin/1.4.0/python/demo/documented/built-in_meshes/python/documentation.html
And when I was trying to do build in meshes part, there are having a lot of syntax troubles. The code:
from dolfin import *
mesh = UnitIntervalMesh(10)
print ("Plotting a UnitIntervalMesh")
plot(mesh, title="Unit interval")
mesh = UnitSquareMesh(10, 10)
print ("Plotting a UnitSquareMesh")
plot(mesh, title="Unit square")
mesh = UnitSquareMesh(10, 10, "left")
print ("Plotting a UnitSquareMesh")
plot(mesh, title="Unit square (left)")
mesh = UnitSquareMesh(10, 10, "crossed")
print ("Plotting a UnitSquareMesh")
plot(mesh, title="Unit square (crossed)")
mesh = UnitSquareMesh(10, 10, "right/left")
print ("Plotting a UnitSquareMesh")
plot(mesh, title="Unit square (right/left)")
mesh = RectangleMesh(0.0, 0.0, 10.0, 4.0, 10, 10)
print ("Plotting a RectangleMesh")
plot(mesh, title="Rectangle")
mesh = RectangleMesh(-3.0, 2.0, 7.0, 6.0, 10, 10, "right/left")
print ("Plotting a RectangleMesh")
plot(mesh, title="Rectangle (right/left)")
if has_cgal():
mesh = CircleMesh(Point(0.0, 0.0), 1.0, 0.2)
print ("Plotting a CircleMesh")
plot(mesh, title="Circle (unstructured)")
mesh = EllipseMesh(Point(0.0, 0.0), [3.0, 1.0], 0.2)
print ("Plotting an EllipseMesh")
plot(mesh, title="Ellipse mesh (unstructured)")
mesh = SphereMesh(Point(0.0, 0.0, 0.0), 1.0, 0.2)
print ("Plotting a SphereMesh")
plot(mesh, title="Sphere mesh (unstructured)")
mesh = EllipsoidMesh(Point(0.0, 0.0, 0.0), [3.0, 1.0, 2.0], 0.2)
print ("Plotting an EllipsoidMesh")
plot(mesh, title="Ellipsoid mesh (unstructured)")
mesh = UnitCubeMesh(10, 10, 10)
print ("Plotting a UnitCubeMesh")
plot(mesh, title="Unit cube")
mesh = BoxMesh(0.0, 0.0, 0.0, 10.0, 4.0, 2.0, 10, 10, 10)
print ("Plotting a BoxMesh")
plot(mesh, title="Box")
interactive()
´´´
The error I've got:
Type "help", "copyright", "credits" or "license" for more information.
>>> /usr/bin/python3 "/home/jandui/Documents/MATH code/testes_3/demo_built-in.py"
File "<stdin>", line 1
/usr/bin/python3 "/home/jandui/Documents/MATH code/testes_3/demo_built-in.py"
^
SyntaxError: invalid syntax
And what is that of if_has? This is from c++, right?
Also, why there is that interactive()? Does Dolfin plot the graphs, or should I import Matplotlib?