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

RecatangleMesh

0 votes

I'm a FEniCS novice.
I run FEniCS under ubuntu 16.04LTS in a jupyter notebook (Python 2.7) with the following details:
dolfin = 2016.1.0
IPython = 4.0.1
Jupyter = 1.0.0

I am trying to solve a simple Poisson equation (torsion problem)
Two statements from the code for brevity
mesh = RectangleMesh(0, 0,3,2,6,10,"right")
V = FunctionSpace(mesh, 'Lagrange', 1)

I get the following errors. Any help is greatly appreciated.
Thanks, Vas.

NotImplementedError Traceback (most recent call last)
/home/vwij/Documents/fenics/d1_vw_p2D.py in ()
10 # Create mesh and define function space
11 #mesh = UnitSquareMesh(2, 2)
---> 12 mesh = RectangleMesh(0, 0,3,2,6,10,"right")
13 V = FunctionSpace(mesh, 'Lagrange', 1)
14

/usr/lib/python2.7/dist-packages/dolfin/cpp/mesh.pyc in init(self, args)
9372
9373 """
-> 9374 _mesh.RectangleMesh_swiginit(self, _mesh.new_RectangleMesh(
args))
9375 swig_destroy = _mesh.delete_RectangleMesh
9376 RectangleMesh_swigregister = _mesh.RectangleMesh_swigregister

NotImplementedError: Wrong number or type of arguments for overloaded function 'new_RectangleMesh'.
Possible C/C++ prototypes are:
dolfin::RectangleMesh::RectangleMesh(dolfin::Point const &,dolfin::Point const &,std::size_t,std::size_t,std::string)
dolfin::RectangleMesh::RectangleMesh(dolfin::Point const &,dolfin::Point const &,std::size_t,std::size_t)
dolfin::RectangleMesh::RectangleMesh(MPI_Comm,dolfin::Point const &,dolfin::Point const &,std::size_t,std::size_t,std::string)
dolfin::RectangleMesh::RectangleMesh(MPI_Comm,dolfin::Point const &,dolfin::Point const &,std::size_t,std::size_t)

closed with the note: Answer renders the solution to the question asked.
asked Aug 7, 2016 by vas FEniCS Novice (330 points)
closed Aug 7, 2016 by vas

1 Answer

0 votes
 
Best answer

The syntax for RectangleMesh has been changed to

mesh = RectangleMesh(Point(0, 0),Point(3,2),6,10,"right")
answered Aug 7, 2016 by KristianE FEniCS Expert (12,900 points)
selected Aug 17, 2016 by johannr

Thanks, much appreciated. vas

...