(x-x1)/(x2-x1) == (y-y1)/(y2=y1) == barycentric coordinate en edge…
load "Element_PkEdge"
mesh Th=square(2,1);
func Tg = [ -N.y,N.x];// Tangente to edge
macro grad(u) [dx(u),dy(u)]//
fespace Wh(Th,P1edge);
Wh b,bb;
// int_E (b) = 0.5 ; on each e edge
// (grad(b).T) = 1 ; on each e edge T the tangent to E
verbosity = 10;
solve ComputeB(b,bb) = intalledges(Th,qforder=1)(b*bb+grad(b)'*grad(bb)) - intalledges(Th,qforder=1)(0.5*bb+Tg'*grad(bb));
plot(b,wait=1);
b give le barycentric on edge if I a make no mistake.
Thank you for you answer,
Your method seems to work in this case, but I don’t understand what “ComputeB(b,bb)”
does. Could you give me more insights about this calculation ?
In more general case, if I do not consider the barycentric coordinate on edge, but I consider
int1d(ThK)(u*P(x,y, [x1,y1], [x2, y2]))
where P is a polynomial which depends on the edge extremities [x1,y1], [x2, y2]). Do you have an idea how to have access at this extremities ? Or may be it will be possible to compute P in the say way that in the method you have proposed.
The method compute a barycentric coordinate on the edge
so b(x,y) is a such that X = b(X)*X2 + (1-b(X))*X1
so you can easily make the change of variable with a other polynom.
Otherwise you can use Pkedge with k = 0 to 5 to set a polynom on each edge
the degre of freedom are the Quadrature point of the Gauss Legendre formulae on [0,1] with k point