Skip to content

Commit

Permalink
Import Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored Aug 23, 2023
1 parent 876b6aa commit 81afc0e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Python/pywarpx/particle_containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,8 @@ def get_particle_boundary_buffer(self, species_name, boundary, comp_name, level)
level : int
Which AMR level to retrieve scraped particle data from.
'''
xp, cupy_status = load_cupy()

part_container = self.particle_buffer.get_particle_container(
species_name, self._get_boundary_number(boundary)
)
Expand All @@ -584,14 +586,14 @@ def get_particle_boundary_buffer(self, species_name, boundary, comp_name, level)
comp_idx = part_container.num_int_comps() - 1
for ii, pti in enumerate(libwarpx.libwarpx_so.BoundaryBufferParIter(part_container, level)):
soa = pti.soa()
data_array.append(cnp.array(soa.GetIntData(comp_idx), copy=False))
data_array.append(xp.array(soa.GetIntData(comp_idx), copy=False))
else:
mypc = libwarpx.warpx.multi_particle_container()
sim_part_container_wrapper = mypc.get_particle_container_from_name(species_name)
comp_idx = sim_part_container_wrapper.get_comp_index(comp_name)
for ii, pti in enumerate(libwarpx.libwarpx_so.BoundaryBufferParIter(part_container, level)):
soa = pti.soa()
data_array.append(cnp.array(soa.GetRealData(comp_idx), copy=False))
data_array.append(xp.array(soa.GetRealData(comp_idx), copy=False))

return data_array

Expand Down

0 comments on commit 81afc0e

Please sign in to comment.