subroutine potent(x,y,th,curv,vf,n,dcut) * ******************************************************* * obtain the normal velocity of the fluid at the interface * (x(i),y(i),i=0,...,n) : the collection of equal-distanced * points; * (th(i),curv(i),i=0,...,n): the tangent angles, and * curvatures of these points. * (vf(i),i=0,...,n): the inward normal velocity of the fluid. * * alternative points are used to discretize the integral and * the singular limit of the integrand is not needed. * ******************************************************* integer n,i,j double precision x(0:8192),y(0:8192),th(0:8192), + curv(0:8192),vf(0:8192) double precision st,ct,rsq,dlg,sa,coef1,dcut,sum common/darcyc/coef1 common/salpha/sa * for odd numbered points: do 10 i=1,n-1,2 vf(i) = 0.D0 st = dsin(th(i)) ct = dcos(th(i)) do 15 j=2,n,2 rsq = (x(i)-x(j))**2 + (y(i)-y(j))**2 dlg = (x(i)-x(j))*st - (y(i)-y(j))*ct vf(i) = vf(i) + dlg*dcos(th(j))/rsq 15 continue vf(i) = coef1*(2.D0*sa*vf(i)/dfloat(n) + 0.5D0*ct) 10 continue * for even numbered points: do 20 i=2,n,2 vf(i) = 0.D0 st = dsin(th(i)) ct = dcos(th(i)) do 25 j=1,n-1,2 rsq = (x(i)-x(j))**2 + (y(i)-y(j))**2 dlg = (x(i)-x(j))*st - (y(i)-y(j))*ct vf(i) = vf(i) + dlg*dcos(th(j))/rsq 25 continue vf(i) = coef1*(2.D0*sa*vf(i)/dfloat(n) + 0.5D0*ct) 20 continue vf(0) = vf(n) * check the sum of vf: sum = 0.D0 do 40 j=1,n sum = sum + vf(j) 40 continue do 50 j=0,n vf(j) = vf(j) - sum/dfloat(n) 50 continue * ************************************* call kfilter(n,dcut,vf) end