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

'PolygonalMeshGenerator' is not defined

0 votes

Hi!
I tried generate mesh using this tutorial 10. Generate mesh and got error

'PolygonalMeshGenerator' is not defined

from dolfin import *

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

# Create empty Mesh
mesh = Mesh()

# Create list of polygonal domain vertices
domain_vertices = [Point(0.0, 0.0),
                   Point(1.0, 0.0),
                   Point(1.0, 1.0),
                   Point(0.0, 1.0),                   
                   Point(0.0, 0.0)]

# Generate mesh and plot
PolygonalMeshGenerator.generate(mesh, domain_vertices, 1.0);

The error:

Traceback (most recent call last):
  File "mesh2-1.py", line 18, in <module>
    PolygonalMeshGenerator.generate(mesh, domain_vertices, 1.0);
NameError: name 'PolygonalMeshGenerator' is not defined

I use Finics version 1.0 (Windows).

Thanks in advance!

asked Feb 10, 2014 by Maks FEniCS User (2,430 points)

1 Answer

0 votes
 
Best answer

The PolygonalMeshGenerator is not yet available in FEniCS 1.0. However, for more recent versions you either need to figure out how to compile in Windows or install Ubuntu (in some VM or natively), since the Windows port is not officially maintained anymore.

answered Feb 11, 2014 by Christian Waluga FEniCS Expert (12,310 points)
selected Feb 12, 2014 by Maks

Hi!

I am with version 1.5.0.1 and getting the same error. Actually, the has_cgal() method is also not defined for me.

Thank you!

Hello!

I have the same problem amigodicardo. I am running Ubuntu 14.04 and FEniCS 1.5.
I think I have installed mshr as well, but still it gives me the same error.
Please advise. Thanks.

Hello,

I am using version 1.6.0 and for me has_cgal method is not defined. If anyone can help then it would be very helpful.

Sincerely,
Shankha

...