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

modelling L-shape near origin seems to run into endless loop

+1 vote

modelling the L-shape ( (-1,1)x(-1,1)\(-1,a)x(-1,a) )x(-1,0) gives an unreasonably fine mesh near origin. When setting a=0.0, FEniCS 1.2.0 on OS X 10.8 runs into an endless loop.

from dolfin import *
a = 0.001
quader1 = Box(-1, -1, -1, 1, 1, 0)
quader2 = Box(-1, -1, -1, a, a, 0)
mesh = Mesh(quader1 - quader2, 5)
plot(mesh); interactive()
asked Jan 14, 2014 by achim FEniCS Novice (260 points)

For me with a = 0.0

  • DOLFIN 1.2, CGAL 4.2 throws

    StandardError: CGAL ERROR: precondition violation!
    Expr: sp > 0
    File: /usr/local/pkg/cgal/4.2/gnu/include/CGAL/Mesh_3/Protect_edges_sizing_field.h
    Line: 632
    
  • DOLFIN 1.3, CGAL 4.2 hangs

I am wondering how to make this L-shape mesh in 2D.

I am wondering how to make this L-shape mesh in 2D.

Use external mesh generator which is supported by dolfin-convert script.

in 2D the L-shape is as follows and meshing is no problem

from dolfin import *
square1 = Rectangle(-1, -1, 1, 1)
square2 = Rectangle(-1, -1, 0, 0)
mesh = Mesh(square1-square2, 20)

the singular case in 3D is reported above.
When shifting the whole geometry by 1 unit, so the corner comes out of origin, then meshing is no problem:

from dolfin import *
a = 0.0; s = 1.0
quader1 = Box(s-1, s-1, s-1, s+1, s+1, s)
quader2 = Box(s-1, s-1, s-1, s+a, s+a, s)
mesh = Mesh(quader1 - quader2, 10)

Meshing the L-shape is translation invariant. The conditioning issue is a weakness of the algorithm.

1 Answer

–2 votes

Thank you for your answer.
How I can run meshes downloaded from http://fenicsproject.org/download/data.html in FEniCS 1.3? like dolfin_fine.xml.gz

answered Jan 18, 2014 by John1977 FEniCS Novice (250 points)

This is (a) offtopic here, and (b) in no way an answer, and (b) you already opened a question concerning this. Please read the documentation and be specific about your problems if you encounter any. BTW, I extended my answer to your question in the other thread.

...