Skip to content

Commit 42f07cf

Browse files
committed
ElectromagneticPIC: fix bug defining pidx
1 parent 873a397 commit 42f07cf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ExampleCodes/Particles/ElectromagneticPIC/Source/EMParticleContainerInit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ InitParticles(const IntVect& a_num_particles_per_cell,
140140
unsigned int uiz = amrex::min(nz-1,amrex::max(0,iz));
141141
unsigned int cellid = (uix * ny + uiy) * nz + uiz;
142142

143-
int pidx = poffset[cellid] - poffset[0];
143+
int pidx = poffset[cellid] + old_size;
144144

145145
for (int i_part=0; i_part<num_ppc;i_part++)
146146
{

0 commit comments

Comments
 (0)