2014-11-06 15:13 GMT+01:00 Henrik Garde <[email protected]>: > _______________________________________ > Fra: [email protected] [[email protected]] på vegne af > Johannes Ring [[email protected]] > Sendt: 5. november 2014 11:21 > Til: Benjamin Kehlet > Cc: Henrik Garde; [email protected] > Emne: Re: [FEniCS-support] dolfin from PPA is not compiled with CGAL > > On Wed, Nov 5, 2014 at 11:08 AM, Benjamin Kehlet <[email protected]> wrote: >> 2014-11-05 9:47 GMT+01:00 Johannes Ring <[email protected]>: >>> On Tue, Nov 4, 2014 at 6:33 PM, Henrik Garde <[email protected]> wrote: >>>> The newest version of Dolfin 1.4 in the fenics PPA for Ubuntu 14.04 does >>>> not seem to be compiled with CGAL (worked fine before an update today). >>> >>> Yes, CGAL support was disabled in favor of mshr: >>> >>> https://bitbucket.org/benjamik/mshr/wiki/Home >>> >>>>> has_cgal() >>>> False >>>> >>>> This prevents for instance the use of CircleMesh, and gives the error: >>>> >>>> Traceback (most recent call last): >>>> File "<stdin>", line 1, in <module> >>>> File "/usr/lib/python2.7/dist-packages/dolfin/cpp/mesh.py", line 8006, >>>> in __init__ >>>> _mesh.CircleMesh_swiginit(self,_mesh.new_CircleMesh(*args)) >>>> RuntimeError: >>> >>> With mshr you can create a circle mesh for instance like this: >>> >>> import dolfin >>> from mshr import * >>> mesh = generate_mesh(Circle(dolfin.Point(0, 0), 1), 32) >>> dolfin.plot(mesh, interactive=True) >>> > > This code definitely generates a mesh, thank you. > > However the boundary of the circle seems to be poorly approximated, at first > glance (even for a very fine mesh) the boundary looks like a 32-sided > polygon, and integration along the boundary also confirms this: > > mesh = generate_mesh(Circle(Point(0, 0), 1), 200) > V = FunctionSpace(mesh,'CG',1) > print abs(2*pi - assemble(interpolate(Constant(1.0),V)*ds)) > > returns 0.0100883260877 > > This discrepancy does not decrease with a higher number N in the > generate_mesh(... , N). I do not recall the old CircleMesh having this > problem, and it seems problematic in terms of solving boundary value problems.
That is true. What is being meshed is actually a polygon with (by default) 32 sides. I'm working on choosing this number based on the meshing criteria (the requested cell size), but this code has not been pushed yet. To work around this, add a third argument to the constructor of Circle which is the number of sides, eg. mesh = generate_mesh(Circle(Point(0, 0), 1, 64), 200) Benjamin > > >>> @Benjamin: Will CircleMesh be available in mshr to make it more >>> backwards compatible with older DOLFIN? >> >> Not currently, but it would be easy to add. I guess there was a >> SphereMesh in Dolfin as well? Anything else? > > Yes, in addition to CircleMesh and SphereMesh, it was also at least > EllipseMesh and EllipsoidMesh. > > Johannes > >> Benjamin >> >>> >>> Johannes >>> >>>> *** >>>> ------------------------------------------------------------------------- >>>> *** DOLFIN encountered an error. If you are not able to resolve this issue >>>> *** using the information listed below, you can ask for help at >>>> *** >>>> *** [email protected] >>>> *** >>>> *** Remember to include the error message listed below and, if possible, >>>> *** include a *minimal* running example to reproduce the error. >>>> *** >>>> *** >>>> ------------------------------------------------------------------------- >>>> *** Error: Unable to generate ellipse mesh. >>>> *** Reason: Generation of ellipse meshes requires DOLFIN to be configured >>>> with CGAL. >>>> *** Where: This error was encountered inside EllipseMesh.cpp. >>>> *** Process: unknown >>>> *** >>>> *** DOLFIN version: 1.4.0 >>>> *** Git changeset: unknown >>>> *** >>>> ------------------------------------------------------------------------- >>>> _______________________________________________ >>>> fenics-support mailing list >>>> [email protected] >>>> http://fenicsproject.org/mailman/listinfo/fenics-support _______________________________________________ fenics-support mailing list [email protected] http://fenicsproject.org/mailman/listinfo/fenics-support
