[firedrake] problems with importing a mesh

G. D. McBain gdmcbain at protonmail.com
Mon Nov 6 23:21:04 GMT 2017


> Managed I managed to figure it out.  Below is an example where I have a domain with 5 boundaries and I am trying to set the Physical Line like someone suggested.  Does this look right?
>
> If yes, then I think I'm in good shape.  One problem is that the boundary layer is very narrow for my choice of parameters so it's hard to know whether the boundary value is really zero.  I don't suppose there is an easy way to find out the maximum of the boundary value in the numerical solution?
>
> element_size = 0.05;
> // Printing points from 1 to 6.
> Point(1) = {-0.000000, -0.000000, 0, element_size};
> Point(2) = {4.27, 0.54, 0, element_size};
> Point(3) = {2.98, 4.00, 0, element_size};
> Point(4) = {0.50, 3.58, 0, element_size};
> Point(5) = {-1.70, 1.33, 0, element_size};
>
> // Printing Spline points 1 to 6.
> Line(1) = {1,2};
> Line(2) = {2,3};
> Line(3) = {3,4};
> Line(4) = {4,5};
> Line(5) = {5,1};
>
> // Printing line loop from spline 1 to 2
> Line Loops(1) = {1,2,3,4,5};
>
> Plane Surface(6) = {1};
> Physical Surface(7) = {6};
> Physical Line(8) = {1};

Hello.  Yes, sorry about the PEP 3107 function annotations (I fell for these immediately they were released)

https://www.python.org/dev/peps/pep-3107/

and yes, it's Physical Line that's wanted for boundary conditions in two-dimensional problems.

However, I'm sorry I don't know any answer to your question about how to find extrema on boundaries in Firedrake, but I would like to know that too.

I do know a couple of tricks for extracting that information in FreeFem++:
* the dirty trick of evaluating a line integral over the boundary patch with the integrand being an impure function that remembers the highest value it has seen and returns an irrelevant value, especially used with a quadrature rule with abscissæ at the nodes;
* a technical trick using the machinery for imposing Dirichlet conditions by penalization
http://www.um.es/freefem/ff++/pmwiki.php?n=Main.ExtractTheDofsOnAPieceOfBoundary

The latter might be a bit specific to the implementation to port to Firedrake, the former I'd rather avoid if there were a proper way to do it in Firedrake, if anyone knows how, but I can't help you myself just yet.

If you know where the boundary is geometrically and can independently generate a list of coordinate-points on it, you can use the .at method of point-evaluation.

[http://www.firedrakeproject.org/point-evaluation.html](http://www.firedrakeproject.org/point-evaluation.html?highlight=values)

I guess the operation of finding extrema of finite element functions on the mesh is not really in the spirit of the finite element method, which is why it's awkward.  The method is more about evaluating functionals.

The FEniCS Q&A has the same query and an equally awkward procedure.  That one might be portable to Firedrake.

https://fenicsproject.org/qa/3074/get-function-values-on-boundaries

Kind regards,
Geordie McBain
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the firedrake mailing list