diff options
Diffstat (limited to 'Source/Initialization/InjectorDensity.cpp')
-rw-r--r-- | Source/Initialization/InjectorDensity.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Initialization/InjectorDensity.cpp b/Source/Initialization/InjectorDensity.cpp index 78846215b..7fed85b75 100644 --- a/Source/Initialization/InjectorDensity.cpp +++ b/Source/Initialization/InjectorDensity.cpp @@ -24,6 +24,7 @@ InjectorDensity::~InjectorDensity () } } +// Compute the amount of memory needed in GPU Shared Memory. std::size_t InjectorDensity::sharedMemoryNeeded () const noexcept { @@ -31,6 +32,8 @@ InjectorDensity::sharedMemoryNeeded () const noexcept { case Type::parser: { + // For parser injector, the 3D position of each particle + // is stored in shared memory. return amrex::Gpu::numThreadsPerBlockParallelFor() * sizeof(double) * 3; } default: @@ -45,6 +48,8 @@ InjectorDensityPredefined::InjectorDensityPredefined ( ParmParse pp(a_species_name); std::vector<amrex::Real> v; + // Read parameters for the predefined plasma profile, + // and store them in managed memory pp.getarr("predefined_profile_params", v); p = static_cast<amrex::Real*> (amrex::The_Managed_Arena()->alloc(sizeof(amrex::Real)*v.size())); @@ -52,6 +57,7 @@ InjectorDensityPredefined::InjectorDensityPredefined ( p[i] = v[i]; } + // Parse predefined profile name, and update member variable profile. std::string which_profile_s; pp.query("predefined_profile_name", which_profile_s); std::transform(which_profile_s.begin(), which_profile_s.end(), |