From 488c91478955cbf173e6fe5a27e6edaca72febc5 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Fri, 25 Oct 2019 11:22:44 +0200 Subject: fix bug related to photon initialization --- Source/Particles/PhotonParticleContainer.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'Source/Particles/PhotonParticleContainer.cpp') diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index 3e678fb26..cf2ffbec4 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -45,9 +45,8 @@ void PhotonParticleContainer::InitData() { AddParticles(0); // Note - add on level 0 - if (maxLevel() > 0) { - Redistribute(); // We then redistribute - } + Redistribute(); // We then redistribute + } void -- cgit v1.2.3 From e133d2202685d6e478b42f9b554b00d5fa722801 Mon Sep 17 00:00:00 2001 From: MaxThevenet Date: Fri, 25 Oct 2019 11:56:10 -0700 Subject: replace 'boosted frame diags' with 'back-transformed diags' --- Docs/source/running_cpp/parameters.rst | 18 ++--- .../Modules/RigidInjection/inputs.BoostedFrame | 2 +- Examples/Modules/boosted_diags/inputs.2d | 2 +- Examples/Modules/boosted_diags/inputs.3d | 2 +- Examples/Modules/boosted_diags/inputs.3d.slice | 6 +- .../laser_acceleration/inputs.2d.boost | 2 +- .../plasma_acceleration/inputs.2d.boost | 2 +- .../plasma_acceleration/inputs.3d.boost | 2 +- Python/pywarpx/picmi.py | 8 +-- Source/Diagnostics/BoostedFrameDiagnostic.H | 12 ++-- Source/Diagnostics/BoostedFrameDiagnostic.cpp | 76 +++++++++++----------- Source/Diagnostics/Make.package | 4 +- Source/Evolve/WarpXEvolveEM.cpp | 6 +- Source/Initialization/WarpXInitData.cpp | 4 +- Source/Laser/LaserParticleContainer.cpp | 2 +- Source/Particles/MultiParticleContainer.H | 18 ++--- Source/Particles/MultiParticleContainer.cpp | 24 +++---- Source/Particles/PhotonParticleContainer.cpp | 2 +- Source/Particles/PhysicalParticleContainer.cpp | 10 +-- Source/Particles/WarpXParticleContainer.H | 4 +- Source/WarpX.H | 10 +-- Source/WarpX.cpp | 16 ++--- .../automated_test_4_labdiags_2ppc | 2 +- 23 files changed, 117 insertions(+), 117 deletions(-) (limited to 'Source/Particles/PhotonParticleContainer.cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 59bfbb14e..a2de46b03 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -349,8 +349,8 @@ Particle initialization ``.plot_vars = none`` to plot no particle data, except particle position. -* ``.do_boosted_frame_diags`` (`0` or `1` optional, default `1`) - Only used when ``warpx.do_boosted_frame_diagnostic=1``. When running in a +* ``.do_back_transformed_diagnostics`` (`0` or `1` optional, default `1`) + Only used when ``warpx.do_back_transformed_diagnostics=1``. When running in a boosted frame, whether or not to plot back-transformed diagnostics for this species. @@ -765,7 +765,7 @@ Diagnostics and output When WarpX is compiled with openPMD support, this is ``h5`` by default. ``json`` only works with serial/single-rank jobs. -* ``warpx.do_boosted_frame_diagnostic`` (`0` or `1`) +* ``warpx.do_back_transformed_diagnostics`` (`0` or `1`) Whether to use the **back-transformed diagnostics** (i.e. diagnostics that perform on-the-fly conversion to the laboratory frame, when running boosted-frame simulations) @@ -776,22 +776,22 @@ Diagnostics and output is `lab_frame_data`. * ``warpx.num_snapshots_lab`` (`integer`) - Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. + Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``. The number of lab-frame snapshots that will be written. * ``warpx.dt_snapshots_lab`` (`float`, in seconds) - Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. + Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``. The time interval inbetween the lab-frame snapshots (where this time interval is expressed in the laboratory frame). * ``warpx.dz_snapshots_lab`` (`float`, in meters) - Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. + Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``. Distance between the lab-frame snapshots (expressed in the laboratory frame). ``dt_snapshots_lab`` is then computed by ``dt_snapshots_lab = dz_snapshots_lab/c``. Either `dt_snapshots_lab` or `dz_snapshot_lab` is required. -* ``warpx.do_boosted_frame_fields`` (`0 or 1`) +* ``warpx.do_back_transformed_fields`` (`0 or 1`) Whether to use the **back-transformed diagnostics** for the fields. * ``warpx.boosted_frame_diag_fields`` (space-separated list of `string`) @@ -850,7 +850,7 @@ Diagnostics and output negative number to disable slice generation and slice data dumping. * ``slice.num_slice_snapshots_lab`` (`integer`) - Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. + Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``. The number of back-transformed field and particle data that will be written for the reduced domain defined by ``slice.dom_lo`` and ``slice.dom_hi``. Note that the 'slice' is a reduced @@ -860,7 +860,7 @@ Diagnostics and output for further details. * ``slice.dt_slice_snapshots_lab`` (`float`, in seconds) - Only used when ``warpx.do_boosted_frame_diagnostic`` is ``1``. + Only used when ``warpx.do_back_transformed_diagnostics`` is ``1``. The time interval between the back-transformed reduced diagnostics (where this time interval is expressed in the laboratory frame). diff --git a/Examples/Modules/RigidInjection/inputs.BoostedFrame b/Examples/Modules/RigidInjection/inputs.BoostedFrame index c7a60f14f..456df363d 100644 --- a/Examples/Modules/RigidInjection/inputs.BoostedFrame +++ b/Examples/Modules/RigidInjection/inputs.BoostedFrame @@ -3,7 +3,7 @@ warpx.zmax_plasma_to_compute_max_step = 50.e-6 warpx.gamma_boost = 5. warpx.boost_direction = z -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 2 warpx.dt_snapshots_lab = 1.8679589331096515e-13 diff --git a/Examples/Modules/boosted_diags/inputs.2d b/Examples/Modules/boosted_diags/inputs.2d index 6afe6977d..7b2270f90 100644 --- a/Examples/Modules/boosted_diags/inputs.2d +++ b/Examples/Modules/boosted_diags/inputs.2d @@ -44,7 +44,7 @@ warpx.gamma_boost = 15. warpx.boost_direction = z # Diagnostics -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 20 warpx.dt_snapshots_lab = 7.0e-14 diff --git a/Examples/Modules/boosted_diags/inputs.3d b/Examples/Modules/boosted_diags/inputs.3d index 528eb6cd9..b700a52fb 100644 --- a/Examples/Modules/boosted_diags/inputs.3d +++ b/Examples/Modules/boosted_diags/inputs.3d @@ -44,7 +44,7 @@ warpx.gamma_boost = 15. warpx.boost_direction = z # Diagnostics -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 20; warpx.dt_snapshots_lab = 7.0e-14; diff --git a/Examples/Modules/boosted_diags/inputs.3d.slice b/Examples/Modules/boosted_diags/inputs.3d.slice index ca745f347..08f2310cd 100644 --- a/Examples/Modules/boosted_diags/inputs.3d.slice +++ b/Examples/Modules/boosted_diags/inputs.3d.slice @@ -30,7 +30,7 @@ warpx.serialize_ics = 1 warpx.gamma_boost = 10. warpx.boost_direction = z -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 4 warpx.dz_snapshots_lab = 0.001 warpx.boosted_frame_diag_fields= Ex Ey Ez By rho @@ -53,7 +53,7 @@ electrons.zmax = .003 electrons.profile = constant electrons.density = 3.5e24 electrons.do_continuous_injection = 1 -electrons.do_boosted_frame_diags = 1 +electrons.do_back_transformed_diagnostics = 1 ions.charge = q_e ions.mass = m_p @@ -69,7 +69,7 @@ ions.zmax = .003 ions.profile = constant ions.density = 3.5e24 ions.do_continuous_injection = 1 -ions.do_boosted_frame_diags = 1 +ions.do_back_transformed_diagnostics = 1 beam.charge = -q_e beam.mass = m_e diff --git a/Examples/Physics_applications/laser_acceleration/inputs.2d.boost b/Examples/Physics_applications/laser_acceleration/inputs.2d.boost index 89bded6c0..a50b5164a 100644 --- a/Examples/Physics_applications/laser_acceleration/inputs.2d.boost +++ b/Examples/Physics_applications/laser_acceleration/inputs.2d.boost @@ -41,7 +41,7 @@ warpx.serialize_ics = 1 ################################# warpx.gamma_boost = 10. warpx.boost_direction = z -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 7 warpx.dt_snapshots_lab = 1.6678204759907604e-12 diff --git a/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost b/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost index d711815eb..af4556e25 100644 --- a/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost +++ b/Examples/Physics_applications/plasma_acceleration/inputs.2d.boost @@ -39,7 +39,7 @@ interpolation.noz = 3 ################################# warpx.gamma_boost = 10.0 warpx.boost_direction = z -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 22 warpx.dt_snapshots_lab = 3.335640951981521e-11 diff --git a/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost b/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost index 42446a9ac..79480c97f 100644 --- a/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost +++ b/Examples/Physics_applications/plasma_acceleration/inputs.3d.boost @@ -38,7 +38,7 @@ interpolation.noz = 3 ################################# warpx.gamma_boost = 10.0 warpx.boost_direction = z -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 22 warpx.dt_snapshots_lab = 3.335640951981521e-11 diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index c33700278..c4e6803d5 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -671,10 +671,10 @@ class LabFrameFieldDiagnostic(picmistandard.PICMI_LabFrameFieldDiagnostic): pywarpx.warpx.check_consistency('dt_snapshots_lab', self.dt_snapshots, 'The time between snapshots must be the same in all lab frame diagnostics') pywarpx.warpx.check_consistency('lab_data_directory', self.write_dir, 'The write directory must be the same in all lab frame diagnostics') - pywarpx.warpx.do_boosted_frame_diagnostic = 1 + pywarpx.warpx.do_back_transformed_diagnostics = 1 pywarpx.warpx.num_snapshots_lab = self.num_snapshots pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots - pywarpx.warpx.do_boosted_frame_fields = 1 + pywarpx.warpx.do_back_transformed_fields = 1 pywarpx.warpx.lab_data_directory = self.write_dir @@ -685,8 +685,8 @@ class LabFrameParticleDiagnostic(picmistandard.PICMI_LabFrameParticleDiagnostic) pywarpx.warpx.check_consistency('dt_snapshots_lab', self.dt_snapshots, 'The time between snapshots must be the same in all lab frame diagnostics') pywarpx.warpx.check_consistency('lab_data_directory', self.write_dir, 'The write directory must be the same in all lab frame diagnostics') - pywarpx.warpx.do_boosted_frame_diagnostic = 1 + pywarpx.warpx.do_back_transformed_diagnostics = 1 pywarpx.warpx.num_snapshots_lab = self.num_snapshots pywarpx.warpx.dt_snapshots_lab = self.dt_snapshots - pywarpx.warpx.do_boosted_frame_particles = 1 + pywarpx.warpx.do_back_transformed_particles = 1 pywarpx.warpx.lab_data_directory = self.write_dir diff --git a/Source/Diagnostics/BoostedFrameDiagnostic.H b/Source/Diagnostics/BoostedFrameDiagnostic.H index 5d95aaf7d..9e24caa1b 100644 --- a/Source/Diagnostics/BoostedFrameDiagnostic.H +++ b/Source/Diagnostics/BoostedFrameDiagnostic.H @@ -1,5 +1,5 @@ -#ifndef WARPX_BoostedFrameDiagnostic_H_ -#define WARPX_BoostedFrameDiagnostic_H_ +#ifndef WARPX_BackTransformedDiagnostic_H_ +#define WARPX_BackTransformedDiagnostic_H_ #include #include @@ -150,7 +150,7 @@ class LabFrameSlice : public LabFrameDiag { }; /** \brief - * BoostedFrameDiagnostic class handles the back-transformation of data when + * BackTransformedDiagnostic class handles the back-transformation of data when * running simulations in a boosted frame of reference to the lab-frame. * Because of the relativity of simultaneity, events that are synchronized * in the simulation boosted frame are not @@ -163,13 +163,13 @@ class LabFrameSlice : public LabFrameDiag { * to the output directory. The functions Flush() and writeLabFrameData() * are called at the end of the simulation and when the * the buffer for data storage is full, respectively. The particle data - * is collected and written only if particle.do_boosted_frame_diagnostic = 1. + * is collected and written only if particle.do_back_transformed_diagnostics = 1. */ -class BoostedFrameDiagnostic { +class BackTransformedDiagnostic { public: - BoostedFrameDiagnostic(amrex::Real zmin_lab, amrex::Real zmax_lab, + BackTransformedDiagnostic(amrex::Real zmin_lab, amrex::Real zmax_lab, amrex::Real v_window_lab, amrex::Real dt_snapshots_lab, int N_snapshots, amrex::Real dt_slice_snapshots_lab, int N_slice_snapshots, amrex::Real gamma_boost, diff --git a/Source/Diagnostics/BoostedFrameDiagnostic.cpp b/Source/Diagnostics/BoostedFrameDiagnostic.cpp index 297b4f5be..2880b37b1 100644 --- a/Source/Diagnostics/BoostedFrameDiagnostic.cpp +++ b/Source/Diagnostics/BoostedFrameDiagnostic.cpp @@ -1,7 +1,7 @@ #include #include -#include "BoostedFrameDiagnostic.H" +#include "BackTransformedDiagnostic.H" #include "SliceDiagnostic.H" #include "WarpX_f.H" #include "WarpX.H" @@ -514,8 +514,8 @@ LorentzTransformZ(MultiFab& data, Real gamma_boost, Real beta_boost, int ncomp) } } -BoostedFrameDiagnostic:: -BoostedFrameDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab, +BackTransformedDiagnostic:: +BackTransformedDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab, Real dt_snapshots_lab, int N_snapshots, Real dt_slice_snapshots_lab, int N_slice_snapshots, Real gamma_boost, Real t_boost, Real dt_boost, @@ -531,10 +531,10 @@ BoostedFrameDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab, { - BL_PROFILE("BoostedFrameDiagnostic::BoostedFrameDiagnostic"); + BL_PROFILE("BackTransformedDiagnostic::BackTransformedDiagnostic"); - AMREX_ALWAYS_ASSERT(WarpX::do_boosted_frame_fields or - WarpX::do_boosted_frame_particles); + AMREX_ALWAYS_ASSERT(WarpX::do_back_transformed_fields or + WarpX::do_back_transformed_particles); inv_gamma_boost_ = 1.0 / gamma_boost_; beta_boost_ = std::sqrt(1.0 - inv_gamma_boost_*inv_gamma_boost_); @@ -679,9 +679,9 @@ BoostedFrameDiagnostic(Real zmin_lab, Real zmax_lab, Real v_window_lab, AMREX_ALWAYS_ASSERT(max_box_size_ >= num_buffer_); } -void BoostedFrameDiagnostic::Flush(const Geometry& geom) +void BackTransformedDiagnostic::Flush(const Geometry& geom) { - BL_PROFILE("BoostedFrameDiagnostic::Flush"); + BL_PROFILE("BackTransformedDiagnostic::Flush"); VisMF::Header::Version current_version = VisMF::GetHeaderVersion(); VisMF::SetHeaderVersion(amrex::VisMF::Header::NoFabHeader_v1); @@ -696,7 +696,7 @@ void BoostedFrameDiagnostic::Flush(const Geometry& geom) int i_lab = (LabFrameDiags_[i]->current_z_lab - zmin_lab) / dz_lab_; if (LabFrameDiags_[i]->buff_counter_ != 0) { - if (WarpX::do_boosted_frame_fields) { + if (WarpX::do_back_transformed_fields) { const BoxArray& ba = LabFrameDiags_[i]->data_buffer_->boxArray(); const int hi = ba[0].bigEnd(boost_direction_); const int lo = hi - LabFrameDiags_[i]->buff_counter_ + 1; @@ -731,12 +731,12 @@ void BoostedFrameDiagnostic::Flush(const Geometry& geom) #endif } - if (WarpX::do_boosted_frame_particles) { + if (WarpX::do_back_transformed_particles) { // Loop over species to be dumped to BFD - for (int j = 0; j < mypc.nSpeciesBoostedFrameDiags(); ++j) { + for (int j = 0; j < mypc.nSpeciesBackTransformedDiagnostics(); ++j) { // Get species name std::string species_name = - species_names[mypc.mapSpeciesBoostedFrameDiags(j)]; + species_names[mypc.mapSpeciesBackTransformedDiagnostics(j)]; #ifdef WARPX_USE_HDF5 // Dump species data writeParticleDataHDF5(LabFrameDiags_[i]->particles_buffer_[j], @@ -765,12 +765,12 @@ void BoostedFrameDiagnostic::Flush(const Geometry& geom) void -BoostedFrameDiagnostic:: +BackTransformedDiagnostic:: writeLabFrameData(const MultiFab* cell_centered_data, const MultiParticleContainer& mypc, const Geometry& geom, const Real t_boost, const Real dt) { - BL_PROFILE("BoostedFrameDiagnostic::writeLabFrameData"); + BL_PROFILE("BackTransformedDiagnostic::writeLabFrameData"); VisMF::Header::Version current_version = VisMF::GetHeaderVersion(); VisMF::SetHeaderVersion(amrex::VisMF::Header::NoFabHeader_v1); @@ -808,7 +808,7 @@ writeLabFrameData(const MultiFab* cell_centered_data, // If buffer of snapshot i is empty... if ( LabFrameDiags_[i]->buff_counter_ == 0) { // ... reset fields buffer data_buffer_ - if (WarpX::do_boosted_frame_fields) { + if (WarpX::do_back_transformed_fields) { LabFrameDiags_[i]->buff_box_.setSmall(boost_direction_, i_lab - num_buffer_ + 1); LabFrameDiags_[i]->buff_box_.setBig(boost_direction_, i_lab); @@ -820,12 +820,12 @@ writeLabFrameData(const MultiFab* cell_centered_data, buff_dm, ncomp_to_dump, 0) ); } // ... reset particle buffer particles_buffer_[i] - if (WarpX::do_boosted_frame_particles) + if (WarpX::do_back_transformed_particles) LabFrameDiags_[i]->particles_buffer_.resize( - mypc.nSpeciesBoostedFrameDiags()); + mypc.nSpeciesBackTransformedDiagnostics()); } - if (WarpX::do_boosted_frame_fields) { + if (WarpX::do_back_transformed_fields) { const int ncomp = cell_centered_data->nComp(); const int start_comp = 0; const bool interpolate = true; @@ -873,7 +873,7 @@ writeLabFrameData(const MultiFab* cell_centered_data, tmp_slice_ptr.reset(nullptr); } - if (WarpX::do_boosted_frame_particles) { + if (WarpX::do_back_transformed_particles) { if (LabFrameDiags_[i]->t_lab != prev_t_lab ) { if (tmp_particle_buffer.size()>0) @@ -881,7 +881,7 @@ writeLabFrameData(const MultiFab* cell_centered_data, tmp_particle_buffer.clear(); tmp_particle_buffer.shrink_to_fit(); } - tmp_particle_buffer.resize(mypc.nSpeciesBoostedFrameDiags()); + tmp_particle_buffer.resize(mypc.nSpeciesBackTransformedDiagnostics()); mypc.GetLabFrameData( LabFrameDiags_[i]->file_name, i_lab, boost_direction_, old_z_boost, LabFrameDiags_[i]->current_z_boost, @@ -889,7 +889,7 @@ writeLabFrameData(const MultiFab* cell_centered_data, tmp_particle_buffer); } LabFrameDiags_[i]->AddPartDataToParticleBuffer(tmp_particle_buffer, - mypc.nSpeciesBoostedFrameDiags()); + mypc.nSpeciesBackTransformedDiagnostics()); } ++LabFrameDiags_[i]->buff_counter_; @@ -898,7 +898,7 @@ writeLabFrameData(const MultiFab* cell_centered_data, // If buffer full, write to disk. if ( LabFrameDiags_[i]->buff_counter_ == num_buffer_) { - if (WarpX::do_boosted_frame_fields) { + if (WarpX::do_back_transformed_fields) { #ifdef WARPX_USE_HDF5 Box buff_box = LabFrameDiags_[i]->buff_box_; @@ -916,12 +916,12 @@ writeLabFrameData(const MultiFab* cell_centered_data, #endif } - if (WarpX::do_boosted_frame_particles) { + if (WarpX::do_back_transformed_particles) { // Loop over species to be dumped to BFD - for (int j = 0; j < mypc.nSpeciesBoostedFrameDiags(); ++j) { + for (int j = 0; j < mypc.nSpeciesBackTransformedDiagnostics(); ++j) { // Get species name const std::string species_name = species_names[ - mypc.mapSpeciesBoostedFrameDiags(j)]; + mypc.mapSpeciesBackTransformedDiagnostics(j)]; #ifdef WARPX_USE_HDF5 // Write data to disk (HDF5) writeParticleDataHDF5(LabFrameDiags_[i]->particles_buffer_[j], @@ -949,7 +949,7 @@ writeLabFrameData(const MultiFab* cell_centered_data, #ifdef WARPX_USE_HDF5 void -BoostedFrameDiagnostic:: +BackTransformedDiagnostic:: writeParticleDataHDF5(const WarpXParticleContainer::DiagnosticParticleData& pdata, const std::string& name, const std::string& species_name) { @@ -997,11 +997,11 @@ writeParticleDataHDF5(const WarpXParticleContainer::DiagnosticParticleData& pdat #endif void -BoostedFrameDiagnostic:: +BackTransformedDiagnostic:: writeParticleData(const WarpXParticleContainer::DiagnosticParticleData& pdata, const std::string& name, const int i_lab) { - BL_PROFILE("BoostedFrameDiagnostic::writeParticleData"); + BL_PROFILE("BackTransformedDiagnostic::writeParticleData"); std::string field_name; std::ofstream ofs; @@ -1047,10 +1047,10 @@ writeParticleData(const WarpXParticleContainer::DiagnosticParticleData& pdata, } void -BoostedFrameDiagnostic:: +BackTransformedDiagnostic:: writeMetaData () { - BL_PROFILE("BoostedFrameDiagnostic::writeMetaData"); + BL_PROFILE("BackTransformedDiagnostic::writeMetaData"); if (ParallelDescriptor::IOProcessor()) { const std::string fullpath = WarpX::lab_data_directory + "/snapshots"; @@ -1134,7 +1134,7 @@ LabFrameSnapShot(Real t_lab_in, Real t_boost, Real inv_gamma_boost_in, file_num, 5); createLabFrameDirectories(); buff_counter_ = 0; - if (WarpX::do_boosted_frame_fields) data_buffer_.reset(nullptr); + if (WarpX::do_back_transformed_fields) data_buffer_.reset(nullptr); } void @@ -1158,7 +1158,7 @@ createLabFrameDirectories() { if (ParallelDescriptor::IOProcessor()) { - if (WarpX::do_boosted_frame_fields) + if (WarpX::do_back_transformed_fields) { const auto lo = lbound(buff_box_); for (int comp = 0; comp < ncomp_to_dump_; ++comp) { @@ -1176,15 +1176,15 @@ createLabFrameDirectories() { ParallelDescriptor::Barrier(); - if (WarpX::do_boosted_frame_particles){ + if (WarpX::do_back_transformed_particles){ auto & mypc = WarpX::GetInstance().GetPartContainer(); const std::vector species_names = mypc.GetSpeciesNames(); // Loop over species to be dumped to BFD - for (int j = 0; j < mypc.nSpeciesBoostedFrameDiags(); ++j) + for (int j = 0; j < mypc.nSpeciesBackTransformedDiagnostics(); ++j) { // Loop over species to be dumped to BFD std::string species_name = - species_names[mypc.mapSpeciesBoostedFrameDiags(j)]; + species_names[mypc.mapSpeciesBackTransformedDiagnostics(j)]; output_create_species_group(file_name, species_name); for (int k = 0; k < static_cast(particle_field_names.size()); ++k) { @@ -1211,10 +1211,10 @@ createLabFrameDirectories() { const std::string particles_prefix = "particle"; // Loop over species to be dumped to BFD - for(int i = 0; i < mypc.nSpeciesBoostedFrameDiags(); ++i) { + for(int i = 0; i < mypc.nSpeciesBackTransformedDiagnostics(); ++i) { // Get species name std::string species_name = - species_names[mypc.mapSpeciesBoostedFrameDiags(i)]; + species_names[mypc.mapSpeciesBackTransformedDiagnostics(i)]; const std::string fullpath = file_name + "/" + species_name; if (!UtilCreateDirectory(fullpath, 0755)) CreateDirectoryFailed(fullpath); @@ -1302,7 +1302,7 @@ LabFrameSlice(Real t_lab_in, Real t_boost, Real inv_gamma_boost_in, dx_ = cell_dx; dy_ = cell_dy; - if (WarpX::do_boosted_frame_fields) data_buffer_.reset(nullptr); + if (WarpX::do_back_transformed_fields) data_buffer_.reset(nullptr); } void diff --git a/Source/Diagnostics/Make.package b/Source/Diagnostics/Make.package index dfd947d53..b624d6ebe 100644 --- a/Source/Diagnostics/Make.package +++ b/Source/Diagnostics/Make.package @@ -1,9 +1,9 @@ CEXE_sources += WarpXIO.cpp -CEXE_sources += BoostedFrameDiagnostic.cpp +CEXE_sources += BackTransformedDiagnostic.cpp CEXE_sources += ParticleIO.cpp CEXE_sources += FieldIO.cpp CEXE_headers += FieldIO.H -CEXE_headers += BoostedFrameDiagnostic.H +CEXE_headers += BackTransformedDiagnostic.H CEXE_headers += ElectrostaticIO.cpp CEXE_headers += SliceDiagnostic.H CEXE_sources += SliceDiagnostic.cpp diff --git a/Source/Evolve/WarpXEvolveEM.cpp b/Source/Evolve/WarpXEvolveEM.cpp index 7a3262703..b5fd52bdc 100644 --- a/Source/Evolve/WarpXEvolveEM.cpp +++ b/Source/Evolve/WarpXEvolveEM.cpp @@ -141,9 +141,9 @@ WarpX::EvolveEM (int numsteps) bool do_insitu = ((step+1) >= insitu_start) && (insitu_int > 0) && ((step+1) % insitu_int == 0); - if (do_boosted_frame_diagnostic) { + if (do_back_transformed_diagnostics) { std::unique_ptr cell_centered_data = nullptr; - if (WarpX::do_boosted_frame_fields) { + if (WarpX::do_back_transformed_fields) { cell_centered_data = GetCellCenteredData(); } myBFD->writeLabFrameData(cell_centered_data.get(), *mypc, geom[0], cur_time, dt[0]); @@ -261,7 +261,7 @@ WarpX::EvolveEM (int numsteps) WriteCheckPointFile(); } - if (do_boosted_frame_diagnostic) { + if (do_back_transformed_diagnostics) { myBFD->Flush(geom[0]); } diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 78eaebfc5..6224d5348 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -82,14 +82,14 @@ WarpX::InitData () void WarpX::InitDiagnostics () { - if (do_boosted_frame_diagnostic) { + if (do_back_transformed_diagnostics) { const Real* current_lo = geom[0].ProbLo(); const Real* current_hi = geom[0].ProbHi(); Real dt_boost = dt[0]; // Find the positions of the lab-frame box that corresponds to the boosted-frame box at t=0 Real zmin_lab = current_lo[moving_window_dir]/( (1.+beta_boost)*gamma_boost ); Real zmax_lab = current_hi[moving_window_dir]/( (1.+beta_boost)*gamma_boost ); - myBFD.reset(new BoostedFrameDiagnostic(zmin_lab, + myBFD.reset(new BackTransformedDiagnostic(zmin_lab, zmax_lab, moving_window_v, dt_snapshots_lab, num_snapshots_lab, diff --git a/Source/Laser/LaserParticleContainer.cpp b/Source/Laser/LaserParticleContainer.cpp index 8571c74ad..b9ab20197 100644 --- a/Source/Laser/LaserParticleContainer.cpp +++ b/Source/Laser/LaserParticleContainer.cpp @@ -26,7 +26,7 @@ LaserParticleContainer::LaserParticleContainer (AmrCore* amr_core, int ispecies, { charge = 1.0; mass = std::numeric_limits::max(); - do_boosted_frame_diags = 0; + do_back_transformed_diagnostics = 0; ParmParse pp(laser_name); diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H index 949173052..30f7354d0 100644 --- a/Source/Particles/MultiParticleContainer.H +++ b/Source/Particles/MultiParticleContainer.H @@ -162,9 +162,9 @@ public: int nSpecies() const {return nspecies;} - int nSpeciesBoostedFrameDiags() const {return nspecies_boosted_frame_diags;} - int mapSpeciesBoostedFrameDiags(int i) const {return map_species_boosted_frame_diags[i];} - int doBoostedFrameDiags() const {return do_boosted_frame_diags;} + int nSpeciesBackTransformedDiagnostics() const {return nspecies_back_transformed_diagnostics;} + int mapSpeciesBackTransformedDiagnostics(int i) const {return map_species_back_transformed_diagnostics[i];} + int doBackTransformedDiagnostics() const {return do_back_transformed_diagnostics;} int nSpeciesDepositOnMainGrid () const { bool const onMainGrid = true; @@ -236,12 +236,12 @@ private: void mapSpeciesProduct (); int getSpeciesID (std::string product_str); - // Number of species dumped in BoostedFrameDiagnostics - int nspecies_boosted_frame_diags = 0; - // map_species_boosted_frame_diags[i] is the species ID in - // MultiParticleContainer for 0 map_species_boosted_frame_diags; - int do_boosted_frame_diags = 0; + // Number of species dumped in BackTransformedDiagnostics + int nspecies_back_transformed_diagnostics = 0; + // map_species_back_transformed_diagnostics[i] is the species ID in + // MultiParticleContainer for 0 map_species_back_transformed_diagnostics; + int do_back_transformed_diagnostics = 0; // runtime parameters int nlasers = 0; diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index f4c00404b..63aa500e9 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -38,14 +38,14 @@ MultiParticleContainer::MultiParticleContainer (AmrCore* amr_core) // Compute the number of species for which lab-frame data is dumped // nspecies_lab_frame_diags, and map their ID to MultiParticleContainer // particle IDs in map_species_lab_diags. - map_species_boosted_frame_diags.resize(nspecies); - nspecies_boosted_frame_diags = 0; + map_species_back_transformed_diagnostics.resize(nspecies); + nspecies_back_transformed_diagnostics = 0; for (int i=0; ido_boosted_frame_diags){ - map_species_boosted_frame_diags[nspecies_boosted_frame_diags] = i; - do_boosted_frame_diags = 1; - nspecies_boosted_frame_diags += 1; + if (pc->do_back_transformed_diagnostics){ + map_species_back_transformed_diagnostics[nspecies_back_transformed_diagnostics] = i; + do_back_transformed_diagnostics = 1; + nspecies_back_transformed_diagnostics += 1; } } } @@ -387,8 +387,8 @@ MultiParticleContainer BL_PROFILE("MultiParticleContainer::GetLabFrameData"); // Loop over particle species - for (int i = 0; i < nspecies_boosted_frame_diags; ++i){ - int isp = map_species_boosted_frame_diags[i]; + for (int i = 0; i < nspecies_back_transformed_diagnostics; ++i){ + int isp = map_species_back_transformed_diagnostics[i]; WarpXParticleContainer* pc = allcontainers[isp].get(); WarpXParticleContainer::DiagnosticParticles diagnostic_particles; pc->GetParticleSlice(direction, z_old, z_new, t_boost, t_lab, dt, diagnostic_particles); @@ -603,9 +603,9 @@ namespace } // --- product runtime attribs GpuArray runtime_attribs_product; - bool do_boosted_product = WarpX::do_boosted_frame_diagnostic - && pc_product->DoBoostedFrameDiags(); - if (do_boosted_product) { + bool do_back_transformed_product = WarpX::do_back_transformed_diagnostics + && pc_product->doBackTransformedDiagnostics(); + if (do_back_transformed_product) { std::map comps_product = pc_product->getParticleComps(); runtime_attribs_product[0] = soa_product.GetRealData(comps_product[ "xold"]).data() + np_product_old; runtime_attribs_product[1] = soa_product.GetRealData(comps_product[ "yold"]).data() + np_product_old; @@ -652,7 +652,7 @@ namespace // Update xold etc. if boosted frame diagnostics required // for product species. Fill runtime attribs with a copy of // current properties (xold = x etc.). - if (do_boosted_product) { + if (do_back_transformed_product) { runtime_attribs_product[0][ip] = p_source.pos(0); runtime_attribs_product[1][ip] = p_source.pos(1); runtime_attribs_product[2][ip] = p_source.pos(2); diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index cf2ffbec4..612da01ca 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -73,7 +73,7 @@ PhotonParticleContainer::PushPX(WarpXParIter& pti, const ParticleReal* const AMREX_RESTRICT By = attribs[PIdx::By].dataPtr(); const ParticleReal* const AMREX_RESTRICT Bz = attribs[PIdx::Bz].dataPtr(); - if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags) + if (WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics) { copy_attribs(pti, x, y, z); } diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index d12a4dbff..d451ed32b 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -43,7 +43,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp pp.query("do_continuous_injection", do_continuous_injection); // Whether to plot back-transformed (lab-frame) diagnostics // for this species. - pp.query("do_boosted_frame_diags", do_boosted_frame_diags); + pp.query("do_back_transformed_diagnostics", do_back_transformed_diagnostics); pp.query("do_field_ionization", do_field_ionization); @@ -86,7 +86,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp //variable to set plot_flags size int plot_flag_size = PIdx::nattribs; - if(WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags) + if(WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics) plot_flag_size += 6; #ifdef WARPX_QED @@ -1078,7 +1078,7 @@ PhysicalParticleContainer::Evolve (int lev, bool has_buffer = cEx || cjx; - if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags) + if (WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics) { for (WarpXParIter pti(*this, lev); pti.isValid(); ++pti) { @@ -1585,7 +1585,7 @@ PhysicalParticleContainer::PushPX(WarpXParIter& pti, const ParticleReal* const AMREX_RESTRICT By = attribs[PIdx::By].dataPtr(); const ParticleReal* const AMREX_RESTRICT Bz = attribs[PIdx::Bz].dataPtr(); - if (WarpX::do_boosted_frame_diagnostic && do_boosted_frame_diags && (a_dt_type!=DtType::SecondHalf)) + if (WarpX::do_back_transformed_diagnostics && do_back_transformed_diagnostics && (a_dt_type!=DtType::SecondHalf)) { copy_attribs(pti, x, y, z); } @@ -1842,7 +1842,7 @@ void PhysicalParticleContainer::GetParticleSlice(const int direction, const Real // Note the the slice should always move in the negative boost direction. AMREX_ALWAYS_ASSERT(z_new < z_old); - AMREX_ALWAYS_ASSERT(do_boosted_frame_diags == 1); + AMREX_ALWAYS_ASSERT(do_back_transformed_diagnostics == 1); const int nlevs = std::max(0, finestLevel()+1); diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H index 879f4782e..8930cb176 100644 --- a/Source/Particles/WarpXParticleContainer.H +++ b/Source/Particles/WarpXParticleContainer.H @@ -273,7 +273,7 @@ public: AddIntComp(comm); } - int DoBoostedFrameDiags () const { return do_boosted_frame_diags; } + int doBackTransformedDiagnostics () const { return do_back_transformed_diagnostics; } virtual void buildIonizationMask (const amrex::MFIter& mfi, const int lev, amrex::Gpu::ManagedDeviceVector& ionization_mask) @@ -316,7 +316,7 @@ protected: amrex::Gpu::ManagedVector adk_exp_prefactor; std::string physical_element; - int do_boosted_frame_diags = 1; + int do_back_transformed_diagnostics = 1; #ifdef WARPX_QED bool do_qed = false; diff --git a/Source/WarpX.H b/Source/WarpX.H index 6ecc584a2..0084ba64c 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -4,7 +4,7 @@ #include "WarpXDtType.H" #include #include -#include +#include #include #include @@ -100,12 +100,12 @@ public: static bool serialize_ics; // Back transformation diagnostic - static bool do_boosted_frame_diagnostic; + static bool do_back_transformed_diagnostics; static std::string lab_data_directory; static int num_snapshots_lab; static amrex::Real dt_snapshots_lab; - static bool do_boosted_frame_fields; - static bool do_boosted_frame_particles; + static bool do_back_transformed_fields; + static bool do_back_transformed_particles; // Boosted frame parameters static amrex::Real gamma_boost; @@ -478,7 +478,7 @@ private: std::unique_ptr mypc; // Boosted Frame Diagnostics - std::unique_ptr myBFD; + std::unique_ptr myBFD; // // Fields: First array for level, second for direction diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 9ba0741bb..b329f5252 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -61,12 +61,12 @@ int WarpX::num_mirrors = 0; int WarpX::sort_int = -1; -bool WarpX::do_boosted_frame_diagnostic = false; +bool WarpX::do_back_transformed_diagnostics = false; std::string WarpX::lab_data_directory = "lab_frame_data"; int WarpX::num_snapshots_lab = std::numeric_limits::lowest(); Real WarpX::dt_snapshots_lab = std::numeric_limits::lowest(); -bool WarpX::do_boosted_frame_fields = true; -bool WarpX::do_boosted_frame_particles = true; +bool WarpX::do_back_transformed_fields = true; +bool WarpX::do_back_transformed_particles = true; int WarpX::num_slice_snapshots_lab = 0; Real WarpX::dt_slice_snapshots_lab; @@ -168,7 +168,7 @@ WarpX::WarpX () current_injection_position = geom[0].ProbLo(moving_window_dir); } } - do_boosted_frame_particles = mypc->doBoostedFrameDiags(); + do_back_transformed_particles = mypc->doBackTransformedDiagnostics(); Efield_aux.resize(nlevs_max); Bfield_aux.resize(nlevs_max); @@ -324,8 +324,8 @@ WarpX::ReadParameters () moving_window_v *= PhysConst::c; } - pp.query("do_boosted_frame_diagnostic", do_boosted_frame_diagnostic); - if (do_boosted_frame_diagnostic) { + pp.query("do_back_transformed_diagnostics", do_back_transformed_diagnostics); + if (do_back_transformed_diagnostics) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE(gamma_boost > 1.0, "gamma_boost must be > 1 to use the boosted frame diagnostic."); @@ -353,7 +353,7 @@ WarpX::ReadParameters () pp.get("gamma_boost", gamma_boost); - pp.query("do_boosted_frame_fields", do_boosted_frame_fields); + pp.query("do_back_transformed_fields", do_back_transformed_fields); AMREX_ALWAYS_ASSERT_WITH_MESSAGE(do_moving_window, "The moving window should be on if using the boosted frame diagnostic."); @@ -600,7 +600,7 @@ WarpX::ReadParameters () } } - if (do_boosted_frame_diagnostic) { + if (do_back_transformed_diagnostics) { AMREX_ALWAYS_ASSERT_WITH_MESSAGE(gamma_boost > 1.0, "gamma_boost must be > 1 to use the boost frame diagnostic"); pp.query("num_slice_snapshots_lab", num_slice_snapshots_lab); diff --git a/Tools/performance_tests/automated_test_4_labdiags_2ppc b/Tools/performance_tests/automated_test_4_labdiags_2ppc index 282c93331..bac071f63 100644 --- a/Tools/performance_tests/automated_test_4_labdiags_2ppc +++ b/Tools/performance_tests/automated_test_4_labdiags_2ppc @@ -35,7 +35,7 @@ warpx.gamma_boost = 15. warpx.boost_direction = z # Diagnostics -warpx.do_boosted_frame_diagnostic = 1 +warpx.do_back_transformed_diagnostics = 1 warpx.num_snapshots_lab = 20 warpx.dt_snapshots_lab = 7.0e-14 -- cgit v1.2.3 From fa33c9e67a23ca0cfc48a7a54fea5ec8fd0da015 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Wed, 30 Oct 2019 11:38:16 +0100 Subject: refactoring to comply with new style guidelines --- Source/Diagnostics/ParticleIO.cpp | 2 +- Source/Particles/MultiParticleContainer.H | 12 +-- Source/Particles/MultiParticleContainer.cpp | 36 ++++---- Source/Particles/PhotonParticleContainer.cpp | 6 +- Source/Particles/PhysicalParticleContainer.H | 8 +- Source/Particles/PhysicalParticleContainer.cpp | 24 +++--- Source/Particles/WarpXParticleContainer.H | 2 +- Source/QED/BreitWheelerEngineWrapper.H | 44 +++++----- Source/QED/BreitWheelerEngineWrapper.cpp | 114 ++++++++++++------------- Source/QED/QuantumSyncEngineWrapper.H | 44 +++++----- Source/QED/QuantumSyncEngineWrapper.cpp | 108 +++++++++++------------ 11 files changed, 200 insertions(+), 200 deletions(-) (limited to 'Source/Particles/PhotonParticleContainer.cpp') diff --git a/Source/Diagnostics/ParticleIO.cpp b/Source/Diagnostics/ParticleIO.cpp index d55660b39..3b7481b8c 100644 --- a/Source/Diagnostics/ParticleIO.cpp +++ b/Source/Diagnostics/ParticleIO.cpp @@ -113,7 +113,7 @@ MultiParticleContainer::WritePlotFile (const std::string& dir) const } #ifdef WARPX_QED - if(pc->do_qed){ + if(pc->m_do_qed){ real_names.push_back("tau"); } #endif diff --git a/Source/Particles/MultiParticleContainer.H b/Source/Particles/MultiParticleContainer.H index 7df0fbdf8..f9a0e51d7 100644 --- a/Source/Particles/MultiParticleContainer.H +++ b/Source/Particles/MultiParticleContainer.H @@ -220,8 +220,8 @@ protected: #ifdef WARPX_QED // The QED engines - std::shared_ptr shr_p_bw_engine; - std::shared_ptr shr_p_qs_engine; + std::shared_ptr m_shr_p_bw_engine; + std::shared_ptr m_shr_p_qs_engine; //_______________________________ /** @@ -231,19 +231,19 @@ protected: void InitQED (); //Variables to store how many species need a QED process - int nspecies_quantum_sync = 0; - int nspecies_breit_wheeler = 0; + int m_nspecies_quantum_sync = 0; + int m_nspecies_breit_wheeler = 0; //________ /** * Returns the number of species having Quantum Synchrotron process enabled */ - int NSpeciesQuantumSync() const { return nspecies_quantum_sync;} + int NSpeciesQuantumSync() const { return m_nspecies_quantum_sync;} /** * Returns the number of species having Breit Wheeler process enabled */ - int NSpeciesBreitWheeler() const { return nspecies_breit_wheeler;} + int NSpeciesBreitWheeler() const { return m_nspecies_breit_wheeler;} /** * Initializes the Quantum Synchrotron engine diff --git a/Source/Particles/MultiParticleContainer.cpp b/Source/Particles/MultiParticleContainer.cpp index a30d0699c..8dc969e8f 100644 --- a/Source/Particles/MultiParticleContainer.cpp +++ b/Source/Particles/MultiParticleContainer.cpp @@ -623,22 +623,22 @@ MultiParticleContainer::doFieldIonization () #ifdef WARPX_QED void MultiParticleContainer::InitQED () { - shr_p_qs_engine = std::make_shared(); - shr_p_bw_engine = std::make_shared(); + m_shr_p_qs_engine = std::make_shared(); + m_shr_p_bw_engine = std::make_shared(); - nspecies_quantum_sync = 0; - nspecies_breit_wheeler = 0; + m_nspecies_quantum_sync = 0; + m_nspecies_breit_wheeler = 0; for (auto& pc : allcontainers) { if(pc->has_quantum_sync()){ pc->set_quantum_sync_engine_ptr - (shr_p_qs_engine); - nspecies_quantum_sync++; + (m_shr_p_qs_engine); + m_nspecies_quantum_sync++; } if(pc->has_breit_wheeler()){ pc->set_breit_wheeler_engine_ptr - (shr_p_bw_engine); - nspecies_breit_wheeler++; + (m_shr_p_bw_engine); + m_nspecies_breit_wheeler++; } } @@ -666,8 +666,8 @@ void MultiParticleContainer::InitQuantumSync () if(generate_table && ParallelDescriptor::IOProcessor()){ - shr_p_qs_engine->compute_lookup_tables(ctrl); - Vector all_data = shr_p_qs_engine->export_lookup_tables_data(); + m_shr_p_qs_engine->compute_lookup_tables(ctrl); + Vector all_data = m_shr_p_qs_engine->export_lookup_tables_data(); WarpXUtilIO::WriteBinaryDataOnFile(filename, all_data); } ParallelDescriptor::Barrier(); @@ -679,10 +679,10 @@ void MultiParticleContainer::InitQuantumSync () //No need to initialize from raw data for the processor that //has just generated the table if(!generate_table || !ParallelDescriptor::IOProcessor()){ - shr_p_qs_engine->init_lookup_tables_from_raw_data(table_data); + m_shr_p_qs_engine->init_lookup_tables_from_raw_data(table_data); } - if(!shr_p_qs_engine->are_lookup_tables_initialized()) + if(!m_shr_p_qs_engine->are_lookup_tables_initialized()) amrex::Error("Table initialization has failed!\n"); } @@ -701,8 +701,8 @@ void MultiParticleContainer::InitBreitWheeler () //_________________________________________________ if(generate_table && ParallelDescriptor::IOProcessor()){ - shr_p_bw_engine->compute_lookup_tables(ctrl); - Vector all_data =shr_p_bw_engine->export_lookup_tables_data(); + m_shr_p_bw_engine->compute_lookup_tables(ctrl); + Vector all_data = m_shr_p_bw_engine->export_lookup_tables_data(); WarpXUtilIO::WriteBinaryDataOnFile(filename, all_data); } ParallelDescriptor::Barrier(); @@ -714,10 +714,10 @@ void MultiParticleContainer::InitBreitWheeler () //No need to initialize from raw data for the processor that //has just generated the table if(!generate_table || !ParallelDescriptor::IOProcessor()){ - shr_p_bw_engine->init_lookup_tables_from_raw_data(table_data); + m_shr_p_bw_engine->init_lookup_tables_from_raw_data(table_data); } - if(!shr_p_bw_engine->are_lookup_tables_initialized()) + if(!m_shr_p_bw_engine->are_lookup_tables_initialized()) amrex::Error("Table initialization has failed!\n"); } @@ -725,7 +725,7 @@ std::tuple MultiParticleContainer::ParseQuantumSyncParams () { PicsarQuantumSynchrotronCtrl ctrl = - shr_p_qs_engine->get_default_ctrl(); + m_shr_p_qs_engine->get_default_ctrl(); bool generate_table{false}; std::string table_name; @@ -783,7 +783,7 @@ std::tuple MultiParticleContainer::ParseBreitWheelerParams () { PicsarBreitWheelerCtrl ctrl = - shr_p_bw_engine->get_default_ctrl(); + m_shr_p_bw_engine->get_default_ctrl(); bool generate_table{false}; std::string table_name; diff --git a/Source/Particles/PhotonParticleContainer.cpp b/Source/Particles/PhotonParticleContainer.cpp index 612da01ca..7e52b52e1 100644 --- a/Source/Particles/PhotonParticleContainer.cpp +++ b/Source/Particles/PhotonParticleContainer.cpp @@ -26,9 +26,9 @@ PhotonParticleContainer::PhotonParticleContainer (AmrCore* amr_core, int ispecie ParmParse pp(species_name); #ifdef WARPX_QED - //IF do_qed is enabled, find out if Breit Wheeler process is enabled - if(do_qed) - pp.query("do_qed_breit_wheeler", do_qed_breit_wheeler); + //IF m_do_qed is enabled, find out if Breit Wheeler process is enabled + if(m_do_qed) + pp.query("do_qed_breit_wheeler", m_do_qed_breit_wheeler); //Check for processes which do not make sense for photons bool test_quantum_sync = false; diff --git a/Source/Particles/PhysicalParticleContainer.H b/Source/Particles/PhysicalParticleContainer.H index ed3a698e2..17a504719 100644 --- a/Source/Particles/PhysicalParticleContainer.H +++ b/Source/Particles/PhysicalParticleContainer.H @@ -220,16 +220,16 @@ protected: #ifdef WARPX_QED // A flag to enable quantum_synchrotron process for leptons - bool do_qed_quantum_sync = false; + bool m_do_qed_quantum_sync = false; // A flag to enable breit_wheeler process [photons only!!] - bool do_qed_breit_wheeler = false; + bool m_do_qed_breit_wheeler = false; // A smart pointer to an instance of a Quantum Synchrotron engine - std::shared_ptr shr_ptr_qs_engine; + std::shared_ptr m_shr_p_qs_engine; // A smart pointer to an instance of a Breit Wheeler engine [photons only!] - std::shared_ptr shr_ptr_bw_engine; + std::shared_ptr m_shr_p_bw_engine; #endif }; diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index fed7266e1..51690d659 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -74,13 +74,13 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp #ifdef WARPX_QED //Add real component if QED is enabled - pp.query("do_qed", do_qed); - if(do_qed) + pp.query("do_qed", m_do_qed); + if(m_do_qed) AddRealComp("tau"); //IF do_qed is enabled, find out if Quantum Synchrotron process is enabled - if(do_qed) - pp.query("do_qed_quantum_sync", do_qed_quantum_sync); + if(m_do_qed) + pp.query("do_qed_quantum_sync", m_do_qed_quantum_sync); //TODO: SHOULD CHECK IF SPECIES IS EITHER ELECTRONS OR POSITRONS!! #endif @@ -91,7 +91,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp plot_flag_size += 6; #ifdef WARPX_QED - if(do_qed){ + if(m_do_qed){ // plot_flag will have an entry for the optical depth plot_flag_size++; } @@ -123,7 +123,7 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp } #ifdef WARPX_QED - if(do_qed){ + if(m_do_qed){ //Optical depths is always plotted if QED is on plot_flags[plot_flag_size-1] = 1; } @@ -544,11 +544,11 @@ PhysicalParticleContainer::AddPlasma (int lev, RealBox part_realbox) BreitWheelerGetOpticalDepth breit_wheeler_get_opt; if(loc_has_quantum_sync){ quantum_sync_get_opt = - shr_ptr_qs_engine->build_optical_depth_functor(); + m_shr_p_qs_engine->build_optical_depth_functor(); } if(loc_has_breit_wheeler){ breit_wheeler_get_opt = - shr_ptr_bw_engine->build_optical_depth_functor(); + m_shr_p_bw_engine->build_optical_depth_functor(); } #endif @@ -2238,25 +2238,25 @@ PhysicalParticleContainer::AmIALepton(){ bool PhysicalParticleContainer::has_quantum_sync() { - return do_qed_quantum_sync; + return m_do_qed_quantum_sync; } bool PhysicalParticleContainer::has_breit_wheeler() { - return do_qed_breit_wheeler; + return m_do_qed_breit_wheeler; } void PhysicalParticleContainer:: set_breit_wheeler_engine_ptr(std::shared_ptr ptr) { - shr_ptr_bw_engine = ptr; + m_shr_p_bw_engine = ptr; } void PhysicalParticleContainer:: set_quantum_sync_engine_ptr(std::shared_ptr ptr) { - shr_ptr_qs_engine = ptr; + m_shr_p_qs_engine = ptr; } #endif diff --git a/Source/Particles/WarpXParticleContainer.H b/Source/Particles/WarpXParticleContainer.H index b41dcede3..dbd913c5b 100644 --- a/Source/Particles/WarpXParticleContainer.H +++ b/Source/Particles/WarpXParticleContainer.H @@ -320,7 +320,7 @@ protected: int do_back_transformed_diagnostics = 1; #ifdef WARPX_QED - bool do_qed = false; + bool m_do_qed = false; virtual bool has_quantum_sync(){return false;}; virtual bool has_breit_wheeler(){return false;}; diff --git a/Source/QED/BreitWheelerEngineWrapper.H b/Source/QED/BreitWheelerEngineWrapper.H index 3badf78c3..86fdbb1b4 100644 --- a/Source/QED/BreitWheelerEngineWrapper.H +++ b/Source/QED/BreitWheelerEngineWrapper.H @@ -79,8 +79,8 @@ public: size_t TTfunc_size, amrex::Real* TTfunc_coords, amrex::Real* TTfunc_data): - ctrl{t_ctrl}, - lookup_table{ + m_ctrl{t_ctrl}, + m_lookup_table{ TTfunc_size, TTfunc_coords, TTfunc_data @@ -103,7 +103,7 @@ public: amrex::Real bx, amrex::Real by, amrex::Real bz, amrex::Real dt, amrex::Real& opt_depth) const { - bool has_event_happend{false}; + bool has_event_happened{false}; //the library provides the time (< dt) at which the event occurs, but this //feature won't be used in WarpX for now. @@ -115,20 +115,20 @@ public: ex, ey, ez, bx, by, bz, dt, opt_depth, - has_event_happend, unused_event_time, - dummy_lambda, - lookup_table, - ctrl); + has_event_happened, unused_event_time, + m_dummy_lambda, + m_lookup_table, + m_ctrl); - return has_event_happend; + return has_event_happened; } private: //laser wavelenght is not used with SI units - const amrex::Real dummy_lambda{1.0}; + const amrex::Real m_dummy_lambda{1.0}; - const PicsarBreitWheelerCtrl ctrl; - const picsar::multi_physics::lookup_1d lookup_table; + const PicsarBreitWheelerCtrl m_ctrl; + const picsar::multi_physics::lookup_1d m_lookup_table; }; /** @@ -146,8 +146,8 @@ public: */ BreitWheelerGeneratePairs( BreitWheelerEngineInnards& r_innards): - ctrl{r_innards.ctrl}, - lookup_table{ + m_ctrl{r_innards.ctrl}, + m_lookup_table{ r_innards.cum_distrib_coords_1.size(), r_innards.cum_distrib_coords_1.data(), r_innards.cum_distrib_coords_2.size(), @@ -192,18 +192,18 @@ public: e_px, e_py, e_pz, p_px, p_py, p_pz, e_weight, p_weight, - dummy_lambda, - lookup_table, - ctrl, + m_dummy_lambda, + m_lookup_table, + m_ctrl, rand_zero_one_minus_epsi.data()); } private: //laser wavelenght is not used with SI units - const amrex::Real dummy_lambda{1.0}; + const amrex::Real m_dummy_lambda{1.0}; - const PicsarBreitWheelerCtrl ctrl; - const picsar::multi_physics::lookup_2d lookup_table; + const PicsarBreitWheelerCtrl m_ctrl; + const picsar::multi_physics::lookup_2d m_lookup_table; }; // Factory class ============================= @@ -266,13 +266,13 @@ public: PicsarBreitWheelerCtrl get_default_ctrl() const; private: - bool lookup_tables_initialized = false; + bool m_lookup_tables_initialized = false; - BreitWheelerEngineInnards innards; + BreitWheelerEngineInnards m_innards; //Table builing is available only if WarpX is compiled with QED_TABLE_GEN=TRUE #ifdef WARPX_QED_TABLE_GEN - BreitWheelerEngineTableBuilder table_builder; + BreitWheelerEngineTableBuilder m_table_builder; #endif }; diff --git a/Source/QED/BreitWheelerEngineWrapper.cpp b/Source/QED/BreitWheelerEngineWrapper.cpp index f84754462..76d28d66a 100644 --- a/Source/QED/BreitWheelerEngineWrapper.cpp +++ b/Source/QED/BreitWheelerEngineWrapper.cpp @@ -24,25 +24,25 @@ BreitWheelerEngine::build_optical_depth_functor () BreitWheelerEvolveOpticalDepth BreitWheelerEngine::build_evolve_functor () { - AMREX_ALWAYS_ASSERT(lookup_tables_initialized); + AMREX_ALWAYS_ASSERT(m_lookup_tables_initialized); - return BreitWheelerEvolveOpticalDepth(innards.ctrl, - innards.TTfunc_coords.size(), - innards.TTfunc_coords.dataPtr(), - innards.TTfunc_data.dataPtr() ); + return BreitWheelerEvolveOpticalDepth(m_innards.ctrl, + m_innards.TTfunc_coords.size(), + m_innards.TTfunc_coords.dataPtr(), + m_innards.TTfunc_data.dataPtr() ); } BreitWheelerGeneratePairs BreitWheelerEngine::build_pair_functor () { - AMREX_ALWAYS_ASSERT(lookup_tables_initialized); + AMREX_ALWAYS_ASSERT(m_lookup_tables_initialized); - return BreitWheelerGeneratePairs(innards); + return BreitWheelerGeneratePairs(m_innards); } bool BreitWheelerEngine::are_lookup_tables_initialized () const { - return lookup_tables_initialized; + return m_lookup_tables_initialized; } bool @@ -54,91 +54,91 @@ BreitWheelerEngine::init_lookup_tables_from_raw_data ( bool is_ok; //Header (control parameters) - tie(is_ok, innards.ctrl.chi_phot_min, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_phot_min, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_phot_tdndt_min, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_phot_tdndt_min, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_phot_tdndt_max, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_phot_tdndt_max, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_phot_tdndt_how_many, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_phot_tdndt_how_many, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_phot_tpair_min, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_phot_tpair_min, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_phot_tpair_max, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_phot_tpair_max, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_phot_tpair_how_many, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_phot_tpair_how_many, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_frac_tpair_how_many, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_frac_tpair_how_many, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; //___________________________ //Data - Vector tndt_coords(innards.ctrl.chi_phot_tdndt_how_many); - Vector tndt_data(innards.ctrl.chi_phot_tdndt_how_many); - Vector cum_tab_coords1(innards.ctrl.chi_phot_tpair_how_many); - Vector cum_tab_coords2(innards.ctrl.chi_frac_tpair_how_many); - Vector cum_tab_data(innards.ctrl.chi_phot_tpair_how_many* - innards.ctrl.chi_frac_tpair_how_many); + Vector tndt_coords(m_innards.ctrl.chi_phot_tdndt_how_many); + Vector tndt_data(m_innards.ctrl.chi_phot_tdndt_how_many); + Vector cum_tab_coords1(m_innards.ctrl.chi_phot_tpair_how_many); + Vector cum_tab_coords2(m_innards.ctrl.chi_frac_tpair_how_many); + Vector cum_tab_data(m_innards.ctrl.chi_phot_tpair_how_many* + m_innards.ctrl.chi_frac_tpair_how_many); tie(is_ok, tndt_coords, p_data) = parse_raw_data_vec( p_data, tndt_coords.size(), p_last); if(!is_ok) return false; - innards.TTfunc_coords.assign(tndt_coords.begin(), tndt_coords.end()); + m_innards.TTfunc_coords.assign(tndt_coords.begin(), tndt_coords.end()); tie(is_ok, tndt_data, p_data) = parse_raw_data_vec( p_data, tndt_data.size(), p_last); if(!is_ok) return false; - innards.TTfunc_data.assign(tndt_data.begin(), tndt_data.end()); + m_innards.TTfunc_data.assign(tndt_data.begin(), tndt_data.end()); tie(is_ok, cum_tab_coords1, p_data) = parse_raw_data_vec( p_data, cum_tab_coords1.size(), p_last); if(!is_ok) return false; - innards.cum_distrib_coords_1.assign( + m_innards.cum_distrib_coords_1.assign( cum_tab_coords1.begin(), cum_tab_coords1.end()); tie(is_ok, cum_tab_coords2, p_data) = parse_raw_data_vec( p_data, cum_tab_coords2.size(), p_last); if(!is_ok) return false; - innards.cum_distrib_coords_2.assign( + m_innards.cum_distrib_coords_2.assign( cum_tab_coords2.begin(), cum_tab_coords2.end()); tie(is_ok, cum_tab_data, p_data) = parse_raw_data_vec( p_data, cum_tab_data.size(), p_last); if(!is_ok) return false; - innards.cum_distrib_data.assign( + m_innards.cum_distrib_data.assign( cum_tab_data.begin(), cum_tab_data.end()); //___________________________ - lookup_tables_initialized = true; + m_lookup_tables_initialized = true; return true; } @@ -147,7 +147,7 @@ Vector BreitWheelerEngine::export_lookup_tables_data () const { Vector res{}; - if(!lookup_tables_initialized) + if(!m_lookup_tables_initialized) return res; auto add_data_to_buf = [&res](auto data){ @@ -157,14 +157,14 @@ Vector BreitWheelerEngine::export_lookup_tables_data () const sizeof(data)); }; - add_data_to_buf(innards.ctrl.chi_phot_min); - add_data_to_buf(innards.ctrl.chi_phot_tdndt_min); - add_data_to_buf(innards.ctrl.chi_phot_tdndt_max); - add_data_to_buf(innards.ctrl.chi_phot_tdndt_how_many); - add_data_to_buf(innards.ctrl.chi_phot_tpair_min); - add_data_to_buf(innards.ctrl.chi_phot_tpair_max); - add_data_to_buf(innards.ctrl.chi_phot_tpair_how_many); - add_data_to_buf(innards.ctrl.chi_frac_tpair_how_many); + add_data_to_buf(m_innards.ctrl.chi_phot_min); + add_data_to_buf(m_innards.ctrl.chi_phot_tdndt_min); + add_data_to_buf(m_innards.ctrl.chi_phot_tdndt_max); + add_data_to_buf(m_innards.ctrl.chi_phot_tdndt_how_many); + add_data_to_buf(m_innards.ctrl.chi_phot_tpair_min); + add_data_to_buf(m_innards.ctrl.chi_phot_tpair_max); + add_data_to_buf(m_innards.ctrl.chi_phot_tpair_how_many); + add_data_to_buf(m_innards.ctrl.chi_frac_tpair_how_many); auto add_data_to_buf_vv = [&res](const auto* data, size_t how_many){ res.insert(res.end(), @@ -173,16 +173,16 @@ Vector BreitWheelerEngine::export_lookup_tables_data () const sizeof(*data)*how_many); }; - add_data_to_buf_vv(innards.TTfunc_coords.data(), - innards.TTfunc_coords.size()); - add_data_to_buf_vv(innards.TTfunc_data.data(), - innards.TTfunc_data.size()); - add_data_to_buf_vv(innards.cum_distrib_coords_1.data(), - innards.cum_distrib_coords_1.size()); - add_data_to_buf_vv(innards.cum_distrib_coords_2.data(), - innards.cum_distrib_coords_2.size()); - add_data_to_buf_vv(innards.cum_distrib_data.data(), - innards.cum_distrib_data.size()); + add_data_to_buf_vv(m_innards.TTfunc_coords.data(), + m_innards.TTfunc_coords.size()); + add_data_to_buf_vv(m_innards.TTfunc_data.data(), + m_innards.TTfunc_data.size()); + add_data_to_buf_vv(m_innards.cum_distrib_coords_1.data(), + m_innards.cum_distrib_coords_1.size()); + add_data_to_buf_vv(m_innards.cum_distrib_coords_2.data(), + m_innards.cum_distrib_coords_2.size()); + add_data_to_buf_vv(m_innards.cum_distrib_data.data(), + m_innards.cum_distrib_data.size()); return res; } @@ -197,8 +197,8 @@ void BreitWheelerEngine::compute_lookup_tables ( PicsarBreitWheelerCtrl ctrl) { #ifdef WARPX_QED_TABLE_GEN - table_builder.compute_table(ctrl, innards); - lookup_tables_initialized = true; + m_table_builder.compute_table(ctrl, m_innards); + m_lookup_tables_initialized = true; #endif } diff --git a/Source/QED/QuantumSyncEngineWrapper.H b/Source/QED/QuantumSyncEngineWrapper.H index 1d74e9bbb..7d7fe5b6b 100644 --- a/Source/QED/QuantumSyncEngineWrapper.H +++ b/Source/QED/QuantumSyncEngineWrapper.H @@ -79,8 +79,8 @@ public: */ QuantumSynchrotronEvolveOpticalDepth( QuantumSynchrotronEngineInnards& r_innards): - ctrl{r_innards.ctrl}, - lookup_table{ + m_ctrl{r_innards.ctrl}, + m_lookup_table{ r_innards.KKfunc_data.size(), r_innards.KKfunc_coords.data(), r_innards.KKfunc_data.data() @@ -103,7 +103,7 @@ public: amrex::Real bx, amrex::Real by, amrex::Real bz, amrex::Real dt, amrex::Real& opt_depth) const { - bool has_event_happend{false}; + bool has_event_happened{false}; //the library provides the time (< dt) at which the event occurs, but this //feature won't be used in WarpX for now. @@ -115,20 +115,20 @@ public: ex, ey, ez, bx, by, bz, dt, opt_depth, - has_event_happend, unused_event_time, - dummy_lambda, - lookup_table, - ctrl); + has_event_happened, unused_event_time, + m_dummy_lambda, + m_lookup_table, + m_ctrl); - return has_event_happend; + return has_event_happened; } private: //laser wavelenght is not used with SI units - const amrex::Real dummy_lambda{1.0}; + const amrex::Real m_dummy_lambda{1.0}; - const PicsarQuantumSynchrotronCtrl ctrl; - const picsar::multi_physics::lookup_1d lookup_table; + const PicsarQuantumSynchrotronCtrl m_ctrl; + const picsar::multi_physics::lookup_1d m_lookup_table; }; /** @@ -146,8 +146,8 @@ public: */ QuantumSynchrotronGeneratePhotonAndUpdateMomentum( QuantumSynchrotronEngineInnards& r_innards): - ctrl{r_innards.ctrl}, - lookup_table{ + m_ctrl{r_innards.ctrl}, + m_lookup_table{ r_innards.cum_distrib_coords_1.size(), r_innards.cum_distrib_coords_1.data(), r_innards.cum_distrib_coords_2.size(), @@ -189,18 +189,18 @@ public: weight, sampling, g_px, g_py, g_pz, g_weight, - dummy_lambda, - lookup_table, - ctrl, + m_dummy_lambda, + m_lookup_table, + m_ctrl, rand_zero_one_minus_epsi.data()); } private: //laser wavelenght is not used with SI units - const amrex::Real dummy_lambda{1.0}; + const amrex::Real m_dummy_lambda{1.0}; - const PicsarQuantumSynchrotronCtrl ctrl; - const picsar::multi_physics::lookup_2d lookup_table; + const PicsarQuantumSynchrotronCtrl m_ctrl; + const picsar::multi_physics::lookup_2d m_lookup_table; }; // Factory class ============================= @@ -263,13 +263,13 @@ public: PicsarQuantumSynchrotronCtrl get_default_ctrl() const; private: - bool lookup_tables_initialized = false; + bool m_lookup_tables_initialized = false; - QuantumSynchrotronEngineInnards innards; + QuantumSynchrotronEngineInnards m_innards; //Table builing is available only if the libray is compiled with QED_TABLE_GEN=TRUE #ifdef WARPX_QED_TABLE_GEN - QuantumSynchrotronEngineTableBuilder table_builder; + QuantumSynchrotronEngineTableBuilder m_table_builder; #endif }; diff --git a/Source/QED/QuantumSyncEngineWrapper.cpp b/Source/QED/QuantumSyncEngineWrapper.cpp index 13bc178d3..8606d19ae 100644 --- a/Source/QED/QuantumSyncEngineWrapper.cpp +++ b/Source/QED/QuantumSyncEngineWrapper.cpp @@ -23,22 +23,22 @@ QuantumSynchrotronEngine::build_optical_depth_functor () QuantumSynchrotronEvolveOpticalDepth QuantumSynchrotronEngine::build_evolve_functor () { - AMREX_ALWAYS_ASSERT(lookup_tables_initialized); + AMREX_ALWAYS_ASSERT(m_lookup_tables_initialized); - return QuantumSynchrotronEvolveOpticalDepth(innards); + return QuantumSynchrotronEvolveOpticalDepth(m_innards); } QuantumSynchrotronGeneratePhotonAndUpdateMomentum QuantumSynchrotronEngine::build_phot_em_functor () { - AMREX_ALWAYS_ASSERT(lookup_tables_initialized); + AMREX_ALWAYS_ASSERT(m_lookup_tables_initialized); - return QuantumSynchrotronGeneratePhotonAndUpdateMomentum(innards); + return QuantumSynchrotronGeneratePhotonAndUpdateMomentum(m_innards); } bool QuantumSynchrotronEngine::are_lookup_tables_initialized () const { - return lookup_tables_initialized; + return m_lookup_tables_initialized; } bool @@ -50,91 +50,91 @@ QuantumSynchrotronEngine::init_lookup_tables_from_raw_data ( bool is_ok; //Header (control parameters) - tie(is_ok, innards.ctrl.chi_part_min, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_part_min, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_part_tdndt_min, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_part_tdndt_min, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_part_tdndt_max, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_part_tdndt_max, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_part_tdndt_how_many, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_part_tdndt_how_many, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_part_tem_min, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_part_tem_min, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_part_tem_max, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_part_tem_max, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.chi_part_tem_how_many, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.chi_part_tem_how_many, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; - tie(is_ok, innards.ctrl.prob_tem_how_many, p_data) = - parse_raw_data( + tie(is_ok, m_innards.ctrl.prob_tem_how_many, p_data) = + parse_raw_data( p_data, p_last); if(!is_ok) return false; //___________________________ //Data - Vector tndt_coords(innards.ctrl.chi_part_tdndt_how_many); - Vector tndt_data(innards.ctrl.chi_part_tdndt_how_many); - Vector cum_tab_coords1(innards.ctrl.chi_part_tem_how_many); - Vector cum_tab_coords2(innards.ctrl.prob_tem_how_many); - Vector cum_tab_data(innards.ctrl.chi_part_tem_how_many* - innards.ctrl.prob_tem_how_many); + Vector tndt_coords(m_innards.ctrl.chi_part_tdndt_how_many); + Vector tndt_data(m_innards.ctrl.chi_part_tdndt_how_many); + Vector cum_tab_coords1(m_innards.ctrl.chi_part_tem_how_many); + Vector cum_tab_coords2(m_innards.ctrl.prob_tem_how_many); + Vector cum_tab_data(m_innards.ctrl.chi_part_tem_how_many* + m_innards.ctrl.prob_tem_how_many); tie(is_ok, tndt_coords, p_data) = parse_raw_data_vec( p_data, tndt_coords.size(), p_last); if(!is_ok) return false; - innards.KKfunc_coords.assign(tndt_coords.begin(), tndt_coords.end()); + m_innards.KKfunc_coords.assign(tndt_coords.begin(), tndt_coords.end()); tie(is_ok, tndt_data, p_data) = parse_raw_data_vec( p_data, tndt_data.size(), p_last); if(!is_ok) return false; - innards.KKfunc_data.assign(tndt_data.begin(), tndt_data.end()); + m_innards.KKfunc_data.assign(tndt_data.begin(), tndt_data.end()); tie(is_ok, cum_tab_coords1, p_data) = parse_raw_data_vec( p_data, cum_tab_coords1.size(), p_last); if(!is_ok) return false; - innards.cum_distrib_coords_1.assign( + m_innards.cum_distrib_coords_1.assign( cum_tab_coords1.begin(), cum_tab_coords1.end()); tie(is_ok, cum_tab_coords2, p_data) = parse_raw_data_vec( p_data, cum_tab_coords2.size(), p_last); if(!is_ok) return false; - innards.cum_distrib_coords_2.assign( + m_innards.cum_distrib_coords_2.assign( cum_tab_coords2.begin(), cum_tab_coords2.end()); tie(is_ok, cum_tab_data, p_data) = parse_raw_data_vec( p_data, cum_tab_data.size(), p_last); if(!is_ok) return false; - innards.cum_distrib_data.assign( + m_innards.cum_distrib_data.assign( cum_tab_data.begin(), cum_tab_data.end()); //___________________________ - lookup_tables_initialized = true; + m_lookup_tables_initialized = true; return true; } @@ -143,7 +143,7 @@ Vector QuantumSynchrotronEngine::export_lookup_tables_data () const { Vector res{}; - if(!lookup_tables_initialized) + if(!m_lookup_tables_initialized) return res; auto add_data_to_buf = [&res](auto data){ @@ -153,14 +153,14 @@ Vector QuantumSynchrotronEngine::export_lookup_tables_data () const sizeof(data)); }; - add_data_to_buf(innards.ctrl.chi_part_min); - add_data_to_buf(innards.ctrl.chi_part_tdndt_min); - add_data_to_buf(innards.ctrl.chi_part_tdndt_max); - add_data_to_buf(innards.ctrl.chi_part_tdndt_how_many); - add_data_to_buf(innards.ctrl.chi_part_tem_min); - add_data_to_buf(innards.ctrl.chi_part_tem_max); - add_data_to_buf(innards.ctrl.chi_part_tem_how_many); - add_data_to_buf(innards.ctrl.prob_tem_how_many); + add_data_to_buf(m_innards.ctrl.chi_part_min); + add_data_to_buf(m_innards.ctrl.chi_part_tdndt_min); + add_data_to_buf(m_innards.ctrl.chi_part_tdndt_max); + add_data_to_buf(m_innards.ctrl.chi_part_tdndt_how_many); + add_data_to_buf(m_innards.ctrl.chi_part_tem_min); + add_data_to_buf(m_innards.ctrl.chi_part_tem_max); + add_data_to_buf(m_innards.ctrl.chi_part_tem_how_many); + add_data_to_buf(m_innards.ctrl.prob_tem_how_many); auto add_data_to_buf_vv = [&res](const auto* data, size_t how_many){ res.insert(res.end(), @@ -169,16 +169,16 @@ Vector QuantumSynchrotronEngine::export_lookup_tables_data () const sizeof(*data)*how_many); }; - add_data_to_buf_vv(innards.KKfunc_coords.data(), - innards.KKfunc_coords.size()); - add_data_to_buf_vv(innards.KKfunc_data.data(), - innards.KKfunc_data.size()); - add_data_to_buf_vv(innards.cum_distrib_coords_1.data(), - innards.cum_distrib_coords_1.size()); - add_data_to_buf_vv(innards.cum_distrib_coords_2.data(), - innards.cum_distrib_coords_2.size()); - add_data_to_buf_vv(innards.cum_distrib_data.data(), - innards.cum_distrib_data.size()); + add_data_to_buf_vv(m_innards.KKfunc_coords.data(), + m_innards.KKfunc_coords.size()); + add_data_to_buf_vv(m_innards.KKfunc_data.data(), + m_innards.KKfunc_data.size()); + add_data_to_buf_vv(m_innards.cum_distrib_coords_1.data(), + m_innards.cum_distrib_coords_1.size()); + add_data_to_buf_vv(m_innards.cum_distrib_coords_2.data(), + m_innards.cum_distrib_coords_2.size()); + add_data_to_buf_vv(m_innards.cum_distrib_data.data(), + m_innards.cum_distrib_data.size()); return res; } @@ -193,8 +193,8 @@ void QuantumSynchrotronEngine::compute_lookup_tables ( PicsarQuantumSynchrotronCtrl ctrl) { #ifdef WARPX_QED_TABLE_GEN - table_builder.compute_table(ctrl, innards); - lookup_tables_initialized = true; + m_table_builder.compute_table(ctrl, m_innards); + m_lookup_tables_initialized = true; #endif } -- cgit v1.2.3