Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_EB2_IF_Complement.H
Go to the documentation of this file.
1
#ifndef AMREX_EB2_IF_COMPLEMENT_H_
2
#define AMREX_EB2_IF_COMPLEMENT_H_
3
#include <AMReX_Config.H>
4
5
#include <
AMReX_Array.H
>
6
#include <
AMReX_EB2_IF_Base.H
>
7
8
#include <type_traits>
9
16
// For all implicit functions, >0: body; =0: boundary; <0: fluid
17
18
namespace
amrex::EB2
{
19
20
template
<
class
F>
22
class
ComplementIF
23
{
24
public
:
25
27
ComplementIF
(
F
a_f) :
m_f
(std::move(a_f)) {}
28
30
[[nodiscard]]
AMREX_FORCE_INLINE
Real
operator()
(
const
RealArray
&
p
)
const
noexcept
31
{
32
return
-
m_f
(
p
);
33
}
34
35
37
[[nodiscard]]
AMREX_GPU_HOST_DEVICE
AMREX_FORCE_INLINE
38
Real
operator()
(
AMREX_D_DECL
(
Real
x
,
Real
y
,
Real
z
))
const
noexcept
39
requires
(
IsGPUable<F>::value
)
40
{
41
return
-
m_f
(
AMREX_D_DECL
(
x
,
y
,
z
));
42
}
43
44
protected
:
45
46
F
m_f
;
47
};
48
49
template
<
class
F>
50
requires
(
IsGPUable<F>::value
)
51
struct
IsGPUable
<
ComplementIF<F>
> : std::true_type {};
52
53
template
<
class
F>
55
constexpr
ComplementIF<std::decay_t<F>
>
56
makeComplement
(
F
&& f)
57
{
58
return
ComplementIF<std::decay_t<F>
>(std::forward<F>(f));
59
}
60
61
}
62
63
#endif
AMReX_Array.H
Fixed-size array types for use on GPU and CPU.
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
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::ComplementIF
Implicit function wrapper that swaps interior/exterior.
Definition
AMReX_EB2_IF_Complement.H:23
amrex::EB2::ComplementIF::m_f
F m_f
Definition
AMReX_EB2_IF_Complement.H:46
amrex::EB2::ComplementIF::operator()
Real operator()(const RealArray &p) const noexcept
Evaluate the complement in array form.
Definition
AMReX_EB2_IF_Complement.H:30
amrex::EB2::ComplementIF::ComplementIF
ComplementIF(F a_f)
Store the child implicit function to be complemented.
Definition
AMReX_EB2_IF_Complement.H:27
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::EB2::makeComplement
constexpr ComplementIF< std::decay_t< F > > makeComplement(F &&f)
Helper that constructs a complement operator.
Definition
AMReX_EB2_IF_Complement.H:56
amrex::Order::F
@ F
amrex::Direction::y
@ y
amrex::Direction::x
@ x
amrex::Direction::z
@ z
amrex::EB2::IsGPUable
Type trait that reports whether a functor derives from GPUable.
Definition
AMReX_EB2_IF_Base.H:24
Src
EB
AMReX_EB2_IF_Complement.H
Generated by
1.9.8