Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace predictor-corrector by analytic integration and multigrid solve #437

Merged
merged 43 commits into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
dc338c9
skeleton code for new Bx By calculation
MaxThevenet Feb 24, 2021
d8697c9
Implementation of First Term of 18a and skeleton for 18b. Modificatio…
SaVicente Mar 16, 2021
b007d46
fix compilation errors and implement squared j deposition (#428)
MaxThevenet Mar 17, 2021
d5f2d7c
First version of full WAND-PIC implementation. equatios-hipace correc…
SaVicente Mar 22, 2021
695f97c
fix merge conflicts
MaxThevenet Mar 23, 2021
afcfb4d
fix runtime errors
MaxThevenet Mar 23, 2021
d210633
remove tabs from tex document
MaxThevenet Mar 23, 2021
7bf20bc
eol
MaxThevenet Mar 23, 2021
3498101
fix some issue and minor reformatting
MaxThevenet Mar 23, 2021
192b6a4
deactivate CI on new_bxby
MaxThevenet Mar 23, 2021
945a40a
define some variable for lighter notations
MaxThevenet Mar 23, 2021
ba4f530
constify
MaxThevenet Mar 23, 2021
cf1663b
MF Probably can't be const
MaxThevenet Mar 23, 2021
60011e8
Merge branch 'development' into new_bxby
MaxThevenet Mar 30, 2021
113823c
calculate the source terms in a ParallelFor
MaxThevenet Mar 30, 2021
e873c2c
call AMReX MG solver to solve for Bx and By
MaxThevenet Mar 30, 2021
65d4229
use old version by default
MaxThevenet Mar 30, 2021
442a179
fix bug in rho ions and expose option to use wand-pic approach
MaxThevenet Mar 30, 2021
69be693
clean up and create local communicator
MaxThevenet Mar 30, 2021
2dcc160
ne is different from rho
MaxThevenet Mar 30, 2021
5b91633
add amrex:: prefix and fix some sign errors
MaxThevenet Mar 30, 2021
2f9f6d2
no reduction needed
MaxThevenet Apr 1, 2021
3941073
make solvebxby public, not private, for gpu issue
MaxThevenet Apr 1, 2021
bea5a81
separate MG calls for Bx abd By
MaxThevenet Apr 1, 2021
2516efb
jz has the same sign in wandpic and hipace++
MaxThevenet Apr 1, 2021
6a81d33
fix transverse square current
MaxThevenet Apr 1, 2021
eaedd3e
typo in previous fix
MaxThevenet Apr 1, 2021
68939dd
change sign of source terms. Dont know why it works, but the linear e…
MaxThevenet Apr 1, 2021
885a15a
update theory, in particular correspondance wandpic/hipace++ quantities
MaxThevenet Apr 4, 2021
1f78ea4
clean cross current terms and change calculation of n*gamma
MaxThevenet Apr 4, 2021
8ab5174
fix important typo
SeverinDiederichs Apr 6, 2021
09aa7ab
counter sign error of psi
SeverinDiederichs Apr 6, 2021
ae270cc
only advance particles once
MaxThevenet Apr 6, 2021
372c333
fix two-component solve
MaxThevenet Apr 7, 2021
b64cd0b
Update src/Hipace.cpp
MaxThevenet Apr 7, 2021
d2fc08a
Update src/Hipace.cpp
MaxThevenet Apr 7, 2021
087b76d
cleaning, and get rid of double MG solve
MaxThevenet Apr 7, 2021
91a4607
make MG tolerance a runtime parameter
MaxThevenet Apr 7, 2021
9f86d29
update doc with sign fixes
MaxThevenet Apr 7, 2021
fca2669
final cleaning
MaxThevenet Apr 7, 2021
ff9cbee
create automated test with only checksum for explicit solver
MaxThevenet Apr 7, 2021
8c055c5
update benchmark for explicit solver CI test
Apr 7, 2021
7a1a6d3
comments from review
MaxThevenet Apr 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix merge conflicts
  • Loading branch information
MaxThevenet committed Mar 23, 2021
commit 695f97c3bcf53b671d8ed5aae34ac5aae5877edd
10 changes: 6 additions & 4 deletions src/Hipace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,9 @@ Hipace::SolveOneSlice (int islice, int lev, const int ibox,
amrex::MultiFab rho(m_fields.getSlices(lev, WhichSlice::This), amrex::make_alias,
Comps[WhichSlice::This]["rho"], 1);

DepositCurrent(m_plasma_container, m_fields, WhichSlice::This, false, true,
true, true, false, geom[lev], lev);
m_multi_plasma.DepositCurrent(
m_fields, WhichSlice::This, false, true, true, true, false, geom[lev], lev);

m_fields.AddRhoIons(lev);

// need to exchange jx jy jz rho
Expand Down Expand Up @@ -776,8 +777,9 @@ Hipace::PredictorCorrectorLoopToSolveBxBy (const int islice, const int lev)
m_multi_plasma.AdvanceParticles(m_fields, geom[lev], true, true, false, false, lev);

/* deposit current to next slice */
DepositCurrent(m_plasma_container, m_fields, WhichSlice::Next, true,
true, false, false, false, geom[lev], lev);
m_multi_plasma.DepositCurrent(
m_fields, WhichSlice::Next, true, true, false, false, false, geom[lev], lev);

amrex::ParallelContext::push(m_comm_xy);
// need to exchange jx jy jz rho
amrex::MultiFab j_slice_next(m_fields.getSlices(lev, WhichSlice::Next),
Expand Down
3 changes: 2 additions & 1 deletion src/particles/MultiPlasma.H
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,13 @@ public:
* \param[in] deposit_jx_jy if true, deposit to jx and jy
* \param[in] deposit_jz if true, deposit to jz
* \param[in] deposit_rho if true, deposit to rho
* \param[in] deposit_j_squared if true, deposit jxx, jxy, jyy
* \param[in] gm Geometry of the simulation, to get the cell size etc.
* \param[in] lev MR level
*/
void DepositCurrent (
Fields & fields, int which_slice, bool temp_slice, bool deposit_jx_jy, bool deposit_jz,
bool deposit_rho, amrex::Geometry const& gm, int const lev);
bool deposit_rho, bool deposit_j_squared, amrex::Geometry const& gm, int const lev);

/** \brief Return max density, to compute the adaptive time step.
*
Expand Down
7 changes: 4 additions & 3 deletions src/particles/MultiPlasma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ MultiPlasma::maxDensity ()
void
MultiPlasma::DepositCurrent (
Fields & fields, int which_slice, bool temp_slice, bool deposit_jx_jy, bool deposit_jz,
bool deposit_rho, amrex::Geometry const& gm, int const lev)
bool deposit_rho, bool deposit_j_squared, amrex::Geometry const& gm, int const lev)
{
for (auto& plasma : m_all_plasmas) {
::DepositCurrent(plasma, fields, which_slice, temp_slice, deposit_jx_jy, deposit_jz, deposit_rho, gm, lev);
::DepositCurrent(plasma, fields, which_slice, temp_slice, deposit_jx_jy, deposit_jz,
deposit_rho, deposit_j_squared, gm, lev);
}
}

Expand Down Expand Up @@ -71,7 +72,7 @@ MultiPlasma::DepositNeutralizingBackground (
{
for (auto& plasma : m_all_plasmas) {
if (plasma.m_neutralize_background){
::DepositCurrent(plasma, fields, which_slice, false, false, false, true, gm, lev);
::DepositCurrent(plasma, fields, which_slice, false, false, false, true, false, gm, lev);
}
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.