Skip to content

Commit 3c2edd3

Browse files
committed
Add small quantity to avoid zero division
(cherry picked from commit 925f3e4)
1 parent 0074bae commit 3c2edd3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

simpeg/electromagnetics/static/resistivity/simulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def setBC(self):
606606
# TODO: Implement Zhang et al. (1995)
607607

608608
r_vec = boundary_faces - source_point
609-
r = np.linalg.norm(r_vec, axis=-1)
609+
r = np.linalg.norm(r_vec, axis=-1) + 1e-12
610610
r_hat = r_vec / r[:, None]
611611
r_dot_n = np.einsum("ij,ij->i", r_hat, boundary_normals)
612612

0 commit comments

Comments
 (0)