From d2340a2f2b52aef91230383cf210d8280e41f12c Mon Sep 17 00:00:00 2001 From: Hannah Klion Date: Wed, 27 Oct 2021 22:50:42 -0700 Subject: Spatially vary velocity (#2491) * initial add of GetVelocity and VelocityProperties * bug fixes and first test implementation * add documentation to parameters.rst * Add error if |beta|>=1 * Check for |beta|>=1 in Juttner as well * update comment on initial_distribution python script * Doxygenization and floats in python Co-authored-by: Axel Huebl * Address comments in review - Add units to analysis_distribution.py constants - Move a comment on VelocityProperties constructor from implementation to header file Co-authored-by: Hannah Klion Co-authored-by: Axel Huebl --- Source/Initialization/GetVelocity.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Source/Initialization/GetVelocity.cpp (limited to 'Source/Initialization/GetVelocity.cpp') diff --git a/Source/Initialization/GetVelocity.cpp b/Source/Initialization/GetVelocity.cpp new file mode 100644 index 000000000..2d2a342a7 --- /dev/null +++ b/Source/Initialization/GetVelocity.cpp @@ -0,0 +1,20 @@ +/* Copyright 2021 Hannah Klion + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ + +#include "GetVelocity.H" + +GetVelocity::GetVelocity (VelocityProperties const& vel) noexcept { + m_type = vel.m_type; + m_dir = vel.m_dir; + m_sign_dir = vel.m_sign_dir; + if (m_type == VelConstantValue) { + m_velocity = vel.m_velocity; + } + else if (m_type == VelParserFunction) { + m_velocity_parser = vel.m_ptr_velocity_parser->compile<3>(); + } +} -- cgit v1.2.3