aboutsummaryrefslogtreecommitdiff
path: root/Source/WarpX.cpp
diff options
context:
space:
mode:
authorGravatar Remi Lehe <remi.lehe@normalesup.org> 2019-05-07 19:44:54 -0700
committerGravatar GitHub <noreply@github.com> 2019-05-07 19:44:54 -0700
commit5f2cfab237461821ee79c0ca17c506b07be95fbd (patch)
tree302396db649e9bf599db9e687912cb8a53a4bb79 /Source/WarpX.cpp
parent2b2286fa3221d14feed9961ddeaed70f54f7a4e8 (diff)
parent8ae480604c740fff0c28838ae84fdc31dc0c8254 (diff)
downloadWarpX-5f2cfab237461821ee79c0ca17c506b07be95fbd.tar.gz
WarpX-5f2cfab237461821ee79c0ca17c506b07be95fbd.tar.zst
WarpX-5f2cfab237461821ee79c0ca17c506b07be95fbd.zip
Merge pull request #119 from ECP-WarpX/inject_laser
Continuous injection for laser particles
Diffstat (limited to 'Source/WarpX.cpp')
-rw-r--r--Source/WarpX.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp
index 47ead98df..a3a24897a 100644
--- a/Source/WarpX.cpp
+++ b/Source/WarpX.cpp
@@ -145,13 +145,14 @@ WarpX::WarpX ()
// Particle Container
mypc = std::unique_ptr<MultiParticleContainer> (new MultiParticleContainer(this));
-
- if (do_plasma_injection) {
- for (int i = 0; i < num_injected_species; ++i) {
- int ispecies = injected_plasma_species[i];
- WarpXParticleContainer& pc = mypc->GetParticleContainer(ispecies);
- auto& ppc = dynamic_cast<PhysicalParticleContainer&>(pc);
- ppc.injected = true;
+ warpx_do_continuous_injection = mypc->doContinuousInjection();
+ if (warpx_do_continuous_injection){
+ if (moving_window_v >= 0){
+ // Inject particles continuously from the right end of the box
+ current_injection_position = geom[0].ProbHi(moving_window_dir);
+ } else {
+ // Inject particles continuously from the left end of the box
+ current_injection_position = geom[0].ProbLo(moving_window_dir);
}
}
@@ -300,21 +301,6 @@ WarpX::ReadParameters ()
moving_window_v *= PhysConst::c;
}
- pp.query("do_plasma_injection", do_plasma_injection);
- if (do_plasma_injection) {
- pp.get("num_injected_species", num_injected_species);
- injected_plasma_species.resize(num_injected_species);
- pp.getarr("injected_plasma_species", injected_plasma_species,
- 0, num_injected_species);
- if (moving_window_v >= 0){
- // Inject particles continuously from the right end of the box
- current_injection_position = geom[0].ProbHi(moving_window_dir);
- } else {
- // Inject particles continuously from the left end of the box
- current_injection_position = geom[0].ProbLo(moving_window_dir);
- }
- }
-
pp.query("do_boosted_frame_diagnostic", do_boosted_frame_diagnostic);
if (do_boosted_frame_diagnostic) {