Skip to content

Commit a08f073

Browse files
committed
Debugging
1 parent a379514 commit a08f073

File tree

5 files changed

+35
-0
lines changed

5 files changed

+35
-0
lines changed

Source/Particles/Collision/BinaryCollision/BinaryCollision.H

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ public:
181181
auto& species2 = mypc->GetParticleContainerFromName(m_species_names[1]);
182182

183183
// In case of particle creation, create the necessary vectors
184+
amrex::Print() << "Starting binary collisions between " << m_species_names[0] << " and " << m_species_names[1] << std::endl;
184185
const int n_product_species = m_product_species.size();
186+
amrex::Print() << "n_product_species = " << n_product_species << std::endl;
185187
amrex::Vector<WarpXParticleContainer*> product_species_vector;
186188
amrex::Vector<SmartCopyFactory> copy_factory_species1;
187189
amrex::Vector<SmartCopyFactory> copy_factory_species2;
@@ -192,6 +194,14 @@ public:
192194
auto& product = mypc->GetParticleContainerFromName(m_product_species[i]);
193195
product.defineAllParticleTiles();
194196
product_species_vector.push_back(&product);
197+
amrex::Print() << "BinaryCollision::doCollisions: preparing to create " << m_product_species[i] << std::endl;
198+
amrex::Print() << "product.NumRealComps() = " << product.NumRealComps() << std::endl;
199+
amrex::Print() << "product.NumRuntimeRealComps() = " << product.NumRuntimeRealComps() << std::endl;
200+
amrex::Print() << "product.NStructReal = " << product.NStructReal << std::endl;
201+
amrex::Print() << "product.NArrayReal = " << product.NArrayReal << std::endl;
202+
for (auto const & comp : product.GetRealSoANames()) {
203+
amrex::Print() << "product.GetRealSoANames(): " << comp << std::endl;
204+
}
195205
// Although the copy factories are not explicitly reused past this point, we need to
196206
// store them in vectors so that the data that they own, which is used by the smart
197207
// copy functors, does not go out of scope at the end of this for loop.

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ public:
286286
// create a copy of the first product species at the location of species 1
287287
const auto reactant1_index = static_cast<int>(p_pair_indices_1[i]);
288288
const auto product1_index = products_np_data[2] + with_product_p_offsets[i];
289+
amrex::Print() << "Creating " << pc_products[2]->getSpeciesTypeName() << " particle at index " << product1_index << " from reactant index " << reactant1_index << std::endl;
289290
copy_species1[2](soa_products_data[2], soa_1, reactant1_index,
290291
static_cast<int>(product1_index), engine);
291292
// Set the weight of the new particle to p_pair_reaction_weight[i]
@@ -294,6 +295,7 @@ public:
294295
// create a copy of the other product species at the location of species 2
295296
const auto reactant2_index = static_cast<int>(p_pair_indices_2[i]);
296297
const auto product2_index = products_np_data[3] + with_product_p_offsets[i];
298+
amrex::Print() << "Creating " << pc_products[3]->getSpeciesTypeName() << " particle at index " << product2_index << " from reactant index " << reactant2_index << std::endl;
297299
copy_species2[3](soa_products_data[3], soa_2, reactant2_index,
298300
static_cast<int>(product2_index), engine);
299301
// Set the weight of the new particle to p_pair_reaction_weight[i]
@@ -509,6 +511,7 @@ public:
509511
{
510512
const int start_index = int(products_np[i]);
511513
const int stop_index = int(products_np[i] + num_added_vec[i]);
514+
amrex::Print() << "Calling ParticleCreation::DefaultInitializeRuntimeAttributes for species " << pc_products[i]->getSpeciesTypeName() << std::endl;
512515
ParticleCreation::DefaultInitializeRuntimeAttributes(*tile_products[i],
513516
0, 0,
514517
pc_products[i]->getUserRealAttribs(), pc_products[i]->getUserIntAttribs(),

Source/Particles/ParticleCreation/DefaultInitialization.H

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ void DefaultInitializeRuntimeAttributes (PTile& ptile,
137137
{
138138
using namespace amrex::literals;
139139

140+
amrex::Print() << "Starting ParticleCreation::DefaultInitializeRuntimeAttributes" << std::endl;
141+
for (auto const & comp : particle_comps) {
142+
amrex::Print() << "particle_comps: " << comp << std::endl;
143+
}
144+
for (auto const & comp: ptile.GetStructOfArrays().GetRealNames()) {
145+
amrex::Print() << "ptile.GetStructOfArrays().GetRealNames(): " << comp << std::endl;
146+
}
147+
140148
// Preparing data needed for user defined attributes
141149
const auto n_user_real_attribs = static_cast<int>(user_real_attribs.size());
142150
const auto n_user_int_attribs = static_cast<int>(user_int_attribs.size());

Source/Particles/ParticleCreation/SmartCopy.H

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ struct SmartCopy
5050
{
5151
// initialize the real components
5252
for (int j = 0; j < DstData::NAR; ++j) {
53+
amrex::Print() << "Initializing real component " << j << " for dst particle " << i_dst << " with policy " << static_cast<int>(m_policy_real[j]) << std::endl;
5354
dst.m_rdata[j][i_dst] = initializeRealValue(m_policy_real[j], engine);
5455
}
5556
for (int j = 0; j < dst.m_num_runtime_real; ++j) {
57+
amrex::Print() << "Initializing runtime real component " << j << " for dst particle " << i_dst << " with policy " << static_cast<int>(m_policy_real[j+DstData::NAR]) << std::endl;
5658
dst.m_runtime_rdata[j][i_dst] = initializeRealValue(m_policy_real[j+DstData::NAR], engine);
5759
}
5860

Source/Particles/PhysicalParticleContainer.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp
351351
}
352352

353353
if (m_collisions_split_position_push) {
354+
amrex::Print() << "Adding average momentum components for " << species_name << std::endl;
354355
// Add the average momentum components to deposit the current correctly
355356
// if the position push is split to perform collisions
356357
AddRealComp("ux_avg");
@@ -428,6 +429,8 @@ PhysicalParticleContainer::DefaultInitializeRuntimeAttributes (
428429
int n_external_attr_real,
429430
int n_external_attr_int)
430431
{
432+
amrex::Print() << "Starting PhysicalParticleContainer::DefaultInitializeRuntimeAttributes for "
433+
<< species_name << std::endl;
431434
ParticleCreation::DefaultInitializeRuntimeAttributes(pinned_tile,
432435
n_external_attr_real, n_external_attr_int,
433436
m_user_real_attribs, m_user_int_attribs,
@@ -455,6 +458,15 @@ PhysicalParticleContainer::Evolve (ablastr::fields::MultiFabRegister& fields,
455458
using ablastr::fields::Direction;
456459
using warpx::fields::FieldType;
457460

461+
amrex::Print() << "Starting PhysicalParticleContainer::Evolve for " << species_name << std::endl;
462+
amrex::Print() << "NumRealComps() = " << NumRealComps() << std::endl;
463+
amrex::Print() << "NumRuntimeRealComps() = " << NumRuntimeRealComps() << std::endl;
464+
amrex::Print() << "NStructReal = " << NStructReal << std::endl;
465+
amrex::Print() << "NArrayReal = " << NArrayReal << std::endl;
466+
for (auto const & comp : GetRealSoANames()) {
467+
amrex::Print() << "GetRealSoANames(): " << comp << std::endl;
468+
}
469+
458470
WARPX_PROFILE("PhysicalParticleContainer::Evolve()");
459471
WARPX_PROFILE_VAR_NS("PhysicalParticleContainer::Evolve::GatherAndPush", blp_fg);
460472

0 commit comments

Comments
 (0)