Skip to content

Commit 5e79349

Browse files
authored
ElectromagneticPIC: fix bug defining pidx (#158)
1 parent 873a397 commit 5e79349

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)