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