aboutsummaryrefslogtreecommitdiff
path: root/Source/Initialization/CustomMomentumProb.H
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Initialization/CustomMomentumProb.H')
-rw-r--r--Source/Initialization/CustomMomentumProb.H30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/Initialization/CustomMomentumProb.H b/Source/Initialization/CustomMomentumProb.H
new file mode 100644
index 000000000..f8bc29a05
--- /dev/null
+++ b/Source/Initialization/CustomMomentumProb.H
@@ -0,0 +1,30 @@
+#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) 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