aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Revathi Jambunathan <41089244+RevathiJambunathan@users.noreply.github.com> 2022-08-05 22:45:50 -0700
committerGravatar GitHub <noreply@github.com> 2022-08-05 22:45:50 -0700
commit2bdde39f03219c1b090a0ff88e26fed09aae0817 (patch)
tree8d14821861ca2b273f64ba939493d8be129822de
parent4f88c5b85e6de10ea51c3bd146f5ba5aaa6d5cec (diff)
downloadWarpX-2bdde39f03219c1b090a0ff88e26fed09aae0817.tar.gz
WarpX-2bdde39f03219c1b090a0ff88e26fed09aae0817.tar.zst
WarpX-2bdde39f03219c1b090a0ff88e26fed09aae0817.zip
Use extended box array in setting par GDB for BTD (#3285)
* uise extended box array in setting par GDB for BTD * add synchronize in BTD particle functor
-rw-r--r--Source/Diagnostics/BTDiagnostics.cpp8
-rw-r--r--Source/Diagnostics/ComputeDiagFunctors/BackTransformParticleFunctor.cpp1
2 files changed, 5 insertions, 4 deletions
diff --git a/Source/Diagnostics/BTDiagnostics.cpp b/Source/Diagnostics/BTDiagnostics.cpp
index d6d4a249a..b00b88e31 100644
--- a/Source/Diagnostics/BTDiagnostics.cpp
+++ b/Source/Diagnostics/BTDiagnostics.cpp
@@ -744,10 +744,6 @@ BTDiagnostics::Flush (int i_buffer)
vrefratio.push_back(m_particles_buffer[i_buffer][0]->GetParGDB()->refRatio(lev));
}
}
- for (int isp = 0; isp < m_particles_buffer.at(i_buffer).size(); ++isp) {
- // BTD output is single level. Setting particle geometry, dmap, boxarray to level0
- m_particles_buffer[i_buffer][isp]->SetParGDB(vgeom[0], vdmap[0], vba[0]);
- }
// Redistribute particles in the lab frame box arrays that correspond to the buffer
// Prior to redistribute, increase buffer box and Box in ParticleBoxArray by 1 index in the
// lo and hi-end, so particles can be binned in the boxes correctly.
@@ -761,6 +757,10 @@ BTDiagnostics::Flush (int i_buffer)
amrex::BoxArray buffer_ba( particle_buffer_box );
buffer_ba.maxSize(m_max_box_size*2);
m_particles_buffer[i_buffer][0]->SetParticleBoxArray(0, buffer_ba);
+ for (int isp = 0; isp < m_particles_buffer.at(i_buffer).size(); ++isp) {
+ // BTD output is single level. Setting particle geometry, dmap, boxarray to level0
+ m_particles_buffer[i_buffer][isp]->SetParGDB(vgeom[0], vdmap[0], buffer_ba);
+ }
}
RedistributeParticleBuffer(i_buffer);
diff --git a/Source/Diagnostics/ComputeDiagFunctors/BackTransformParticleFunctor.cpp b/Source/Diagnostics/ComputeDiagFunctors/BackTransformParticleFunctor.cpp
index fc3aee298..efc08375d 100644
--- a/Source/Diagnostics/ComputeDiagFunctors/BackTransformParticleFunctor.cpp
+++ b/Source/Diagnostics/ComputeDiagFunctors/BackTransformParticleFunctor.cpp
@@ -145,6 +145,7 @@ BackTransformParticleFunctor::operator () (PinnedMemoryParticleContainer& pc_dst
if (Flag[i] == 1) GetParticleLorentzTransform(dst_data, src_data, i,
old_size + IndexLocation[i]);
});
+ amrex::Gpu::synchronize();
}
}
}