Skip to content

Commit 94ae119

Browse files
ax3latmyers
andauthored
Update Particle Container to Pure SoA (#3850)
* Update Particle Container to Pure SoA Transition particle containers to pure SoA layouts. * Python: Pure SoA Particle * Update Particle Container to Pure SoA Transition particle containers to pure SoA layouts. * Python: Pure SoA Particle * fix a couple of places where we underflow the particle idcpu * fixed bad merge * fix bad merge again * Update Particle Container to Pure SoA Transition particle containers to pure SoA layouts. * Python: Pure SoA Particle * skip positions for pure SoA plotfiles * Update Particle Container to Pure SoA Transition particle containers to pure SoA layouts. Co-authored-by: Andrew Myers <atmyers@lbl.gov> * Python: Pure SoA Particle * correctly account for positions in restart --------- Co-authored-by: Andrew Myers <atmyers2@gmail.com> Co-authored-by: Andrew Myers <atmyers@lbl.gov>
1 parent c1533a9 commit 94ae119

File tree

53 files changed

+661
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+661
-709
lines changed

Docs/source/usage/workflows/python_extend.rst

+2-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ Particles can be added to the simulation at specific positions and with specific
252252
.. autoclass:: pywarpx.particle_containers.ParticleContainerWrapper
253253
:members:
254254

255-
The ``get_particle_structs()`` and ``get_particle_arrays()`` functions are called
255+
The ``get_particle_real_arrays()``, ``get_particle_int_arrays()`` and
256+
``get_particle_idcpu_arrays()`` functions are called
256257
by several utility functions of the form ``get_particle_{comp_name}`` where
257258
``comp_name`` is one of ``x``, ``y``, ``z``, ``r``, ``theta``, ``id``, ``cpu``,
258259
``weight``, ``ux``, ``uy`` or ``uz``.

Examples/Tests/particle_data_python/PICMI_inputs_2d.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ def add_particles():
153153
##########################
154154

155155
assert (elec_wrapper.nps == 270 / (2 - args.unique))
156-
assert (elec_wrapper.particle_container.get_comp_index('w') == 0)
157-
assert (elec_wrapper.particle_container.get_comp_index('newPid') == 4)
156+
assert (elec_wrapper.particle_container.get_comp_index('w') == 2)
157+
assert (elec_wrapper.particle_container.get_comp_index('newPid') == 6)
158158

159-
new_pid_vals = elec_wrapper.get_particle_arrays('newPid', 0)
159+
new_pid_vals = elec_wrapper.get_particle_real_arrays('newPid', 0)
160160
for vals in new_pid_vals:
161161
assert np.allclose(vals, 5)
162162

Examples/Tests/particle_data_python/PICMI_inputs_prev_pos_2d.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@
120120
elec_count = elec_wrapper.nps
121121

122122
# check that the runtime attributes have the right indices
123-
assert (elec_wrapper.particle_container.get_comp_index('prev_x') == 4)
124-
assert (elec_wrapper.particle_container.get_comp_index('prev_z') == 5)
123+
assert (elec_wrapper.particle_container.get_comp_index('prev_x') == 6)
124+
assert (elec_wrapper.particle_container.get_comp_index('prev_z') == 7)
125125

126126
# sanity check that the prev_z values are reasonable and
127127
# that the correct number of values are returned
128-
prev_z_vals = elec_wrapper.get_particle_arrays('prev_z', 0)
128+
prev_z_vals = elec_wrapper.get_particle_real_arrays('prev_z', 0)
129129
running_count = 0
130130

131131
for z_vals in prev_z_vals:

Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,10 @@ def add_particles():
158158
##########################
159159

160160
assert electron_wrapper.nps == 90
161-
assert electron_wrapper.particle_container.get_comp_index("w") == 0
162-
assert electron_wrapper.particle_container.get_comp_index("newPid") == 4
161+
assert electron_wrapper.particle_container.get_comp_index("w") == 2
162+
assert electron_wrapper.particle_container.get_comp_index("newPid") == 6
163163

164-
new_pid_vals = electron_wrapper.get_particle_arrays("newPid", 0)
164+
new_pid_vals = electron_wrapper.get_particle_real_arrays("newPid", 0)
165165
for vals in new_pid_vals:
166166
assert np.allclose(vals, 5)
167167

0 commit comments

Comments
 (0)