WarpX
Loading...
Searching...
No Matches
GetVelocity.H
Go to the documentation of this file.
1/* Copyright 2021 Hannah Klion
2 *
3 * This file is part of WarpX.
4 *
5 * License: BSD-3-Clause-LBNL
6 */
7
8#ifndef WARPX_GET_VELOCITY_H_
9#define WARPX_GET_VELOCITY_H_
10
11#include "VelocityProperties.H"
12
21{
22 /* Type of velocity initialization */
24
35 explicit GetVelocityVector (VelocityProperties const& vel) noexcept;
36
49 amrex::XDim3 operator() (amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
50 {
51 switch (m_type)
52 {
53 case (VelConstantVector):
54 {
56 }
58 {
59 return amrex::XDim3{ m_ux_mean_parser(x,y,z), m_uy_mean_parser(x,y,z), m_uz_mean_parser(x,y,z) };
60 }
61 default:
62 {
63 amrex::Abort("Get initial velocity: unknown type");
64 return amrex::XDim3{0.0, 0.0, 0.0};
65 }
66 }
67 }
68};
69
70#endif //WARPX_GET_VELOCITY_H_
#define AMREX_GPU_HOST_DEVICE
VelocityInitType
Definition VelocityProperties.H:16
@ VelParserFunctionVector
Definition VelocityProperties.H:16
@ VelConstantVector
Definition VelocityProperties.H:16
amrex_real Real
void Abort(const std::string &msg)
amrex::Real m_uz_mean
Definition GetVelocity.H:26
AMREX_GPU_HOST_DEVICE amrex::XDim3 operator()(amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
Functor call. Returns the value of velocity at the location (x,y,z).
Definition GetVelocity.H:49
VelocityInitType m_type
Definition GetVelocity.H:23
amrex::Real m_uy_mean
Definition GetVelocity.H:26
amrex::Real m_ux_mean
Definition GetVelocity.H:26
amrex::ParserExecutor< 3 > m_uz_mean_parser
Definition GetVelocity.H:28
amrex::ParserExecutor< 3 > m_uy_mean_parser
Definition GetVelocity.H:28
amrex::ParserExecutor< 3 > m_ux_mean_parser
Definition GetVelocity.H:28
GetVelocityVector(VelocityProperties const &vel) noexcept
Construct the functor with information provided by vel.
Definition GetVelocity.cpp:10
Struct to store velocity properties, for use in momentum initialization.
Definition VelocityProperties.H:26