WarpX
GetTemperature.H
Go to the documentation of this file.
1 /* Copyright 2021 Hannah Klion
2  *
3  *
4  * This file is part of WarpX.
5  *
6  * License: BSD-3-Clause-LBNL
7  */
8 
9 #ifndef WARPX_GET_TEMPERATURE_H_
10 #define WARPX_GET_TEMPERATURE_H_
11 
12 #include "TemperatureProperties.H"
13 
23 {
24  /* Type of temperature initialization */
26 
27  /* Constant temperature value, if m_type == TempConstantValue */
28  amrex::Real m_temperature;
29  /* Temperature parser function, if m_type == TempParserFunction */
31 
38  explicit GetTemperature (TemperatureProperties const& temp) noexcept;
39 
52  amrex::Real operator() (amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
53  {
54  switch (m_type)
55  {
56  case (TempConstantValue):
57  {
58  return m_temperature;
59  }
60  case (TempParserFunction):
61  {
62  return m_temperature_parser(x,y,z);
63  }
64  default:
65  {
66  amrex::Abort("Get initial temperature: unknown type");
67  return 0.0;
68  }
69  }
70  }
71 };
72 #endif //WARPX_GET_TEMPERATURE_H_
#define AMREX_GPU_HOST_DEVICE
TemperatureInitType
Definition: TemperatureProperties.H:17
@ TempConstantValue
Definition: TemperatureProperties.H:17
@ TempParserFunction
Definition: TemperatureProperties.H:17
void Abort(const std::string &msg)
Get temperature at a point on the grid.
Definition: GetTemperature.H:23
GetTemperature(TemperatureProperties const &temp) noexcept
Construct the functor with information provided by temp.
Definition: GetTemperature.cpp:11
amrex::Real m_temperature
Definition: GetTemperature.H:28
TemperatureInitType m_type
Definition: GetTemperature.H:25
AMREX_GPU_HOST_DEVICE amrex::Real operator()(amrex::Real const x, amrex::Real const y, amrex::Real const z) const noexcept
Functor call. Returns the value of temperature at the location (x,y,z)
Definition: GetTemperature.H:52
amrex::ParserExecutor< 3 > m_temperature_parser
Definition: GetTemperature.H:30
Struct to store temperature properties, for use in momentum initialization.
Definition: TemperatureProperties.H:27