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

Fenics 1.4 : 'PolygonalMeshGenerator' is not defined

0 votes

Hello,
i´m using the PolygonalMeshGenerator in Fenics 1.4 and everything worked fine. After some troubles, i had to reinstall Fenics 1.4 and now i get this error:

NameError: global name 'PolygonalMeshGenerator' is not defined

My original code looks something like this:

from dolfin import *
dolfin.parameters.reorder_dofs_serial = False

M = Mesh()
cellsize = 0.25
Pointlist = []

for index in Vertexlist:
     Coor = Gamma.coordinates()[index]
     Pointlist.append(Point(Coor[0],Coor[1]))

PolygonalMeshGenerator.generate(M,Pointlist,cellsize)

The first and last Point in the 'Pointlist' are the same.
I also tried PolygonalMeshGenerator_generate(), which results in the same error.
With from mshr import * its the same!?

So whats happend with the Generator?
Maybe it is interesting how i installed Fenics 1.4:
I build a new Ubuntu in a VM and used this:

sudo add-apt-repository ppa:fenics-packages/fenics-1.4.x
sudo apt-get update
sudo apt-get install fenics

A version-check said: 1.4
What do i´m missing?

asked Feb 28, 2015 by MrCoffeee FEniCS Novice (230 points)

Okay, i missed CGAL, my fault.
Is this the right way to install fenics with cgal?

1 install cgal
2 sudo add-apt-repository ppa:fenics-packages/fenics-1.4.x
3 sudo apt-get update
4 see link above
5 sudo apt-get install fenics

1 Answer

0 votes

CGAL has been removed from the latest FEniCS release, so I suggest that you look at mshr (https://bitbucket.org/fenics-project/mshr) which provides replacement functionality.

answered Mar 4, 2015 by Garth N. Wells FEniCS Expert (35,930 points)
...