Error when calling generate_mesh() with Polygon subdomains


208
views
1
8 months ago by
Derek  
Hi all,

I'm getting errors calling generate_mesh when I pass it a Rectangle with polygon-shaped subdomain.  Please see the MWE below:

from dolfin import *
from mshr import *

# Define 2D geometry with POLYGONS
domain = Rectangle(Point(-1,-1),Point(1, 3.5))
polygon = Polygon([Point(0,0), Point(0.5,0), Point(0.5, 2.5), Point(0, 2.5), Point(0,0)])
domain.set_subdomain(1, polygon)
# Generate and plot mesh
mesh = generate_mesh(domain, 10)
plot(mesh, "2D mesh", interactive=True)​


And the above code gives me the following errors:
polygon = Polygon((0, 0), (0.5, 0), (0.5, 2.5), (0, 2.5), (0, 0))
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run 
[0]PETSC ERROR: to get more information on the crash.
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD 
with errorcode 59.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------------------------------------------
------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD 
with errorcode 59.

NOTE: invoking MPI_ABORT causes Open MPI to kill all MPI processes.
You may or may not see output from other processes, depending on
exactly when Open MPI kills them.
--------------------------------------​



However, it works fine when I use a different kind of shape (circle rather than polygon):
# Define 2D geometry
domain = Rectangle(Point(0.0, 0.0), Point(1, 4))
domain.set_subdomain(1, Circle(Point(0.5, 0.5), 0.25))
# Generate and plot mesh
mesh = generate_mesh(domain, 10)
plot(mesh, "2D mesh", interactive=True)​

^^ no errors

I'm running Ubuntu 14.04 LTS and installed fenics just today through apt-get (dolfin version 1.6.0), all without a problem.
sudo apt-get install --no-install-recommends fenics​


Any ideas how I can diagnose this issue?

Thanks!

Community: FEniCS Project
Please login to add an answer/comment or follow this question.

Similar posts:
Search »