Skip to content

Commit

Permalink
Use MF.size
Browse files Browse the repository at this point in the history
Until we add `__len__` via
AMReX-Codes/pyamrex#407
  • Loading branch information
ax3l committed Jan 25, 2025
1 parent 1fb24d9 commit 1f9db1f
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ def compute_virtual_charge_on_spacecraft():
dr, dz = sim.extension.warpx.Geom(lev=0).data().CellSize()

# Compute integral of grad phi over surfaces of the domain
r = np.linspace(rmin, rmax, len(phi), endpoint=False) + (rmax - rmin) / (
2 * len(phi)
n_blocks = phi.size
r = np.linspace(rmin, rmax, n_blocks, endpoint=False) + (rmax - rmin) / (
2 * n_blocks
) # shift of the r points because the derivaties are calculated in the middle
face_z0 = (
2 * np.pi * 1.0 / dz * ((phi[:, 0] - phi[:, 1]) * r).sum() * dr
Expand Down

0 comments on commit 1f9db1f

Please sign in to comment.