Skip to content

Commit

Permalink
Merge pull request #4 from ChristopherMayes/master
Browse files Browse the repository at this point in the history
Add small padding in charge deposition
  • Loading branch information
ChristopherMayes authored Apr 11, 2021
2 parents 785262a + 76e6d7d commit 78e5537
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions code/open_spacecharge_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,13 @@ subroutine deposit_particles(xa, ya, za, mesh3d, qa, total_charge, resize_mesh)
if (resize) then
min = [minval(xa), minval(ya), minval(za)]
max = [maxval(xa), maxval(ya), maxval(za)]
delta =(max(:) - min(:) ) / (mesh3d%nhi(:) - mesh3d%nlo(:) + 1)
! Pad by by 1.1 bins
pad = delta*1.1
min = min !- pad
max = max + pad
delta =(max(:) - min(:) ) / (mesh3d%nhi(:) - mesh3d%nlo(:) + 1)

delta =(max(:) - min(:) ) / (mesh3d%nhi(:) - mesh3d%nlo(:) )

! Small padding to protect against indexing errors
min = min - 1.0e-6_dp*delta
max = max + 1.0e-6_dp*delta
delta =(max(:) - min(:) ) / (mesh3d%nhi(:) - mesh3d%nlo(:) )
mesh3d%min = min
mesh3d%max = max
mesh3d%delta = delta
Expand Down

0 comments on commit 78e5537

Please sign in to comment.