Block-Structured AMR Software Framework
AMReX_EB2_IF_Parser.H
Go to the documentation of this file.
1 #ifndef AMREX_EB2_IF_PARSER_H_
2 #define AMREX_EB2_IF_PARSER_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_EB2_IF_Base.H>
6 #include <AMReX_Parser.H>
7 
8 // For all implicit functions, >0: body; =0: boundary; <0: fluid
9 
10 namespace amrex::EB2 {
11 
12 class ParserIF
13  : public amrex::GPUable
14 {
15 public:
16  ParserIF (const ParserExecutor<3>& a_parser)
17  : m_parser(a_parser)
18  {}
19 
20  [[nodiscard]] AMREX_GPU_HOST_DEVICE inline
21  amrex::Real operator() (AMREX_D_DECL(amrex::Real x, amrex::Real y,
22  amrex::Real z)) const noexcept {
23 #if (AMREX_SPACEDIM == 2)
24  return static_cast<Real>(m_parser({x,y,Real(0.0)}));
25 #else
26  return static_cast<Real>(m_parser({x,y,z}));
27 #endif
28  }
29 
30  [[nodiscard]] inline amrex::Real operator() (const amrex::RealArray& p) const noexcept {
31  return this->operator()(AMREX_D_DECL(p[0],p[1],p[2]));
32  }
33 
34 private:
36 };
37 
38 }
39 
40 #endif
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
Definition: AMReX_EB2_IF_Parser.H:14
ParserExecutor< 3 > m_parser
Definition: AMReX_EB2_IF_Parser.H:35
AMREX_GPU_HOST_DEVICE amrex::Real operator()(AMREX_D_DECL(amrex::Real x, amrex::Real y, amrex::Real z)) const noexcept
Definition: AMReX_EB2_IF_Parser.H:21
ParserIF(const ParserExecutor< 3 > &a_parser)
Definition: AMReX_EB2_IF_Parser.H:16
Definition: AMReX_FabArrayBase.H:32
Array< Real, AMREX_SPACEDIM > RealArray
Definition: AMReX_Array.H:25
Definition: AMReX_EB2_IF_Base.H:11