Skip to content

Commit

Permalink
use_default_v_<galilean,comoving> Only w/ Boosted Frame (#2654)
Browse files Browse the repository at this point in the history
  • Loading branch information
EZoni authored Dec 11, 2021
1 parent c728b55 commit 1e8f869
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1086,22 +1086,37 @@ WarpX::ReadParameters ()
"\nVay current deposition does not guarantee charge conservation with local FFTs over guard cells:\n"
"set psatd.periodic_single_box_fft=1 too, in order to guarantee charge conservation");

// Auxiliary: boosted_frame = true if warpx.gamma_boost is set in the inputs
amrex::ParmParse pp_warpx("warpx");
const bool boosted_frame = pp_warpx.query("gamma_boost", gamma_boost);

// Check whether the default Galilean velocity should be used
bool use_default_v_galilean = false;
pp_psatd.query("use_default_v_galilean", use_default_v_galilean);
if (use_default_v_galilean) {
if (use_default_v_galilean == true && boosted_frame == true)
{
m_v_galilean[2] = -std::sqrt(1._rt - 1._rt / (gamma_boost * gamma_boost));
} else {
}
else if (use_default_v_galilean == true && boosted_frame == false)
{
amrex::Abort("psatd.use_default_v_galilean = 1 can be used only if warpx.gamma_boost is also set");
}
else
{
queryArrWithParser(pp_psatd, "v_galilean", m_v_galilean, 0, 3);
}

// Check whether the default comoving velocity should be used
bool use_default_v_comoving = false;
pp_psatd.query("use_default_v_comoving", use_default_v_comoving);
if (use_default_v_comoving)
if (use_default_v_comoving == true && boosted_frame == true)
{
m_v_comoving[2] = -std::sqrt(1._rt - 1._rt / (gamma_boost * gamma_boost));
}
else if (use_default_v_comoving == true && boosted_frame == false)
{
amrex::Abort("psatd.use_default_v_comoving = 1 can be used only if warpx.gamma_boost is also set");
}
else
{
queryArrWithParser(pp_psatd, "v_comoving", m_v_comoving, 0, 3);
Expand Down

0 comments on commit 1e8f869

Please sign in to comment.