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

issue with FEniCS on Mac

0 votes

Hi,

I am using FEniCS on Mac, and upon running a code I run in the Windows version without any errors come across the following error message:

mesh = Rectangle(0,0,1,H,divx,divy)
  File "/Applications/FEniCS.app/Contents/Resources/lib/python2.7/site-packages/dolfin/cpp/mesh.py", line 8574, in __init__
    _mesh.Rectangle_swiginit(self,_mesh.new_Rectangle(*args))
TypeError: new_Rectangle expected 4 arguments, got 6

Does the Mac version not recognise rectangular meshes, or should I be using a different syntax?

Many thanks,

asked Oct 5, 2013 by hnili FEniCS Novice (590 points)

The same happens upon use of PeriodicBC. Is there access to a list of differences, or is there a Mac version compatible in syntax with the Windows version?

Many thanks,

1 Answer

+1 vote

Use

mesh = RectangleMesh(0, 0, 1, H, divx, divy)
answered Oct 5, 2013 by Garth N. Wells FEniCS Expert (35,930 points)

Thanks. This solves the problem with rectangular mesh. Yet as I mentioned in the comment above, the Mac version does seemingly not recognise periodicBC in the form it is used in the Windows version:

bc1 = PeriodicBC(V1, pbc)
NameError: name 'PeriodicBC' is not defined

Is there a way to avoid this error?

Many thanks,

Hello,

your problem seems to be that on Windows you're running FEniCS 1.0 while on Mac you run 1.2. (I guess you used the binary installers on both systems)

You can check the Changelogs here:

https://launchpad.net/dolfin/1.1.x/1.1.0/
https://launchpad.net/dolfin/+milestone/1.2.0

The periodic boundary condition was changed in 1.2, I guess, you can have a look at the documentation for the dev version (here) this should work in 1.2 too. Otherwise have a look at the _demo/undocumented_ directory of your local install.

...