diff options
Diffstat (limited to 'Source/Initialization/InjectorMomentum.cpp')
-rw-r--r-- | Source/Initialization/InjectorMomentum.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/Source/Initialization/InjectorMomentum.cpp b/Source/Initialization/InjectorMomentum.cpp new file mode 100644 index 000000000..f9070b29c --- /dev/null +++ b/Source/Initialization/InjectorMomentum.cpp @@ -0,0 +1,37 @@ +#include <PlasmaInjector.H> + +using namespace amrex; + +InjectorMomentum::~InjectorMomentum () +{ + switch (type) + { + case Type::parser: + { + object.parser.m_ux_parser.clear(); + object.parser.m_uy_parser.clear(); + object.parser.m_uz_parser.clear(); + break; + } + case Type::custom: + { + object.custom.clear(); + break; + } + } +} + +std::size_t +InjectorMomentum::sharedMemoryNeeded () const noexcept +{ + switch (type) + { + case Type::parser: + { + return amrex::Gpu::numThreadsPerBlockParallelFor() * sizeof(double); + } + default: + return 0; + } +} + |