Skip to content

Commit

Permalink
Fix breaking API change
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiLehe committed Sep 24, 2024
1 parent bdd5bc8 commit 2fea46a
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def correct_space_charge_fields(self, q=None):

# Correct fields so as to recover the actual charge
# TODO: add guard cells
Er = sim.extension.warpx.multifab("Efield_fp[x][level=0]")
Er = sim.extension.warpx.multifab("Efield_fp[x]", 0)
Er.saxpy(Er, (q - q_v), self.normalized_Er, 0, 0, 1, 0)
Ez = sim.extension.warpx.multifab("Efield_fp[z][level=0]")
Ez = sim.extension.warpx.multifab("Efield_fp[z]", 0)
Ez.saxpy(Ez, (q - q_v), self.normalized_Ez, 0, 0, 1, 0)
phi = PhiFPWrapper(include_ghosts=True)
phi[...] += (q - q_v) * self.normalized_phi
Expand Down Expand Up @@ -81,13 +81,9 @@ def save_normalized_vacuum_Efields(

# Record fields
# TODO: add guard cells
self.normalized_Er = sim.extension.warpx.multifab(
"Efield_fp[x][level=0]"
).copy()
self.normalized_Er = sim.extension.warpx.multifab("Efield_fp[x]", 0).copy()
self.normalized_Er.mult(1 / q_v, 0)
self.normalized_Ez = sim.extension.warpx.multifab(
"Efield_fp[z][level=0]"
).copy()
self.normalized_Ez = sim.extension.warpx.multifab("Efield_fp[z]", 0).copy()
self.normalized_Ez.mult(1 / q_v, 0)
phi = PhiFPWrapper(include_ghosts=True)[:, :]
self.normalized_phi = phi[...] / q_v
Expand Down

0 comments on commit 2fea46a

Please sign in to comment.