WarpX
InjectorMomentum.H
Go to the documentation of this file.
1 /* Copyright 2019-2020 Andrew Myers, Axel Huebl, Cameron Yang,
2  * Maxence Thevenet, Weiqun Zhang
3  *
4  * This file is part of WarpX.
5  *
6  * License: BSD-3-Clause-LBNL
7  */
8 #ifndef INJECTOR_MOMENTUM_H_
9 #define INJECTOR_MOMENTUM_H_
10 
11 #include "CustomMomentumProb.H"
12 #include "Parser/GpuParser.H"
13 #include "Utils/WarpXConst.H"
14 
15 #include <AMReX_Gpu.H>
16 #include <AMReX_Dim3.H>
17 
18 // struct whose getMomentum returns constant momentum.
20 {
21  InjectorMomentumConstant (amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
22  : m_ux(a_ux), m_uy(a_uy), m_uz(a_uz) {}
23 
24  AMREX_GPU_HOST_DEVICE
25  amrex::XDim3
26  getMomentum (amrex::Real, amrex::Real, amrex::Real,
27  amrex::RandomEngine const&) const noexcept
28  {
29  return amrex::XDim3{m_ux,m_uy,m_uz};
30  }
31 
32  AMREX_GPU_HOST_DEVICE
33  amrex::XDim3
34  getBulkMomentum (amrex::Real, amrex::Real, amrex::Real) const noexcept
35  {
36  return amrex::XDim3{m_ux,m_uy,m_uz};
37  }
38 
39 private:
40  amrex::Real m_ux, m_uy, m_uz;
41 };
42 
43 // struct whose getMomentum returns momentum for 1 particle, from random
44 // gaussian distribution.
46 {
47  InjectorMomentumGaussian (amrex::Real a_ux_m, amrex::Real a_uy_m,
48  amrex::Real a_uz_m, amrex::Real a_ux_th,
49  amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
50  : m_ux_m(a_ux_m), m_uy_m(a_uy_m), m_uz_m(a_uz_m),
51  m_ux_th(a_ux_th), m_uy_th(a_uy_th), m_uz_th(a_uz_th)
52  {}
53 
54  AMREX_GPU_HOST_DEVICE
55  amrex::XDim3
56  getMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/,
57  amrex::RandomEngine const& engine) const noexcept
58  {
59  return amrex::XDim3{amrex::RandomNormal(m_ux_m, m_ux_th, engine),
60  amrex::RandomNormal(m_uy_m, m_uy_th, engine),
61  amrex::RandomNormal(m_uz_m, m_uz_th, engine)};
62  }
63 
64  AMREX_GPU_HOST_DEVICE
65  amrex::XDim3
66  getBulkMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/) const noexcept
67  {
68  return amrex::XDim3{m_ux_m, m_uy_m, m_uz_m};
69  }
70 
71 private:
72  amrex::Real m_ux_m, m_uy_m, m_uz_m;
73  amrex::Real m_ux_th, m_uy_th, m_uz_th;
74 };
75 
76 // struct whose getMomentum returns momentum for 1 particle with relativistic
77 // drift velocity beta, from the Maxwell-Boltzmann distribution.
79 {
80  // Constructor whose inputs are:
81  // the temperature parameter theta,
82  // boost velocity/c beta,
83  // and boost direction dir respectively.
84  InjectorMomentumBoltzmann(amrex::Real t, amrex::Real b, int d) noexcept
85  : dir(d), beta(b), vave(std::sqrt(2.*t))
86  {}
87 
88  AMREX_GPU_HOST_DEVICE
89  amrex::XDim3
90  getMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/,
91  amrex::RandomEngine const& engine) const noexcept
92  {
93  amrex::Real x1, x2, gamma;
94  amrex::Real u[3];
95  x1 = amrex::Random(engine);
96  x2 = amrex::Random(engine);
97  // Each value of sqrt(-log(x1))*sin(2*pi*x2) is a sample from a Gaussian
98  // distribution with sigma = average velocity / c
99  // using the Box-Mueller Method.
100  u[(dir+1)%3] = vave*std::sqrt(-std::log(x1)) *std::sin(2*M_PI*x2);
101  u[(dir+2)%3] = vave*std::sqrt(-std::log(x1)) *std::cos(2*M_PI*x2);
102  u[dir] = vave*std::sqrt(-std::log(amrex::Random(engine)))*
103  std::sin(2*M_PI*amrex::Random(engine));
104  gamma = u[0]*u[0]+u[1]*u[1]+u[2]*u[2];
105  gamma = std::sqrt(1+gamma);
106  // The following condition is equtaion 32 in Zenitani 2015
107  // (Phys. Plasmas 22, 042116) , called the flipping method. It
108  // transforms the intergral: d3x' -> d3x where d3x' is the volume
109  // element for positions in the boosted frame. The particle positions
110  // and densities can be initialized in the simulation frame.
111  // The flipping method can transform any symmetric distribution from one
112  // reference frame to another moving at a relative velocity of beta.
113  // An equivalent alternative to this method native to WarpX would be to
114  // initialize the particle positions and densities in the frame moving
115  // at speed beta, and then perform a Lorentz transform on the positions
116  // and MB sampled velocities to the simulation frame.
117  x1 = amrex::Random(engine);
118  if(-beta*u[dir]/gamma > x1)
119  {
120  u[dir] = -u[dir];
121  }
122  // This Lorentz transform is equation 17 in Zenitani.
123  // It transforms the integral d3u' -> d3u
124  // where d3u' is the volume element for momentum in the boosted frame.
125  u[dir] = 1/std::sqrt(1-beta*beta)*(u[dir]+gamma*beta);
126  // Note that if beta = 0 then the flipping method and Lorentz transform
127  // have no effect on the u[dir] direction.
128  return amrex::XDim3 {u[0],u[1],u[2]};
129  }
130 
131  AMREX_GPU_HOST_DEVICE
132  amrex::XDim3
133  getBulkMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/) const noexcept
134  {
135  using namespace amrex;
136  Real u[3];
137  for (int idim = 0; idim < 3; ++idim) u[idim] = 0.0_rt;
138  const Real gamma = 1./sqrt(1+beta*beta);
139  u[dir] = gamma*beta;
140  return XDim3 {u[0],u[1],u[2]};
141  }
142 
143 private:
144  int dir;
145  amrex::Real beta, vave;
146 };
147 
148 // struct whose getMomentum returns momentum for 1 particle with relativistc
149 // drift velocity beta, from the Maxwell-Juttner distribution. Method is from
150 // Zenitani 2015 (Phys. Plasmas 22, 042116).
152 {
153  // Constructor whose inputs are:
154  // the temperature parameter theta,
155  // boost velocity/c beta,
156  // and boost direction dir respectively.
157  InjectorMomentumJuttner(amrex::Real t, amrex::Real b, int d) noexcept
158  : dir(d), beta(b), theta(t)
159  {}
160 
161  AMREX_GPU_HOST_DEVICE
162  amrex::XDim3
163  getMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/,
164  amrex::RandomEngine const& engine) const noexcept
165  {
166  // Sobol method for sampling MJ Speeds,
167  // from Zenitani 2015 (Phys. Plasmas 22, 042116).
168  amrex::Real x1, x2, gamma;
169  amrex::Real u [3];
170  x1 = 0.;
171  gamma = 0.;
172  u[dir] = 0.;
173  // This condition is equation 10 in Zenitani,
174  // though x1 is defined differently.
175  while(u[dir]-gamma <= x1)
176  {
177  u[dir] = -theta*
178  std::log(amrex::Random(engine)*amrex::Random(engine)*amrex::Random(engine));
179  gamma = std::sqrt(1+u[dir]*u[dir]);
180  x1 = theta*std::log(amrex::Random(engine));
181  }
182  // The following code samples a random unit vector
183  // and multiplies the result by speed u[dir].
184  x1 = amrex::Random(engine);
185  x2 = amrex::Random(engine);
186  // Direction dir is an input parameter that sets the boost direction:
187  // 'x' -> d = 0, 'y' -> d = 1, 'z' -> d = 2.
188  u[(dir+1)%3] = 2*u[dir]*std::sqrt(x1*(1-x1))*std::sin(2*M_PI*x2);
189  u[(dir+2)%3] = 2*u[dir]*std::sqrt(x1*(1-x1))*std::cos(2*M_PI*x2);
190  // The value of dir is the boost direction to be transformed.
191  u[dir] = u[dir]*(2*x1-1);
192  x1 = amrex::Random(engine);
193  // The following condition is equtaion 32 in Zenitani, called
194  // The flipping method. It transforms the intergral: d3x' -> d3x
195  // where d3x' is the volume element for positions in the boosted frame.
196  // The particle positions and densities can be initialized in the
197  // simulation frame with this method.
198  // The flipping method can similarly transform any
199  // symmetric distribution from one reference frame to another moving at
200  // a relative velocity of beta.
201  // An equivalent alternative to this method native to WarpX
202  // would be to initialize the particle positions and densities in the
203  // frame moving at speed beta, and then perform a Lorentz transform
204  // on their positions and MJ sampled velocities to the simulation frame.
205  if(-beta*u[dir]/gamma>x1)
206  {
207  u[dir] = -u[dir];
208  }
209  // This Lorentz transform is equation 17 in Zenitani.
210  // It transforms the integral d3u' -> d3u
211  // where d3u' is the volume element for momentum in the boosted frame.
212  u[dir] = 1/std::sqrt(1-beta*beta)*(u[dir]+gamma*beta);
213  // Note that if beta = 0 then the flipping method and Lorentz transform
214  // have no effect on the u[dir] direction.
215  return amrex::XDim3 {u[0],u[1],u[2]};
216  }
217 
218  AMREX_GPU_HOST_DEVICE
219  amrex::XDim3
220  getBulkMomentum (amrex::Real /*x*/, amrex::Real /*y*/, amrex::Real /*z*/) const noexcept
221  {
222  using namespace amrex;
223  Real u[3];
224  for (int idim = 0; idim < 3; ++idim) u[idim] = 0.0_rt;
225  const Real gamma = 1./sqrt(1+beta*beta);
226  u[dir] = gamma*beta;
227  return XDim3 {u[0],u[1],u[2]};
228  }
229 
230 private:
231  int dir;
232  amrex::Real beta, theta;
233 };
234 
243 {
244  InjectorMomentumRadialExpansion (amrex::Real a_u_over_r) noexcept
245  : u_over_r(a_u_over_r)
246  {}
247 
248  AMREX_GPU_HOST_DEVICE
249  amrex::XDim3
250  getMomentum (amrex::Real x, amrex::Real y, amrex::Real z,
251  amrex::RandomEngine const&) const noexcept
252  {
253  return {x*u_over_r, y*u_over_r, z*u_over_r};
254  }
255 
256  AMREX_GPU_HOST_DEVICE
257  amrex::XDim3
258  getBulkMomentum (amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
259  {
260  return {x*u_over_r, y*u_over_r, z*u_over_r};
261  }
262 
263 private:
264  amrex::Real u_over_r;
265 };
266 
267 // struct whose getMomentumm returns local momentum computed from parser.
269 {
270  InjectorMomentumParser (WarpXParser const& a_ux_parser,
271  WarpXParser const& a_uy_parser,
272  WarpXParser const& a_uz_parser) noexcept
273  : m_ux_parser(a_ux_parser), m_uy_parser(a_uy_parser),
274  m_uz_parser(a_uz_parser) {}
275 
276  AMREX_GPU_HOST_DEVICE
277  amrex::XDim3
278  getMomentum (amrex::Real x, amrex::Real y, amrex::Real z,
279  amrex::RandomEngine const&) const noexcept
280  {
281  return amrex::XDim3{m_ux_parser(x,y,z),m_uy_parser(x,y,z),m_uz_parser(x,y,z)};
282  }
283 
284  AMREX_GPU_HOST_DEVICE
285  amrex::XDim3
286  getBulkMomentum (amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
287  {
288  return amrex::XDim3{m_ux_parser(x,y,z),m_uy_parser(x,y,z),m_uz_parser(x,y,z)};
289  }
290 
291  GpuParser<3> m_ux_parser, m_uy_parser, m_uz_parser;
292 };
293 
294 // Base struct for momentum injector.
295 // InjectorMomentum contains a union (called Object) that holds any one
296 // instance of:
297 // - InjectorMomentumConstant : to generate constant density;
298 // - InjectorMomentumGaussian : to generate gaussian distribution;
299 // - InjectorMomentumRadialExpansion: to generate radial expansion;
300 // - InjectorMomentumParser : to generate momentum from parser;
301 // The choice is made at runtime, depending in the constructor called.
302 // This mimics virtual functions.
304 {
305  // This constructor stores a InjectorMomentumConstant in union object.
307  amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz)
308  : type(Type::constant),
309  object(t, a_ux, a_uy, a_uz)
310  { }
311 
312  // This constructor stores a InjectorMomentumParser in union object.
314  WarpXParser const& a_ux_parser,
315  WarpXParser const& a_uy_parser,
316  WarpXParser const& a_uz_parser)
317  : type(Type::parser),
318  object(t, a_ux_parser, a_uy_parser, a_uz_parser)
319  { }
320 
321  // This constructor stores a InjectorMomentumGaussian in union object.
323  amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m,
324  amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th)
325  : type(Type::gaussian),
326  object(t,a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th)
327  { }
328 
330  amrex::Real theta, amrex::Real beta, int dir)
331  : type(Type::boltzmann),
332  object(t, theta, beta, dir)
333  { }
334 
335  // This constructor stores a InjectorMomentumJuttner in union object.
337  amrex::Real theta, amrex::Real beta, int dir)
338  : type(Type::juttner),
339  object(t, theta, beta, dir)
340  { }
341 
342  // This constructor stores a InjectorMomentumCustom in union object.
344  std::string const& a_species_name)
345  : type(Type::custom),
346  object(t, a_species_name)
347  { }
348 
349  // This constructor stores a InjectorMomentumRadialExpansion in union object.
351  amrex::Real u_over_r)
352  : type(Type::radial_expansion),
353  object(t, u_over_r)
354  { }
355 
356  // Explicitly prevent the compiler from generating copy constructors
357  // and copy assignment operators.
358  InjectorMomentum (InjectorMomentum const&) = delete;
359  InjectorMomentum (InjectorMomentum&&) = delete;
360  void operator= (InjectorMomentum const&) = delete;
361  void operator= (InjectorMomentum &&) = delete;
362 
363  void clear ();
364 
365  // call getMomentum from the object stored in the union
366  // (the union is called Object, and the instance is called object).
367  AMREX_GPU_HOST_DEVICE
368  amrex::XDim3
369  getMomentum (amrex::Real x, amrex::Real y, amrex::Real z,
370  amrex::RandomEngine const& engine) const noexcept
371  {
372  switch (type)
373  {
374  case Type::parser:
375  {
376  return object.parser.getMomentum(x,y,z,engine);
377  }
378  case Type::gaussian:
379  {
380  return object.gaussian.getMomentum(x,y,z,engine);
381  }
382  case Type::boltzmann:
383  {
384  return object.boltzmann.getMomentum(x,y,z,engine);
385  }
386  case Type::juttner:
387  {
388  return object.juttner.getMomentum(x,y,z,engine);
389  }
390  case Type::constant:
391  {
392  return object.constant.getMomentum(x,y,z,engine);
393  }
394  case Type::radial_expansion:
395  {
396  return object.radial_expansion.getMomentum(x,y,z,engine);
397  }
398  case Type::custom:
399  {
400  return object.custom.getMomentum(x,y,z,engine);
401  }
402  default:
403  {
404  amrex::Abort("InjectorMomentum: unknown type");
405  return {0.0,0.0,0.0};
406  }
407  }
408  }
409 
410  // call getBulkMomentum from the object stored in the union
411  // (the union is called Object, and the instance is called object).
412  AMREX_GPU_HOST_DEVICE
413  amrex::XDim3
414  getBulkMomentum (amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
415  {
416  switch (type)
417  {
418  case Type::parser:
419  {
420  return object.parser.getBulkMomentum(x,y,z);
421  }
422  case Type::gaussian:
423  {
424  return object.gaussian.getBulkMomentum(x,y,z);
425  }
426  case Type::boltzmann:
427  {
428  return object.boltzmann.getBulkMomentum(x,y,z);
429  }
430  case Type::juttner:
431  {
432  return object.juttner.getBulkMomentum(x,y,z);
433  }
434  case Type::constant:
435  {
436  return object.constant.getBulkMomentum(x,y,z);
437  }
438  case Type::radial_expansion:
439  {
440  return object.radial_expansion.getBulkMomentum(x,y,z);
441  }
442  case Type::custom:
443  {
444  return object.custom.getBulkMomentum(x,y,z);
445  }
446  default:
447  {
448  amrex::Abort("InjectorMomentum: unknown type");
449  return {0.0,0.0,0.0};
450  }
451  }
452  }
453 
454 private:
455  enum struct Type { constant, custom, gaussian, boltzmann, juttner, radial_expansion, parser};
457 
458  // An instance of union Object constructs and stores any one of
459  // the objects declared (constant or custom or gaussian or
460  // radial_expansion or parser).
461  union Object {
463  amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
464  : constant(a_ux,a_uy,a_uz) {}
466  std::string const& a_species_name) noexcept
467  : custom(a_species_name) {}
469  amrex::Real a_ux_m, amrex::Real a_uy_m,
470  amrex::Real a_uz_m, amrex::Real a_ux_th,
471  amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
472  : gaussian(a_ux_m,a_uy_m,a_uz_m,a_ux_th,a_uy_th,a_uz_th) {}
474  amrex::Real t, amrex::Real b, int dir) noexcept
475  : boltzmann(t,b,dir) {}
477  amrex::Real t, amrex::Real b, int dir) noexcept
478  : juttner(t,b,dir) {}
480  amrex::Real u_over_r) noexcept
481  : radial_expansion(u_over_r) {}
483  WarpXParser const& a_ux_parser,
484  WarpXParser const& a_uy_parser,
485  WarpXParser const& a_uz_parser) noexcept
486  : parser(a_ux_parser, a_uy_parser, a_uz_parser) {}
494  };
496 };
497 
498 // In order for InjectorMomentum to be trivially copyable, its destructor
499 // must be trivial. So we have to rely on a custom deleter for unique_ptr.
501  void operator () (InjectorMomentum* p) const {
502  if (p) {
503  p->clear();
504  delete p;
505  }
506  }
507 };
508 
509 #endif
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Definition: InjectorMomentum.H:258
GpuParser< 3 > m_uz_parser
Definition: InjectorMomentum.H:291
InjectorMomentumConstant(amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
Definition: InjectorMomentum.H:21
parser
Definition: run_alltests.py:107
InjectorMomentumCustom custom
Definition: InjectorMomentum.H:488
InjectorMomentum(InjectorMomentumConstant *t, amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz)
Definition: InjectorMomentum.H:306
def x
Definition: read_lab_particles.py:25
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Definition: InjectorMomentum.H:414
InjectorMomentumGaussian gaussian
Definition: InjectorMomentum.H:489
InjectorMomentum(InjectorMomentumRadialExpansion *t, amrex::Real u_over_r)
Definition: InjectorMomentum.H:350
Type
Definition: InjectorMomentum.H:455
Definition: InjectorMomentum.H:268
void clear()
Definition: InjectorMomentum.cpp:14
InjectorMomentumRadialExpansion radial_expansion
Definition: InjectorMomentum.H:492
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real x, amrex::Real y, amrex::Real z, amrex::RandomEngine const &) const noexcept
Definition: InjectorMomentum.H:278
InjectorMomentumGaussian(amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
Definition: InjectorMomentum.H:47
InjectorMomentumParser parser
Definition: InjectorMomentum.H:493
struct whose getMomentum returns momentum for 1 particle, for radial expansion.
Definition: InjectorMomentum.H:242
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &engine) const noexcept
Definition: InjectorMomentum.H:56
Definition: InjectorMomentum.H:151
def z
Definition: read_lab_particles.py:26
InjectorMomentumConstant constant
Definition: InjectorMomentum.H:487
Object(InjectorMomentumCustom *, std::string const &a_species_name) noexcept
Definition: InjectorMomentum.H:465
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &engine) const noexcept
Definition: InjectorMomentum.H:163
Definition: InjectorMomentum.H:45
amrex::Real vave
Definition: InjectorMomentum.H:145
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &engine) const noexcept
Definition: InjectorMomentum.H:90
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition: InjectorMomentum.H:66
amrex::Real u_over_r
Definition: InjectorMomentum.H:264
InjectorMomentumJuttner(amrex::Real t, amrex::Real b, int d) noexcept
Definition: InjectorMomentum.H:157
Object(InjectorMomentumBoltzmann *, amrex::Real t, amrex::Real b, int dir) noexcept
Definition: InjectorMomentum.H:473
amrex::Real m_uy
Definition: InjectorMomentum.H:40
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real x, amrex::Real y, amrex::Real z, amrex::RandomEngine const &engine) const noexcept
Definition: InjectorMomentum.H:369
Definition: InjectorMomentum.H:461
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition: InjectorMomentum.H:133
amrex::Real m_uz
Definition: InjectorMomentum.H:40
Definition: InjectorMomentum.H:78
InjectorMomentumBoltzmann boltzmann
Definition: InjectorMomentum.H:490
InjectorMomentum(InjectorMomentumGaussian *t, amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th)
Definition: InjectorMomentum.H:322
Object(InjectorMomentumJuttner *, amrex::Real t, amrex::Real b, int dir) noexcept
Definition: InjectorMomentum.H:476
amrex::Real m_uz_m
Definition: InjectorMomentum.H:72
amrex::Real m_uz_th
Definition: InjectorMomentum.H:73
Definition: InjectorMomentum.H:500
type
Definition: run_alltests_1node.py:67
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Definition: InjectorMomentum.H:286
Object(InjectorMomentumConstant *, amrex::Real a_ux, amrex::Real a_uy, amrex::Real a_uz) noexcept
Definition: InjectorMomentum.H:462
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &) const noexcept
Definition: InjectorMomentum.H:26
int dir
Definition: InjectorMomentum.H:231
Definition: WarpXParser.H:26
Definition: InjectorMomentum.H:303
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition: InjectorMomentum.H:220
InjectorMomentumParser(WarpXParser const &a_ux_parser, WarpXParser const &a_uy_parser, WarpXParser const &a_uz_parser) noexcept
Definition: InjectorMomentum.H:270
InjectorMomentum(InjectorMomentumJuttner *t, amrex::Real theta, amrex::Real beta, int dir)
Definition: InjectorMomentum.H:336
InjectorMomentumRadialExpansion(amrex::Real a_u_over_r) noexcept
Definition: InjectorMomentum.H:244
InjectorMomentumJuttner juttner
Definition: InjectorMomentum.H:491
Definition: CustomMomentumProb.H:19
Definition: InjectorMomentum.H:19
Object object
Definition: InjectorMomentum.H:495
InjectorMomentum(InjectorMomentumCustom *t, std::string const &a_species_name)
Definition: InjectorMomentum.H:343
Type type
Definition: InjectorMomentum.H:456
Object(InjectorMomentumParser *, WarpXParser const &a_ux_parser, WarpXParser const &a_uy_parser, WarpXParser const &a_uz_parser) noexcept
Definition: InjectorMomentum.H:482
InjectorMomentum(InjectorMomentumParser *t, WarpXParser const &a_ux_parser, WarpXParser const &a_uy_parser, WarpXParser const &a_uz_parser)
Definition: InjectorMomentum.H:313
list x1
Definition: plot_particle_path.py:128
InjectorMomentumBoltzmann(amrex::Real t, amrex::Real b, int d) noexcept
Definition: InjectorMomentum.H:84
Definition: PML.H:52
amrex::Real theta
Definition: InjectorMomentum.H:232
InjectorMomentum(InjectorMomentumBoltzmann *t, amrex::Real theta, amrex::Real beta, int dir)
Definition: InjectorMomentum.H:329
int dir
Definition: InjectorMomentum.H:144
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition: InjectorMomentum.H:34
Object(InjectorMomentumRadialExpansion *, amrex::Real u_over_r) noexcept
Definition: InjectorMomentum.H:479
amrex::Real m_ux
Definition: InjectorMomentum.H:40
Object(InjectorMomentumGaussian *, amrex::Real a_ux_m, amrex::Real a_uy_m, amrex::Real a_uz_m, amrex::Real a_ux_th, amrex::Real a_uy_th, amrex::Real a_uz_th) noexcept
Definition: InjectorMomentum.H:468
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real x, amrex::Real y, amrex::Real z, amrex::RandomEngine const &) const noexcept
Definition: InjectorMomentum.H:250