Hi Ed, I think that the answer to both of your questions is: x = SpatialCoordinate(mesh). x is then a symbolic representation of the coordinate vector. You can use x in any UFL expression, including for boundary conditions. In the case of your second question, you could use. It in either an interpolation or a projection: W = interpolate(w(x), fs) or W = project(w(x), fs) Where w(x) is a UFL expression in x (or a python function returning such an expression) and fs is the FunctionSpace you want to interpolate into. Regards, David Dr David Ham Department of Mathematics Imperial College London
On 10 May 2018, at 07:55, Ed Bueler <elbueler@alaska.edu> wrote:
Dear Firedrake --
I have two questions related to mesh coordinates and boundaries:
1) How does one get the coordinates of the points on a boundary? That is, suppose I know the id number of that part, for example "id" as in "ds(id)" used in forming boundary terms in the weak form. What is the corresponding idiom for getting the spatial coordinates? Something like "mesh.coordinates(id)" (though that does not work)? In parallel I guess this function will only be defined on a subset of the processors?
2) Given a function along a boundary, how does one extend that to the whole mesh, by holding constant in one variable? In the case I care about the domain is of the special form D = {(x,y) | f(x) < y < g(x)} and one has values w(x) along the y=g(x) boundary. How does one build a Function on the whole mesh which is W(x,y) = w(x) (I understand that my domain is special, namely logically rectangular. And I can imagine an answer specific to an extruded mesh ... but I would like to not go there now.) Again I am interested in a solution which works in parallel. Maybe I have to commit to solving a first-order PDE just to do this?
Thanks for your help with my questions so far!
Ed
-- Ed Bueler Dept of Math and Stat and Geophysical Institute University of Alaska Fairbanks Fairbanks, AK 99775-6660 301C Chapman _______________________________________________ firedrake mailing list firedrake@imperial.ac.uk https://mailman.ic.ac.uk/mailman/listinfo/firedrake