From 0ab4c72fe90e99487b6b151c9a2bc146aaf2c540 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Thu, 26 Sep 2024 21:05:12 +0100 Subject: [PATCH] Fix "wall_exp_decay" source for distributed MPI --- moment_kinetics/src/external_sources.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moment_kinetics/src/external_sources.jl b/moment_kinetics/src/external_sources.jl index e2551e6d7..4b8658582 100644 --- a/moment_kinetics/src/external_sources.jl +++ b/moment_kinetics/src/external_sources.jl @@ -407,8 +407,9 @@ function get_source_profile(profile_type, width, relative_minimum, coord) return profile elseif profile_type == "wall_exp_decay" x = coord.grid - return @. (1.0 - relative_minimum) * exp(-(x-x[1]) / width) + relative_minimum + - (1.0 - relative_minimum) * exp(-(x[end]-x) / width) + relative_minimum + L = coord.L + return @. (1.0 - relative_minimum) * exp(-(x+0.5*L) / width) + relative_minimum + + (1.0 - relative_minimum) * exp(-(0.5*L-x) / width) + relative_minimum else error("Unrecognised source profile type '$profile_type'.") end