Skip to content

Commit 56e4a2a

Browse files
authored
Revert "Update Particle Container to Pure SoA (#3850)" (#4652)
This reverts commit 94ae119.
1 parent 2708b4f commit 56e4a2a

File tree

53 files changed

+709
-661
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

+709
-661
lines changed

Docs/source/usage/workflows/python_extend.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ 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_real_arrays()``, ``get_particle_int_arrays()`` and
256-
``get_particle_idcpu_arrays()`` functions are called
255+
The ``get_particle_structs()`` and ``get_particle_arrays()`` functions are called
257256
by several utility functions of the form ``get_particle_{comp_name}`` where
258257
``comp_name`` is one of ``x``, ``y``, ``z``, ``r``, ``theta``, ``id``, ``cpu``,
259258
``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') == 2)
157-
assert (elec_wrapper.particle_container.get_comp_index('newPid') == 6)
156+
assert (elec_wrapper.particle_container.get_comp_index('w') == 0)
157+
assert (elec_wrapper.particle_container.get_comp_index('newPid') == 4)
158158

159-
new_pid_vals = elec_wrapper.get_particle_real_arrays('newPid', 0)
159+
new_pid_vals = elec_wrapper.get_particle_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') == 6)
124-
assert (elec_wrapper.particle_container.get_comp_index('prev_z') == 7)
123+
assert (elec_wrapper.particle_container.get_comp_index('prev_x') == 4)
124+
assert (elec_wrapper.particle_container.get_comp_index('prev_z') == 5)
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_real_arrays('prev_z', 0)
128+
prev_z_vals = elec_wrapper.get_particle_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") == 2
162-
assert electron_wrapper.particle_container.get_comp_index("newPid") == 6
161+
assert electron_wrapper.particle_container.get_comp_index("w") == 0
162+
assert electron_wrapper.particle_container.get_comp_index("newPid") == 4
163163

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

0 commit comments

Comments
 (0)