From ae12df60f57f92259854db9326dab3e5aff17d8e Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Tue, 24 Sep 2019 11:21:55 -0700 Subject: Implement new gather option --- Docs/source/running_cpp/parameters.rst | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Docs/source/running_cpp/parameters.rst') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index 17b6a1c5d..ad532023f 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -578,7 +578,7 @@ Numerics and algorithms - ``direct``: simpler current deposition algorithm, described in the section :doc:`../theory/picsar_theory`. Note that this algorithm is not strictly charge-conserving. - If ``algo.current_deposition`` is not specified, the default is ``esirkepov``. + v * ``algo.charge_deposition`` (`string`, optional) The algorithm for the charge density deposition. Available options are: @@ -589,8 +589,15 @@ Numerics and algorithms * ``algo.field_gathering`` (`string`, optional) The algorithm for field gathering. Available options are: - - ``standard``: gathers directly from the grid points (either staggered + - ``energy-conserving``: gathers directly from the grid points (either staggered or nodal gridpoints depending on ``warpx.do_nodal``). + - ``momentum-conserving``: first average the fields from the grid points to + the nodes, and then gather from the nodes. + + If ``algo.field_gathering`` is not specified, the default is ``energy-conserving``. + If ``warpx.do_nodal`` is ``true``, then ``energy-conserving`` and ``momentum-conserving`` + are equivalent. + * ``algo.particle_pusher`` (`string`, optional) The algorithm for the particle pusher. Available options are: -- cgit v1.2.3 From ae5a90efcbef57d4619ad1111c52a46dbdb5bcd6 Mon Sep 17 00:00:00 2001 From: Weiqun Zhang Date: Thu, 24 Oct 2019 09:29:29 -0700 Subject: cleanup and comment --- Docs/source/running_cpp/parameters.rst | 2 -- Source/Parallelization/WarpXRegrid.cpp | 1 - Source/WarpX.cpp | 5 +++-- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'Docs/source/running_cpp/parameters.rst') diff --git a/Docs/source/running_cpp/parameters.rst b/Docs/source/running_cpp/parameters.rst index b0791cc75..59bfbb14e 100644 --- a/Docs/source/running_cpp/parameters.rst +++ b/Docs/source/running_cpp/parameters.rst @@ -608,8 +608,6 @@ Numerics and algorithms - ``direct``: simpler current deposition algorithm, described in the section :doc:`../theory/picsar_theory`. Note that this algorithm is not strictly charge-conserving. - v - * ``algo.charge_deposition`` (`string`, optional) The algorithm for the charge density deposition. Available options are: diff --git a/Source/Parallelization/WarpXRegrid.cpp b/Source/Parallelization/WarpXRegrid.cpp index 649ea80de..2ae167283 100644 --- a/Source/Parallelization/WarpXRegrid.cpp +++ b/Source/Parallelization/WarpXRegrid.cpp @@ -1,6 +1,5 @@ #include -#include #include using namespace amrex; diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index a0362dd57..9ba0741bb 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -876,7 +876,8 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm // if (aux_is_nodal and !do_nodal) { - BoxArray const nba = amrex::convert(ba,IntVect::TheUnitVector()); + // Create aux multifabs on Nodal Box Array + BoxArray const nba = amrex::convert(ba,IntVect::TheNodeVector()); Bfield_aux[lev][0].reset( new MultiFab(nba,dm,ncomps,ngE)); Bfield_aux[lev][1].reset( new MultiFab(nba,dm,ncomps,ngE)); Bfield_aux[lev][2].reset( new MultiFab(nba,dm,ncomps,ngE)); @@ -967,7 +968,7 @@ WarpX::AllocLevelMFs (int lev, const BoxArray& ba, const DistributionMapping& dm if (n_field_gather_buffer > 0 || mypc->nSpeciesGatherFromMainGrid() > 0) { if (aux_is_nodal) { - BoxArray const& cnba = amrex::convert(cba,IntVect::TheUnitVector()); + BoxArray const& cnba = amrex::convert(cba,IntVect::TheNodeVector()); Bfield_cax[lev][0].reset( new MultiFab(cnba,dm,ncomps,ngE)); Bfield_cax[lev][1].reset( new MultiFab(cnba,dm,ncomps,ngE)); Bfield_cax[lev][2].reset( new MultiFab(cnba,dm,ncomps,ngE)); -- cgit v1.2.3