Skip to content

Commit 74c9db2

Browse files
committed
further work towards compilation
1 parent 68d8937 commit 74c9db2

17 files changed

+82
-66
lines changed

Source/Diagnostics/FlushFormats/FlushFormatCheckpoint.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ FlushFormatCheckpoint::CheckpointParticles (
206206
write_real_comps.push_back(1);
207207
}
208208

209-
int const compile_time_comps = static_cast<int>(real_names.size());
210-
211209
// get the names of the real comps
212210
// note: skips the mandatory AMREX_SPACEDIM positions for pure SoA
213211
real_names.resize(pc->NumRealComps() - AMREX_SPACEDIM);

Source/Diagnostics/ParticleDiag/ParticleDiag.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,17 @@ ParticleDiag::ParticleDiag (
3636
std::fill(m_plot_flags.begin(), m_plot_flags.end(), 0);
3737
bool contains_positions = false;
3838
if (variables[0] != "none"){
39-
std::map<std::string, int> existing_variable_names = pc->GetRealSoANames();
40-
#ifdef WARPX_DIM_RZ
41-
// we reconstruct to Cartesian x,y,z for RZ particle output
42-
existing_variable_names["y"] = PIdx::theta;
43-
#endif
4439
for (const auto& var : variables){
4540
if (var == "phi") {
4641
// User requests phi on particle. This is *not* part of the variables that
4742
// the particle container carries, and is only added to particles during output.
4843
// Therefore, this case needs to be treated specifically.
4944
m_plot_phi = true;
5045
} else {
51-
const auto search = existing_variable_names.find(var);
52-
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
53-
search != existing_variable_names.end(),
46+
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(pc->HasRealComp(var),
5447
"variables argument '" + var
5548
+"' is not an existing attribute for this species");
56-
m_plot_flags[existing_variable_names.at(var)] = 1;
49+
m_plot_flags[pc->GetRealCompIndex(var)] = 1;
5750

5851
if (var == "x" || var == "y" || var == "z") {
5952
contains_positions = true;

Source/FieldSolver/ImplicitSolvers/WarpXImplicitOps.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,15 @@ WarpX::SaveParticlesAtImplicitStepStart ( )
181181
amrex::ParticleReal* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr();
182182

183183
#if (AMREX_SPACEDIM >= 2)
184-
amrex::ParticleReal* x_n = pti.GetAttribs(particle_comps["x_n"]).dataPtr();
184+
amrex::ParticleReal* x_n = pti.GetAttribs("x_n").dataPtr();
185185
#endif
186186
#if defined(WARPX_DIM_3D) || defined(WARPX_DIM_RZ)
187-
amrex::ParticleReal* y_n = pti.GetAttribs(particle_comps["y_n"]).dataPtr();
187+
amrex::ParticleReal* y_n = pti.GetAttribs("y_n").dataPtr();
188188
#endif
189-
amrex::ParticleReal* z_n = pti.GetAttribs(particle_comps["z_n"]).dataPtr();
190-
amrex::ParticleReal* ux_n = pti.GetAttribs(particle_comps["ux_n"]).dataPtr();
191-
amrex::ParticleReal* uy_n = pti.GetAttribs(particle_comps["uy_n"]).dataPtr();
192-
amrex::ParticleReal* uz_n = pti.GetAttribs(particle_comps["uz_n"]).dataPtr();
189+
amrex::ParticleReal* z_n = pti.GetAttribs("z_n").dataPtr();
190+
amrex::ParticleReal* ux_n = pti.GetAttribs("ux_n").dataPtr();
191+
amrex::ParticleReal* uy_n = pti.GetAttribs("uy_n").dataPtr();
192+
amrex::ParticleReal* uz_n = pti.GetAttribs("uz_n").dataPtr();
193193

194194
const long np = pti.numParticles();
195195

@@ -252,15 +252,15 @@ WarpX::FinishImplicitParticleUpdate ()
252252
amrex::ParticleReal* const AMREX_RESTRICT uz = attribs[PIdx::uz].dataPtr();
253253

254254
#if (AMREX_SPACEDIM >= 2)
255-
amrex::ParticleReal* x_n = pti.GetAttribs(particle_comps["x_n"]).dataPtr();
255+
amrex::ParticleReal* x_n = pti.GetAttribs("x_n").dataPtr();
256256
#endif
257257
#if defined(WARPX_DIM_3D) || defined(WARPX_DIM_RZ)
258-
amrex::ParticleReal* y_n = pti.GetAttribs(particle_comps["y_n"]).dataPtr();
258+
amrex::ParticleReal* y_n = pti.GetAttribs("y_n").dataPtr();
259259
#endif
260-
amrex::ParticleReal* z_n = pti.GetAttribs(particle_comps["z_n"]).dataPtr();
261-
amrex::ParticleReal* ux_n = pti.GetAttribs(particle_comps["ux_n"]).dataPtr();
262-
amrex::ParticleReal* uy_n = pti.GetAttribs(particle_comps["uy_n"]).dataPtr();
263-
amrex::ParticleReal* uz_n = pti.GetAttribs(particle_comps["uz_n"]).dataPtr();
260+
amrex::ParticleReal* z_n = pti.GetAttribs("z_n").dataPtr();
261+
amrex::ParticleReal* ux_n = pti.GetAttribs("ux_n").dataPtr();
262+
amrex::ParticleReal* uy_n = pti.GetAttribs("uy_n").dataPtr();
263+
amrex::ParticleReal* uz_n = pti.GetAttribs("uz_n").dataPtr();
264264

265265
const long np = pti.numParticles();
266266

Source/Particles/Collision/BinaryCollision/DSMC/SplitAndScatterFunc.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ public:
224224
ParticleCreation::DefaultInitializeRuntimeAttributes(*tile_products[i],
225225
0, 0,
226226
pc_products[i]->getUserRealAttribs(), pc_products[i]->getUserIntAttribs(),
227-
pc_products[i]->GetRealSoANames(), pc_products[i]->getParticleiComps(),
227+
pc_products[i]->GetRealSoANames(), pc_products[i]->GetIntSoANames(),
228228
pc_products[i]->getUserRealAttribParser(),
229229
pc_products[i]->getUserIntAttribParser(),
230230
#ifdef WARPX_QED

Source/Particles/Collision/BinaryCollision/ParticleCreationFunc.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public:
235235
ParticleCreation::DefaultInitializeRuntimeAttributes(*tile_products[i],
236236
0, 0,
237237
pc_products[i]->getUserRealAttribs(), pc_products[i]->getUserIntAttribs(),
238-
pc_products[i]->GetRealSoANames(), pc_products[i]->getParticleiComps(),
238+
pc_products[i]->GetRealSoANames(), pc_products[i]->GetIntSoANames(),
239239
pc_products[i]->getUserRealAttribParser(),
240240
pc_products[i]->getUserIntAttribParser(),
241241
#ifdef WARPX_QED

Source/Particles/LaserParticleContainer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -873,18 +873,18 @@ LaserParticleContainer::update_laser_particle (WarpXParIter& pti,
873873
#if (AMREX_SPACEDIM >= 2)
874874
ParticleReal* x_n = nullptr;
875875
if (push_type == PushType::Implicit) {
876-
x_n = pti.GetAttribs(particle_comps["x_n"]).dataPtr();
876+
x_n = pti.GetAttribs("x_n").dataPtr();
877877
}
878878
#endif
879879
#if defined(WARPX_DIM_3D) || defined(WARPX_DIM_RZ)
880880
ParticleReal* y_n = nullptr;
881881
if (push_type == PushType::Implicit) {
882-
y_n = pti.GetAttribs(particle_comps["y_n"]).dataPtr();
882+
y_n = pti.GetAttribs("y_n").dataPtr();
883883
}
884884
#endif
885885
ParticleReal* z_n = nullptr;
886886
if (push_type == PushType::Implicit) {
887-
z_n = pti.GetAttribs(particle_comps["z_n"]).dataPtr();
887+
z_n = pti.GetAttribs("z_n").dataPtr();
888888
}
889889

890890
// Copy member variables to tmp copies for GPU runs.

Source/Particles/MultiParticleContainer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ void MultiParticleContainer::doQedQuantumSync (int lev,
16211621

16221622
auto Transform = PhotonEmissionTransformFunc(
16231623
m_shr_p_qs_engine->build_optical_depth_functor(),
1624-
pc_source->particle_runtime_comps["opticalDepthQSR"],
1624+
pc_source->GetRealCompIndex("opticalDepthQSR"),
16251625
m_shr_p_qs_engine->build_phot_em_functor(),
16261626
pti, lev, Ex.nGrowVect(),
16271627
Ex[pti], Ey[pti], Ez[pti],

Source/Particles/ParticleCreation/FilterCopyTransform.H

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Index filterCopyTransformParticles (DstPC& pc, DstTile& dst, SrcTile& src,
8888
ParticleCreation::DefaultInitializeRuntimeAttributes(dst,
8989
0, 0,
9090
pc.getUserRealAttribs(), pc.getUserIntAttribs(),
91-
pc.GetRealSoANames(), pc.getParticleiComps(),
91+
pc.GetRealSoANames(), pc.GetIntSoANames(),
9292
pc.getUserRealAttribParser(),
9393
pc.getUserIntAttribParser(),
9494
#ifdef WARPX_QED
@@ -258,7 +258,7 @@ Index filterCopyTransformParticles (DstPC& pc1, DstPC& pc2, DstTile& dst1, DstTi
258258
ParticleCreation::DefaultInitializeRuntimeAttributes(dst1,
259259
0, 0,
260260
pc1.getUserRealAttribs(), pc1.getUserIntAttribs(),
261-
pc1.GetRealSoANames(), pc1.getParticleiComps(),
261+
pc1.GetRealSoANames(), pc1.GetIntSoANames(),
262262
pc1.getUserRealAttribParser(),
263263
pc1.getUserIntAttribParser(),
264264
#ifdef WARPX_QED
@@ -272,7 +272,7 @@ Index filterCopyTransformParticles (DstPC& pc1, DstPC& pc2, DstTile& dst1, DstTi
272272
ParticleCreation::DefaultInitializeRuntimeAttributes(dst2,
273273
0, 0,
274274
pc2.getUserRealAttribs(), pc2.getUserIntAttribs(),
275-
pc2.GetRealSoANames(), pc2.getParticleiComps(),
275+
pc2.GetRealSoANames(), pc2.GetIntSoANames(),
276276
pc2.getUserRealAttribParser(),
277277
pc2.getUserIntAttribParser(),
278278
#ifdef WARPX_QED

Source/Particles/ParticleCreation/FilterCreateTransformFromFAB.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Index filterCreateTransformFromFAB (DstPC& pc1, DstPC& pc2,
136136
ParticleCreation::DefaultInitializeRuntimeAttributes(dst1,
137137
0, 0,
138138
pc1.getUserRealAttribs(), pc1.getUserIntAttribs(),
139-
pc1.GetRealSoANames(), pc1.getParticleiComps(),
139+
pc1.GetRealSoANames(), pc1.GetIntSoANames(),
140140
pc1.getUserRealAttribParser(),
141141
pc1.getUserIntAttribParser(),
142142
#ifdef WARPX_QED
@@ -150,7 +150,7 @@ Index filterCreateTransformFromFAB (DstPC& pc1, DstPC& pc2,
150150
ParticleCreation::DefaultInitializeRuntimeAttributes(dst2,
151151
0, 0,
152152
pc2.getUserRealAttribs(), pc2.getUserIntAttribs(),
153-
pc2.GetRealSoANames(), pc2.getParticleiComps(),
153+
pc2.GetRealSoANames(), pc2.GetIntSoANames(),
154154
pc2.getUserRealAttribParser(),
155155
pc2.getUserIntAttribParser(),
156156
#ifdef WARPX_QED

Source/Particles/ParticleCreation/SmartCopy.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ public:
141141
template <class SrcPC, class DstPC>
142142
SmartCopyFactory (const SrcPC& src, const DstPC& dst) noexcept :
143143
m_tag_real{getSmartCopyTag(src.GetRealSoANames(), dst.GetRealSoANames())},
144-
m_tag_int{getSmartCopyTag(src.getParticleiComps(), dst.getParticleiComps())},
144+
m_tag_int{getSmartCopyTag(src.GetIntSoANames(), dst.GetIntSoANames())},
145145
m_policy_real{getPolicies(dst.GetRealSoANames())},
146-
m_policy_int{getPolicies(dst.getParticleiComps())},
146+
m_policy_int{getPolicies(dst.GetIntSoANames())},
147147
m_defined{true}
148148
{}
149149

0 commit comments

Comments
 (0)