[firedrake] problems with importing a mesh
G. D. McBain
gdmcbain at protonmail.com
Fri Nov 3 06:09:49 GMT 2017
> I am curious to see what you find does the trick.
It seems that my warning was obsolete. Whereas, I find from my old notes, that failure label each part of the boundary in Gmsh raised:
AssertionError: Every marker has to be contained in unique_markers
and in Feb. 2016, L. M. wrote: ‘If you provide a marker for one of the external boundaries of your mesh, you need to do so for all of them.’
https://mailman.ic.ac.uk/mailman/htdig/firedrake/2016-February/001809.html
I find today that this isn't the case. I hadn't noticed this being fixed as I'd simply complied by labelling everything. Anyway thank you to whoever fixed that, in Firedrake or upstream.
> As for my coastline problem, the good news is that I can now import the geometry. The bad news is that when I solve the weak for of the PDE it does not impose the Dirichlet BCs.
So to satisfy myself of the above, I prepared a simple example with a Dirichlet condition on part of the boundary and natural conditions on the rest. The same technique might work for your problem.
Consider the plane Poisson equation with constant unit forcing on a circle with homogeneous Dirichlet conditions, but exploiting two lines of symmetry using just a quadrant with natural conditions on the two radii. The exact answer on the circle is that the integral of the solution divided by the square of the area should be 1/8 pi, or four times on the quarter-model, so 1/2pi.
%<---quadrant.geo
Point(1) = {1, 0, 0, 1.0};
Point(2) = {0, 0, 0, 1.0};
Point(3) = {0, 1, 0, 1.0};
Circle(1) = {1, 2, 3};
Line(2) = {3, 2};
Line(3) = {2, 1};
Line Loop(1) = {1, 2, 3};
Plane Surface(1) = {1};
Physical Surface("membrane", 2) = {1};
Physical Line("rim", 1) = {1};
--->%
Note that the last line specifies the quarter-circle perimeter from "Circle(1)" but not the radii of symmetry "Line(2)" or "Line(3)".
The Dirichlet boundary condition is imposed on the perimeter of the circle using "[1]" for the 1 of the Physical Line:
bc = DirichletBC(V, 0.0, [1])
Running this with
$ gmsh -2 -clscale 6.25e-2 quadrant.geo
$ python membrane.py quadrant.msh
I get 0.15905285125 which is 1/2 pi to four decimal places.
-------------- next part --------------
HTML attachment scrubbed and removed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: quadrant.geo
Type: application/vnd.dynageo
Size: 263 bytes
Desc: not available
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20171103/71e49b98/attachment.geo>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: membrane.py
Type: text/x-python
Size: 825 bytes
Desc: not available
URL: <http://mailman.ic.ac.uk/pipermail/firedrake/attachments/20171103/71e49b98/attachment.py>
More information about the firedrake
mailing list