From 3b2323bbdcf4f1c29c55576816a69651f958585b Mon Sep 17 00:00:00 2001 From: Manas Rachh Date: Thu, 15 Feb 2024 16:04:56 -0500 Subject: [PATCH] fixing python biharmonic interfaces --- python/fmm2dpy/fmm2d.py | 6 +++--- src/common/cdjseval2d.f | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/python/fmm2dpy/fmm2d.py b/python/fmm2dpy/fmm2d.py index 8939e60..5d9b977 100644 --- a/python/fmm2dpy/fmm2d.py +++ b/python/fmm2dpy/fmm2d.py @@ -1723,7 +1723,7 @@ def comperr(*,ntest,out,outex,pg=0,pgt=0,nd=1,cauchy=0,bh=0): r = r + la.norm(hhex)**2 err = err + la.norm(hhex-h)**2 if(pgt > 0): - if(cauchy==0): + if(cauchy==0 and bh == 0): r = r+la.norm(outex.pottarg[0:ntest])**2 err = err+la.norm(outex.pottarg[0:ntest]-out.pottarg[0:ntest])**2 else: @@ -1764,7 +1764,7 @@ def comperr(*,ntest,out,outex,pg=0,pgt=0,nd=1,cauchy=0,bh=0): if(cauchy==0 and bh==0): g = out.grad[:,:,0:ntest].reshape(2*nd*ntest,) gex = outex.grad[:,:,0:ntest].reshape(2*nd*ntest,) - if(cauchy==0 and bh==1): + elif(cauchy==0 and bh==1): g = out.grad[:,:,0:ntest].reshape(3*nd*ntest,) gex = outex.grad[:,:,0:ntest].reshape(3*nd*ntest,) else: @@ -1794,7 +1794,7 @@ def comperr(*,ntest,out,outex,pg=0,pgt=0,nd=1,cauchy=0,bh=0): if(cauchy==0 and bh==0): g = out.gradtarg[:,:,0:ntest].reshape(2*nd*ntest,) gex = outex.gradtarg[:,:,0:ntest].reshape(2*nd*ntest,) - if(cauchy==0 and bh==1): + elif(cauchy==0 and bh==1): g = out.gradtarg[:,:,0:ntest].reshape(3*nd*ntest,) gex = outex.gradtarg[:,:,0:ntest].reshape(3*nd*ntest,) else: diff --git a/src/common/cdjseval2d.f b/src/common/cdjseval2d.f index 4877f5b..e81c0b9 100644 --- a/src/common/cdjseval2d.f +++ b/src/common/cdjseval2d.f @@ -94,14 +94,14 @@ subroutine jbessel2d(nterms,z,rscale,fjs,ifder,fjder) fjs(0) = done do i = 1, nterms fjs(i) = zero - enddo + enddo c - if (ifder.eq.1) then - do i=0,nterms - fjder(i)=zero - enddo - fjder(1)=done/(2*rscale) - endif + if (ifder.eq.1) then + do i=0,nterms + fjder(i)=zero + enddo + fjder(1)=done/(2*rscale) + endif c RETURN endif @@ -148,7 +148,7 @@ subroutine jbessel2d(nterms,z,rscale,fjs,ifder,fjder) fjtemp(ntop)=zero fjtemp(ntop-1)=done do i=ntop-1,1,-1 - dcoef=2*i + dcoef=2*i ztmp=dcoef*zinv*fjtemp(i)-fjtemp(i+1) fjtemp(i-1)=ztmp c