From 54c463af5dfd3db55fc69abb60e80100687a04f7 Mon Sep 17 00:00:00 2001 From: Remi Lehe Date: Fri, 22 Jan 2021 16:49:49 -0800 Subject: Add parameter for default galilean velocity (#1097) * Add parameter for default galilean velocity * Apply suggestions from code review Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> * Fix bug in constructor of PhysicalParticleContainer * Use new input parameter in CI test Co-authored-by: Edoardo Zoni <59625522+EZoni@users.noreply.github.com> Co-authored-by: Edoardo Zoni --- Source/Particles/PhysicalParticleContainer.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'Source/Particles/PhysicalParticleContainer.cpp') diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index a4e6317e1..8f9ad2e7c 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -165,10 +165,16 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp #endif - // Parse galilean velocity - ParmParse ppsatd("psatd"); - ppsatd.query("v_galilean", m_v_galilean); - // Scale the velocity by the speed of light + // Get Galilean velocity + ParmParse pp_psatd("psatd"); + bool use_default_v_galilean = false; + pp_psatd.query("use_default_v_galilean", use_default_v_galilean); + if (use_default_v_galilean) { + m_v_galilean[2] = -std::sqrt(1._rt - 1._rt / (WarpX::gamma_boost * WarpX::gamma_boost)); + } else { + pp_psatd.query("v_galilean", m_v_galilean); + } + // Scale the Galilean velocity by the speed of light for (int i=0; i<3; i++) m_v_galilean[i] *= PhysConst::c; } -- cgit v1.2.3