Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gauge invariant Helicity] Out of bounds indexing corrected #213

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ci/G1V03L2Fi/compare.h5
Binary file not shown.
Binary file modified ci/G2V32L1Fi/compare.h5
Binary file not shown.
Binary file modified ci/G3V08L3Fi/compare.h5
Binary file not shown.
Binary file modified ci/G3V08L3Fr/compare.h5
Binary file not shown.
Binary file modified ci/toroidal_freeboundary_vacuum/compare.h5
Binary file not shown.
34 changes: 20 additions & 14 deletions src/mp00ac.f90
Original file line number Diff line number Diff line change
Expand Up @@ -532,28 +532,34 @@ subroutine mp00ac( Ndof, Xdof, Fdof, Ddof, Ldfjac, iflag ) ! argument list is fi


! if (GaugeInvariantH) then
dH1 = zero
dH2 = zero
do ll = 0, Lrad(lvol)
! ideriv=0 mn=0
id = Ate(lvol,0 , 1)%i(ll)
if (Lcoordinatesingularity) then
call get_zernike_d2(small, Lrad(lvol), mpol, zernike)
dH1 = dH1 + pi2 * solution(id,0) * zernike(ll,0,0)
else
call get_cheby_d2(-one+small, Lrad(lvol), cheby(0:Lrad(lvol),0:2))
dH1 = dH1 + pi2 * solution(id,0) * cheby(ll,0)
if (id/=0) then ! Indirection maps some elements to 0, to "discard" them during matrix construction. Ignore them here.
if (Lcoordinatesingularity) then
call get_zernike_d2(small, Lrad(lvol), mpol, zernike)
dH1 = dH1 + pi2 * solution(id,0) * zernike(ll,0,0)
else
call get_cheby_d2(-one+small, Lrad(lvol), cheby(0:Lrad(lvol),0:2))
dH1 = dH1 + pi2 * solution(id,0) * cheby(ll,0)
endif
endif

! ideriv=0 mn=0
id = Aze(lvol,0 , 1)%i(ll)
if (Lcoordinatesingularity) then
call get_zernike_d2(one, Lrad(lvol), mpol, zernike)
dH2 = dH2 + pi2 * solution(id,0) * zernike(ll,0,0)
else
call get_cheby_d2(one, Lrad(lvol), cheby(0:Lrad(lvol),0:2))
dH2 = dH2 + pi2 * solution(id,0) * cheby(ll,0)
if (id/=0) then ! Indirection maps some elements to 0, to "discard" them during matrix construction. Ignore them here.
if (Lcoordinatesingularity) then
call get_zernike_d2(one, Lrad(lvol), mpol, zernike)
dH2 = dH2 + pi2 * solution(id,0) * zernike(ll,0,0)
else
call get_cheby_d2(one, Lrad(lvol), cheby(0:Lrad(lvol),0:2))
dH2 = dH2 + pi2 * solution(id,0) * cheby(ll,0)
endif
endif
enddo

lABintegral(lvol) = lABintegral(lvol) - dH1 - dH2
! endif

Expand Down
Loading