Skip to content

Commit abec5aa

Browse files
committed
Robust interpolation for ShortleyWeller
for particles "on" the border of the chamber.
1 parent a160d29 commit abec5aa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

interp_field_for_with_border.f

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,14 @@ subroutine int_field_border(N_mp,xn,yn, bias_x,bias_y, dx,dy,
8888
Ey_n(p) = Ey_n(p) + efy((i+1),(j+1))*wei_i1j1;
8989

9090
if (anyexternal .eqv. .true.) then
91+
if ((wei_ij+wei_i1j+wei_ij1+wei_i1j1)>0.) then
9192
fact_correct = 1./(wei_ij+wei_i1j+wei_ij1+wei_i1j1)
9293
Ex_n(p) = Ex_n(p)*fact_correct
9394
Ey_n(p) = Ey_n(p)*fact_correct
95+
else
96+
Ex_n(p) = 0.
97+
Ey_n(p) = 0.
98+
end if
9499
end if
95100

96101
end if

0 commit comments

Comments
 (0)