ARTEMIS
CustomMomentumProb.H
Go to the documentation of this file.
1 /* Copyright 2019 Maxence Thevenet, Weiqun Zhang
2  *
3  * This file is part of WarpX.
4  *
5  * License: BSD-3-Clause-LBNL
6  */
7 #ifndef CUSTOM_MOMENTUM_PROB_H
8 #define CUSTOM_MOMENTUM_PROB_H
9 
10 #include <AMReX_Arena.H>
11 #include <AMReX_Dim3.H>
12 #include <AMReX_Gpu.H>
13 #include <AMReX_ParmParse.H>
14 
15 // An example of Custom Momentum Profile
16 
17 // struct whose getDensity returns momentum at a given position computed from
18 // a custom function.
20 {
21  InjectorMomentumCustom (std::string const& /*a_species_name*/) {}
22 
23  // Return momentum at given position (illustration: momentum=0).
26  getMomentum (amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const&) const noexcept
27  {
28  return {0., 0., 0.};
29  }
30 
31  // Return momentum at given position (illustration: momentum=0).
34  getBulkMomentum (amrex::Real, amrex::Real, amrex::Real) const noexcept
35  {
36  return {0., 0., 0.};
37  }
38 
39  // Note that we are not allowed to have non-trivial destructor.
40  // So we rely on clear() to free memory if needed.
41  void clear () { }
42 };
43 
44 #endif
#define AMREX_GPU_HOST_DEVICE
Definition: CustomMomentumProb.H:20
void clear()
Definition: CustomMomentumProb.H:41
AMREX_GPU_HOST_DEVICE amrex::XDim3 getBulkMomentum(amrex::Real, amrex::Real, amrex::Real) const noexcept
Definition: CustomMomentumProb.H:34
AMREX_GPU_HOST_DEVICE amrex::XDim3 getMomentum(amrex::Real, amrex::Real, amrex::Real, amrex::RandomEngine const &) const noexcept
Definition: CustomMomentumProb.H:26
InjectorMomentumCustom(std::string const &)
Definition: CustomMomentumProb.H:21