From 8e2ecfe27b9d464dcd40031ae5ebc4e3781963e2 Mon Sep 17 00:00:00 2001 From: Yin-YinjianZhao Date: Mon, 14 Oct 2019 10:28:20 -0700 Subject: Add Higuera-Cary pusher --- Source/Utils/WarpXAlgorithmSelection.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Source/Utils/WarpXAlgorithmSelection.cpp') diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp index 8a6ff6dbf..4ad07f4f1 100644 --- a/Source/Utils/WarpXAlgorithmSelection.cpp +++ b/Source/Utils/WarpXAlgorithmSelection.cpp @@ -18,6 +18,7 @@ const std::map maxwell_solver_algo_to_int = { const std::map particle_pusher_algo_to_int = { {"boris", ParticlePusherAlgo::Boris }, {"vay", ParticlePusherAlgo::Vay }, + {"hc", ParticlePusherAlgo::HigueraCary }, {"default", ParticlePusherAlgo::Boris } }; -- cgit v1.2.3 From 2ba67328ac041fd63204359ba10a868a383e29c7 Mon Sep 17 00:00:00 2001 From: Yin-YinjianZhao Date: Fri, 18 Oct 2019 10:58:14 -0700 Subject: Modified according to MaxThevenet's comments --- Docs/source/running_cpp/parameters.rst | 2 +- Examples/Tests/particle_pusher/analysis_pusher.py | 2 ++ Examples/Tests/particle_pusher/inputs | 2 +- Regression/WarpX-tests.ini | 4 ++-- Source/Particles/Pusher/UpdateMomentumHigueraCary.H | 9 ++++++--- Source/Utils/WarpXAlgorithmSelection.cpp | 2 +- 6 files changed, 13 insertions(+), 8 deletions(-) (limited to 'Source/Utils/WarpXAlgorithmSelection.cpp') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 4a82c3637..8690d134d 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -621,7 +621,7 @@ Numerics and algorithms - ``boris``: Boris pusher. - ``vay``: Vay pusher (see `Vay, Phys. Plasmas (2008) `__) - - ``hc``: Higuera-Cary pusher (see `Higuera and Cary, Phys. Plasmas (2017) `__) + - ``higuera``: Higuera-Cary pusher (see `Higuera and Cary, Phys. Plasmas (2017) `__) If ``algo.particle_pusher`` is not specified, ``boris`` is the default. diff --git a/Examples/Tests/particle_pusher/analysis_pusher.py b/Examples/Tests/particle_pusher/analysis_pusher.py index 90c86dc8b..0d9fc24c5 100755 --- a/Examples/Tests/particle_pusher/analysis_pusher.py +++ b/Examples/Tests/particle_pusher/analysis_pusher.py @@ -1,3 +1,5 @@ +#! /usr/bin/env python + # This script tests the particle pusher (HC) # using a force-free field, # in which position x should remain 0. diff --git a/Examples/Tests/particle_pusher/inputs b/Examples/Tests/particle_pusher/inputs index 0aa11f4a5..45c075f51 100755 --- a/Examples/Tests/particle_pusher/inputs +++ b/Examples/Tests/particle_pusher/inputs @@ -22,7 +22,7 @@ warpx.do_pml = 0 # Algorithms algo.charge_deposition = standard algo.field_gathering = standard -algo.particle_pusher = "hc" +algo.particle_pusher = "higuera" # CFL warpx.cfl = 1.0 diff --git a/Regression/WarpX-tests.ini b/Regression/WarpX-tests.ini index 39dd776fc..eb7083a60 100644 --- a/Regression/WarpX-tests.ini +++ b/Regression/WarpX-tests.ini @@ -669,9 +669,9 @@ inputFile = Examples/Tests/particle_pusher/inputs dim = 3 restartTest = 0 useMPI = 1 -numprocs = 2 +numprocs = 1 useOMP = 1 -numthreads = 2 +numthreads = 1 compileTest = 0 doVis = 0 compareParticles = 0 diff --git a/Source/Particles/Pusher/UpdateMomentumHigueraCary.H b/Source/Particles/Pusher/UpdateMomentumHigueraCary.H index f2accd760..51d7fd620 100644 --- a/Source/Particles/Pusher/UpdateMomentumHigueraCary.H +++ b/Source/Particles/Pusher/UpdateMomentumHigueraCary.H @@ -1,12 +1,15 @@ #ifndef WARPX_PARTICLES_PUSHER_UPDATEMOMENTUM_HIGUERACARY_H_ #define WARPX_PARTICLES_PUSHER_UPDATEMOMENTUM_HIGUERACARY_H_ +#include "WarpXConst.H" #include -#include #include -/* \brief Push the particle's positions over one timestep, - * given the value of its momenta `ux`, `uy`, `uz` */ +/** + * \brief Push the particle's positions over one timestep, + * given the value of its momenta `ux`, `uy`, `uz` + */ + AMREX_GPU_HOST_DEVICE AMREX_INLINE void UpdateMomentumHigueraCary( amrex::ParticleReal& ux, amrex::ParticleReal& uy, amrex::ParticleReal& uz, diff --git a/Source/Utils/WarpXAlgorithmSelection.cpp b/Source/Utils/WarpXAlgorithmSelection.cpp index 4ad07f4f1..be9cdd118 100644 --- a/Source/Utils/WarpXAlgorithmSelection.cpp +++ b/Source/Utils/WarpXAlgorithmSelection.cpp @@ -18,7 +18,7 @@ const std::map maxwell_solver_algo_to_int = { const std::map particle_pusher_algo_to_int = { {"boris", ParticlePusherAlgo::Boris }, {"vay", ParticlePusherAlgo::Vay }, - {"hc", ParticlePusherAlgo::HigueraCary }, + {"higuera", ParticlePusherAlgo::HigueraCary }, {"default", ParticlePusherAlgo::Boris } }; -- cgit v1.2.3