Skip to content

Commit 6b3afd0

Browse files
committed
Fix doping
1 parent da73c2b commit 6b3afd0

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tidy3d/components/tcad/doping.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ def _get_contrib(self, coords: dict, meshgrid: bool = True):
190190

191191
indices_in_box, X, Y, Z = self._get_indices_in_box(coords=coords, meshgrid=meshgrid)
192192

193-
x_contrib = np.ones(X.shape)
193+
x_contrib = np.zeros(X.shape)
194+
x_contrib[indices_in_box] = 1.0
194195
if self.source != "xmin":
195196
x0 = self.bounds[0][0]
196197
indices = np.logical_and(x0 <= X, x0 + self.width >= X)
@@ -215,7 +216,8 @@ def _get_contrib(self, coords: dict, meshgrid: bool = True):
215216
/ self.sigma
216217
)
217218

218-
y_contrib = np.ones(X.shape)
219+
y_contrib = np.zeros(X.shape)
220+
y_contrib[indices_in_box] = 1.0
219221
if self.source != "ymin":
220222
y0 = self.bounds[0][1]
221223
indices = np.logical_and(y0 <= Y, y0 + self.width >= Y)
@@ -240,7 +242,8 @@ def _get_contrib(self, coords: dict, meshgrid: bool = True):
240242
/ self.sigma
241243
)
242244

243-
z_contrib = np.ones(X.shape)
245+
z_contrib = np.zeros(X.shape)
246+
z_contrib[indices_in_box] = 1.0
244247
if self.source != "zmin":
245248
z0 = self.bounds[0][2]
246249
indices = np.logical_and(z0 <= Z, z0 + self.width >= Z)

0 commit comments

Comments
 (0)