// Usage: /* extract the list of degre of freedom of 2d finite elemnt on connect boundary given by a list of label or on label the list is sort in direction of the +/- tangent the orientation 1: direct or -1 clockwise The parameter are: - labs : int[int] ou int to defined the boundary (in) - Wh the fespace (in) - int[int] doflabs (resize array) (out) - int orient : orientation of the border direct (1) or in direct -1 (in) */ macro ExtractDofsonBorder(labs,Wh,doflabs,orient) { mesh Th=Wh.Th; fespace VhExtractDofsonBorder(Th,P1); VhExtractDofsonBorder abslabs,onlon,atest; real lenborder = int1d(Th,labs,qfe=qf1pElump)(1.); if( lenborder >0) { if(orient) solve Pbabciss(abslabs,atest,solver=GMRES) = int2d(Th,qft=qf1pTlump)(abslabs*atest*1e-8/area) + int1d(Th,labs,qfe=qf1pElump)([dx(abslabs),dy(abslabs)]'*[-N.y,+N.x]*atest) - int1d(Th,labs,qfe=qf1pElump)(orient*atest); else abslabs= 1.; /* no sorting*/ real abslabsmax = abs(2*abslabs[].max); varf vlabsneg(u,v) = on(labs,u=abslabs-abslabsmax); if(0) plot(abslabs,wait=1); real[int] absc=vlabsneg(0,Wh); doflabs.resize(Wh.ndof); doflabs=0:Wh.ndof-1; sort(absc,doflabs); absc= absc? 1:0; doflabs.resize(absc.sum+0.5); } else doflabs.resize(0); } //