Skip to content

Commit

Permalink
(ptmass) bug fix in sink potential test
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Jul 13, 2024
1 parent 0f573c6 commit 0ded9ac
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/tests/test_ptmass.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,7 @@ subroutine test_sink_potential(ntests,npass)
rp = 2.
isink_potential = 1
! place a single point mass at a random location
xyzmh_ptmass(:,:) = 0.
xyzmh_ptmass(1:3,1) = x0
xyzmh_ptmass(4,1) = 3.14159
xyzmh_ptmass(ihacc,1) = 0.
Expand All @@ -1155,9 +1156,11 @@ subroutine test_sink_potential(ntests,npass)
xi = x0(1) + 1.00001*rp
yi = x0(2) + 1.*rp
zi = x0(3) + 1.*rp
fxi = 0.; fyi = 0.; fzi = 0.; phi = 0.
call get_accel_sink_gas(nptmass,xi,yi,zi,hi,xyzmh_ptmass,fxi,fyi,fzi,phi)
! evaluate sink-gas acceleration at some position + epsilon
eps = 1.e-6
dumxi = 0.; dumyi = 0.; dumzi = 0.; phi1 = 0.
call get_accel_sink_gas(nptmass,xi+eps,yi,zi,hi,xyzmh_ptmass,dumxi,dumyi,dumzi,phi1)
! get the derivative of phi and check it equals the acceleration
dphidx = -(phi1 - phi)/eps
Expand Down

0 comments on commit 0ded9ac

Please sign in to comment.