Segfault when meshing a difference
I am experiencing a segfault when trying to generate_mesh
on a difference. Here is a snippet
mshr::Rectangle channel(Point(0,0,0),Point(L,H,0));
mshr::Circle obstacle(Point(xc,yc,0),r);
std::shared_ptr<mshr::CSGDifference> shedding = channel - obstacle;
std::shared_ptr<Mesh> mesh = mshr::generate_mesh(*shedding,resolution);
Meshing channel
or obstacle
works fine.
Comments (8)
-
-
Following code also segfaults with current master (02ffef1bbfce52721bae920de7d362ac4e4b57dd)
from dolfin import * import mshr center = Point(0.2, 0.2) radius = 0.05 L = 2.2 W = 0.41 geometry = mshr.Rectangle(Point(0.0, 0.0), Point(L, W)) \ - mshr.Circle(center, radius, 40) mesh = mshr.generate_mesh(geometry, 50)
-
Account Deleted reporter Is that Turek's benchmark? That's the same I was trying :D
-
Sure:D We have used it in an introductory FEniCS tutorial.
-
Account Deleted reporter @blechta your code crashes because the radius is too big. I set it to 10 and it works on my machine. Also the code from the tutorial works just fine. It's quite odd that the C++ version is broken and the Python one is not :S
-
Account Deleted reporter Sorry, not the radius, the third parameter, the segment number for the circle :D I put it to 10 and it worked.
My code also seems to be working now, so the bug must be somewhere related to that third parameter. With 10 it works fine, but the default value is already enough to make it crash.
-
- changed status to resolved
Merge branch 'benjamik/fix-issue-37'. Fixes issue
#37.→ <<cset 3b41e7b4b7ec>>
-
Account Deleted reporter Fix confirmed, thanks!
- Log in to comment
Confirmed. Thanks for reporting!
I don't have time until Thursday or Friday this week, but I will take a look then.