Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
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
14
// For all implicit functions, >0: body; =0: boundary; <0: fluid
15
16
namespace
amrex::EB2
{
17
19
class
ParserIF
20
:
public
amrex::GPUable
21
{
22
public
:
27
ParserIF
(
const
ParserExecutor<3>
& a_parser)
28
: m_parser(a_parser)
29
{}
30
32
[[nodiscard]]
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
33
amrex::Real
operator()
(
AMREX_D_DECL
(
amrex::Real
x
,
amrex::Real
y
,
34
amrex::Real
z
))
const
noexcept
{
35
#if (AMREX_SPACEDIM == 2)
36
return
static_cast<
Real
>
(m_parser({
x
,
y
,
Real
(0.0)}));
37
#else
38
return
static_cast<
Real
>
(m_parser({
x
,
y
,
z
}));
39
#endif
40
}
41
43
[[nodiscard]]
AMREX_FORCE_INLINE
amrex::Real
operator()
(
const
amrex::RealArray
&
p
)
const
noexcept
{
44
return
this->
operator()
(
AMREX_D_DECL
(
p
[0],
p
[1],
p
[2]));
45
}
46
47
private
:
48
ParserExecutor<3>
m_parser;
49
};
50
51
}
52
53
#endif
AMReX_EB2_IF_Base.H
AMREX_FORCE_INLINE
#define AMREX_FORCE_INLINE
Definition
AMReX_Extension.H:124
AMREX_GPU_HOST_DEVICE
#define AMREX_GPU_HOST_DEVICE
Definition
AMReX_GpuQualifiers.H:20
AMReX_Parser.H
Runtime expression parser front-end and compiled executor helpers.
p
while parser_exe_t p
Definition
AMReX_Parser_Exe_Body.H:33
AMREX_D_DECL
#define AMREX_D_DECL(a, b, c)
Definition
AMReX_SPACE.H:171
amrex::EB2::ParserIF
Implicit surface defined by an amrex::Parser expression.
Definition
AMReX_EB2_IF_Parser.H:21
amrex::EB2::ParserIF::ParserIF
ParserIF(const ParserExecutor< 3 > &a_parser)
Definition
AMReX_EB2_IF_Parser.H:27
amrex::EB2::ParserIF::operator()
__host__ __device__ amrex::Real operator()(amrex::Real x, amrex::Real y, amrex::Real z) const noexcept
Evaluate the expression at explicit coordinates.
Definition
AMReX_EB2_IF_Parser.H:33
amrex::Real
amrex_real Real
Floating Point Type for Fields.
Definition
AMReX_REAL.H:80
amrex::RealArray
Array< Real, 3 > RealArray
Definition
AMReX_Array.H:35
amrex::EB2
Definition
AMReX_FabArrayBase.H:38
amrex::Direction::y
@ y
amrex::Direction::x
@ x
amrex::Direction::z
@ z
amrex::GPUable
Marker base that denotes an implicit function callable on device kernels.
Definition
AMReX_EB2_IF_Base.H:19
amrex::ParserExecutor
Callable wrapper around a compiled parser expression with N variables.
Definition
AMReX_Parser.H:58
Src
EB
AMReX_EB2_IF_Parser.H
Generated by
1.9.8