diff options
author | 2019-05-12 10:17:28 -0700 | |
---|---|---|
committer | 2019-05-12 10:17:28 -0700 | |
commit | 9a26a71845fde091c7840772bef1b23dbc46d6ac (patch) | |
tree | 0cd49decd638c3457ad1a604b60a6aecab8566dc /Source/Diagnostics/BoostedFrameDiagnostic.cpp | |
parent | c952dbe2e3d9a2c7bab2774e8036e0e9ff72e0ed (diff) | |
download | WarpX-9a26a71845fde091c7840772bef1b23dbc46d6ac.tar.gz WarpX-9a26a71845fde091c7840772bef1b23dbc46d6ac.tar.zst WarpX-9a26a71845fde091c7840772bef1b23dbc46d6ac.zip |
old attribs not allocated if species not BFD
Diffstat (limited to 'Source/Diagnostics/BoostedFrameDiagnostic.cpp')
-rw-r--r-- | Source/Diagnostics/BoostedFrameDiagnostic.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Source/Diagnostics/BoostedFrameDiagnostic.cpp b/Source/Diagnostics/BoostedFrameDiagnostic.cpp index 7a44bc66a..413730f91 100644 --- a/Source/Diagnostics/BoostedFrameDiagnostic.cpp +++ b/Source/Diagnostics/BoostedFrameDiagnostic.cpp @@ -497,8 +497,6 @@ BoostedFrameDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab, void BoostedFrameDiagnostic::Flush(const Geometry& geom) { BL_PROFILE("BoostedFrameDiagnostic::Flush"); - - std::cout<<"in Flush\n"; VisMF::Header::Version current_version = VisMF::GetHeaderVersion(); VisMF::SetHeaderVersion(amrex::VisMF::Header::NoFabHeader_v1); @@ -542,11 +540,10 @@ void BoostedFrameDiagnostic::Flush(const Geometry& geom) if (WarpX::do_boosted_frame_particles) { // for (int j = 0; j < mypc.nSpecies(); ++j) { - for (int j = 0; j < mypc.nspecies_lab_frame_diags; ++j) { - int js = mypc.map_species_lab_diags[j]; + for (int j = 0; j < mypc.nSpeciesLabFrameDiags(); ++j) { + int js = mypc.mapSpeciesLabDiags(j); std::string species_name = species_names[js]; #ifdef WARPX_USE_HDF5 - std::cout<<"particles_buffer_ j "<<j<<'\n'; writeParticleDataHDF5(particles_buffer_[i][j], snapshots_[i].file_name, species_name); @@ -607,7 +604,7 @@ writeLabFrameData(const MultiFab* cell_centered_data, DistributionMapping buff_dm(buff_ba); data_buffer_[i].reset( new MultiFab(buff_ba, buff_dm, ncomp, 0) ); } - if (WarpX::do_boosted_frame_particles) particles_buffer_[i].resize(mypc.nspecies_lab_frame_diags); + if (WarpX::do_boosted_frame_particles) particles_buffer_[i].resize(mypc.nSpeciesLabFrameDiags()); } if (WarpX::do_boosted_frame_fields) { @@ -675,9 +672,9 @@ writeLabFrameData(const MultiFab* cell_centered_data, if (WarpX::do_boosted_frame_particles) { - for (int j = 0; j < mypc.nspecies_lab_frame_diags; ++j) { + for (int j = 0; j < mypc.nSpeciesLabFrameDiags(); ++j) { - const std::string species_name = species_names[mypc.map_species_lab_diags[j]]; + const std::string species_name = species_names[mypc.mapSpeciesLabDiags(j)]; #ifdef WARPX_USE_HDF5 writeParticleDataHDF5(particles_buffer_[i][j], snapshots_[i].file_name, @@ -735,6 +732,7 @@ writeParticleDataHDF5(const WarpXParticleContainer::DiagnosticParticleData& pdat ParallelDescriptor::ReduceLongMax(old_np); // Write data here + Print()<<"particle_field_names.size()"<<particle_field_names.size()<<std::endl; for (int k = 0; k < static_cast<int>(particle_field_names.size()); ++k) { std::string field_path = species_name + "/" + particle_field_names[k]; @@ -872,9 +870,9 @@ LabSnapShot(Real t_lab_in, Real t_boost, Real zmin_lab_in, auto & mypc = WarpX::GetInstance().GetPartContainer(); const std::vector<std::string> species_names = mypc.GetSpeciesNames(); // for (int j = 0; j < mypc.nSpecies(); ++j) - for (int j = 0; j < mypc.nspecies_lab_frame_diags; ++j) + for (int j = 0; j < mypc.nSpeciesLabFrameDiags(); ++j) { - int js = mypc.map_species_lab_diags[j]; + int js = mypc.mapSpeciesLabDiags(j); std::string species_name = species_names[js]; output_create_species_group(file_name, species_name); for (int k = 0; k < static_cast<int>(particle_field_names.size()); ++k) @@ -901,8 +899,8 @@ LabSnapShot(Real t_lab_in, Real t_boost, Real zmin_lab_in, const std::vector<std::string> species_names = mypc.GetSpeciesNames(); const std::string particles_prefix = "particle"; - for(int i = 0; i < mypc.nspecies_lab_frame_diags; ++i) { - int is = mypc.map_species_lab_diags[i]; + for(int i = 0; i < mypc.nSpeciesLabFrameDiags(); ++i) { + int is = mypc.mapSpeciesLabDiags(i); std::string species_name = species_names[is]; const std::string fullpath = file_name + "/" + species_name; if (!UtilCreateDirectory(fullpath, 0755)) |