diff options
author | 2020-03-27 09:48:08 -0700 | |
---|---|---|
committer | 2020-03-27 09:48:08 -0700 | |
commit | f19507218effe499581c2d22d2ab086de1245c6c (patch) | |
tree | b95f2682370fe8da47ec15e1bd30bca2286f37fd /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 035efd914eb3f3c92a126a47030061a1f0a191c6 (diff) | |
download | WarpX-f19507218effe499581c2d22d2ab086de1245c6c.tar.gz WarpX-f19507218effe499581c2d22d2ab086de1245c6c.tar.zst WarpX-f19507218effe499581c2d22d2ab086de1245c6c.zip |
[mini-PR] Read species distribution from OPMD file (#847)
* Added <species>.profile=external_file and .profile_file
* Added description of input parameters to Docs
* Changed from profile to injection option for external file
* Fix typo in amrex abort message (due to copy paste)
* Added the OpenPMD use amrex abort message
* Minor fix - not sure how to remove EOL issue
* Tried to add AddExternalFileBeam functon to PhysicalParticleContainer
* Trued to fix EOL white space issue
* Added read/print species name from OPMD file
* Update Source/Initialization/PlasmaInjector.cpp
Co-Authored-By: Axel Huebl <axel.huebl@plasma.ninja>
* Update Source/Particles/PhysicalParticleContainer.cpp
Co-Authored-By: Axel Huebl <axel.huebl@plasma.ninja>
* Update Source/Particles/PhysicalParticleContainer.cpp
Co-Authored-By: Axel Huebl <axel.huebl@plasma.ninja>
* Update Source/Particles/PhysicalParticleContainer.H
Co-Authored-By: Axel Huebl <axel.huebl@plasma.ninja>
* Update Source/Particles/PhysicalParticleContainer.cpp
Co-Authored-By: Axel Huebl <axel.huebl@plasma.ninja>
* No need to include openPMD header yet
* Fix EOL according to @ax3l's recommendation in #845
* Remove commented out AbortMessage
Co-Authored-By: MaxThevenet <mthevenet@lbl.gov>
* Removed commented out part initialization (used only in branch for next PR)
Co-Authored-By: MaxThevenet <mthevenet@lbl.gov>
* Added warning that this is WIP
Co-Authored-By: MaxThevenet <mthevenet@lbl.gov>
* Changed function name to AddPlasmaFromFile
* Removed AMReX warning from loop
Co-Authored-By: MaxThevenet <mthevenet@lbl.gov>
Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
Co-authored-by: MaxThevenet <mthevenet@lbl.gov>
Diffstat (limited to '')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index fe6fe80f2..0eb9b52df 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -310,6 +310,23 @@ PhysicalParticleContainer::AddGaussianBeam(Real x_m, Real y_m, Real z_m, } void +PhysicalParticleContainer::AddPlasmaFromFile(const std::string s_f) +{ +#ifdef WARPX_USE_OPENPMD + openPMD::Series series = openPMD::Series(s_f, openPMD::AccessType::READ_ONLY); + amrex::Print() << "openPMD standard version " << series.openPMD() << "\n"; + + openPMD::Iteration& i = series.iterations[1]; + amrex::Print() << "File contains " << i.particles.size() << " specie(s):" << "\n"; + for( auto const& ps : i.particles ) { + amrex::Print() << "\t" << ps.first << "\n"; + } + amrex::Print()<<"WARNING: this is WIP, no particle has been injected!!"; +#endif + return; +} + +void PhysicalParticleContainer::CheckAndAddParticle(Real x, Real y, Real z, std::array<Real, 3> u, Real weight, @@ -365,6 +382,11 @@ PhysicalParticleContainer::AddParticles (int lev) return; } + if (plasma_injector->external_file) { + AddPlasmaFromFile(plasma_injector->str_injection_file); + return; + } + if ( plasma_injector->doInjection() ) { AddPlasma( lev ); } |