PACMAN
0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Toggle main menu visibility
Loading...
Searching...
No Matches
rbf_functions.hpp
Go to the documentation of this file.
1
//
2
// This file is subject to the terms and conditions defined in
3
// file 'LICENSE', which is part of this source code package.
4
//
5
6
#pragma once
7
8
#include <Kokkos_Core.hpp>
9
10
#include "
common/types.hpp
"
11
#include "
utils/utils.hpp
"
12
13
namespace
PACMAN
{
14
namespace
RbfPum
{
15
22
class
WendlandC0
{
23
public
:
24
KOKKOS_FORCEINLINE_FUNCTION
25
fp_t
constexpr
Eval
(
const
fp_t
&r)
const
{
26
const
fp_t
p = r * mRadiusInv;
27
char
mask =
28
static_cast<
char
>
(r >=
fp_consts::zero
() && p <
fp_consts::one
() &&
29
p >=
fp_consts::zero
());
30
return
static_cast<
fp_t
>
(mask) *
31
((
fp_consts::one
() - p) * (
fp_consts::one
() - p));
32
}
33
inline
void
SetRadiusInv
(
const
fp_t
&radiusInv) {
34
this->mRadiusInv = radiusInv;
35
}
36
37
private
:
38
fp_t
mRadiusInv =
fp_consts::zero
();
39
};
40
47
class
WendlandC2
{
48
public
:
49
KOKKOS_FORCEINLINE_FUNCTION
50
fp_t
Eval
(
const
fp_t
&r)
const
{
51
const
fp_t
p = r * mRadiusInv;
52
char
mask =
53
static_cast<
char
>
(r >=
fp_consts::zero
() && p <
fp_consts::one
() &&
54
p >=
fp_consts::zero
());
55
return
static_cast<
fp_t
>
(mask) *
56
(Kokkos::pow(
fp_consts::one
() - p, 4) *
57
Kokkos::fma(
static_cast<
fp_t
>
(4.0), p,
fp_consts::one
()));
58
}
59
inline
void
SetRadiusInv
(
const
fp_t
&radiusInv) {
60
this->mRadiusInv = radiusInv;
61
}
62
63
private
:
64
fp_t
mRadiusInv =
fp_consts::zero
();
65
};
66
73
class
WendlandC4
{
74
public
:
75
KOKKOS_FORCEINLINE_FUNCTION
76
fp_t
Eval
(
const
fp_t
&r)
const
{
77
const
fp_t
p = r * mRadiusInv;
78
char
mask =
79
static_cast<
char
>
(r >=
fp_consts::zero
() && p <
fp_consts::one
() &&
80
p >=
fp_consts::zero
());
81
return
static_cast<
fp_t
>
(mask) *
82
(Kokkos::pow(
fp_consts::one
() - p, 6) *
83
(
static_cast<
fp_t
>
(35.0) * Kokkos::pow(p, 2) +
84
Kokkos::fma(
static_cast<
fp_t
>
(18.0), p,
static_cast<
fp_t
>
(3.0))));
85
}
86
inline
void
SetRadiusInv
(
const
fp_t
&radiusInv) {
87
this->mRadiusInv = radiusInv;
88
};
89
90
private
:
91
fp_t
mRadiusInv =
fp_consts::zero
();
92
};
93
100
class
WendlandC6
{
101
public
:
102
KOKKOS_FORCEINLINE_FUNCTION
103
fp_t
Eval
(
const
fp_t
&r)
const
{
104
const
fp_t
p = r * mRadiusInv;
105
char
mask =
106
static_cast<
char
>
(r >=
fp_consts::zero
() && p <
fp_consts::one
() &&
107
p >=
fp_consts::zero
());
108
return
static_cast<
fp_t
>
(mask) *
109
(Kokkos::pow(
fp_consts::one
() - p, 8) *
110
(
static_cast<
fp_t
>
(32.0) * Kokkos::pow(p, 3) +
111
static_cast<
fp_t
>
(25.0) * Kokkos::pow(p, 2) +
112
Kokkos::fma(
static_cast<
fp_t
>
(8.0), p,
fp_consts::one
())));
113
}
114
inline
void
SetRadiusInv
(
const
fp_t
&radiusInv) {
115
this->mRadiusInv = radiusInv;
116
}
117
118
private
:
119
fp_t
mRadiusInv =
fp_consts::zero
();
120
};
121
128
class
WendlandC8
{
129
public
:
130
KOKKOS_FORCEINLINE_FUNCTION
131
fp_t
Eval
(
const
fp_t
&r)
const
{
132
const
fp_t
p = r * mRadiusInv;
133
char
mask =
134
static_cast<
char
>
(r >=
fp_consts::zero
() && p <
fp_consts::one
() &&
135
p >=
fp_consts::zero
());
136
return
static_cast<
fp_t
>
(mask) *
137
(Kokkos::pow(
fp_consts::one
() - p, 10) *
138
(
static_cast<
fp_t
>
(1287.0) * Kokkos::pow(p, 4) +
139
static_cast<
fp_t
>
(1350.0) * Kokkos::pow(p, 3) +
140
static_cast<
fp_t
>
(630.0) * Kokkos::pow(p, 2) +
141
Kokkos::fma(
static_cast<
fp_t
>
(150.0), p,
142
static_cast<
fp_t
>
(15.0))));
143
}
144
inline
void
SetRadiusInv
(
const
fp_t
&radiusInv) {
145
this->mRadiusInv = radiusInv;
146
}
147
148
private
:
149
fp_t
mRadiusInv =
fp_consts::zero
();
150
};
151
152
}
// namespace RbfPum
153
}
// namespace PACMAN
PACMAN::RbfPum::WendlandC0
A functor which computes a RBF function: WendlandC0 Each RBF function must have a host device method ...
Definition
rbf_functions.hpp:22
PACMAN::RbfPum::WendlandC0::SetRadiusInv
void SetRadiusInv(const fp_t &radiusInv)
Definition
rbf_functions.hpp:33
PACMAN::RbfPum::WendlandC0::Eval
KOKKOS_FORCEINLINE_FUNCTION fp_t constexpr Eval(const fp_t &r) const
Definition
rbf_functions.hpp:25
PACMAN::RbfPum::WendlandC2
A functor which computes a RBF function: WendlandC2 Each RBF function must have a host device method ...
Definition
rbf_functions.hpp:47
PACMAN::RbfPum::WendlandC2::SetRadiusInv
void SetRadiusInv(const fp_t &radiusInv)
Definition
rbf_functions.hpp:59
PACMAN::RbfPum::WendlandC2::Eval
KOKKOS_FORCEINLINE_FUNCTION fp_t Eval(const fp_t &r) const
Definition
rbf_functions.hpp:50
PACMAN::RbfPum::WendlandC4
A functor which computes a RBF function: WendlandC4 Each RBF function must have a host device method ...
Definition
rbf_functions.hpp:73
PACMAN::RbfPum::WendlandC4::Eval
KOKKOS_FORCEINLINE_FUNCTION fp_t Eval(const fp_t &r) const
Definition
rbf_functions.hpp:76
PACMAN::RbfPum::WendlandC4::SetRadiusInv
void SetRadiusInv(const fp_t &radiusInv)
Definition
rbf_functions.hpp:86
PACMAN::RbfPum::WendlandC6
A functor which computes a RBF function: WendlandC6 Each RBF function must have a host device method ...
Definition
rbf_functions.hpp:100
PACMAN::RbfPum::WendlandC6::SetRadiusInv
void SetRadiusInv(const fp_t &radiusInv)
Definition
rbf_functions.hpp:114
PACMAN::RbfPum::WendlandC6::Eval
KOKKOS_FORCEINLINE_FUNCTION fp_t Eval(const fp_t &r) const
Definition
rbf_functions.hpp:103
PACMAN::RbfPum::WendlandC8
A functor which computes a RBF function: WendlandC8 Each RBF function must have a host device method ...
Definition
rbf_functions.hpp:128
PACMAN::RbfPum::WendlandC8::Eval
KOKKOS_FORCEINLINE_FUNCTION fp_t Eval(const fp_t &r) const
Definition
rbf_functions.hpp:131
PACMAN::RbfPum::WendlandC8::SetRadiusInv
void SetRadiusInv(const fp_t &radiusInv)
Definition
rbf_functions.hpp:144
PACMAN::RbfPum
Definition
callbacks.hpp:17
PACMAN::fp_consts::zero
KOKKOS_INLINE_FUNCTION consteval fp_t zero(void)
Definition
types.hpp:92
PACMAN::fp_consts::one
KOKKOS_INLINE_FUNCTION consteval fp_t one(void)
Definition
types.hpp:95
PACMAN
Definition
concepts.hpp:14
PACMAN::fp_t
double fp_t
Definition
types.hpp:15
types.hpp
utils.hpp
src
rbf_pum
solver
rbf_functions.hpp
Generated on
for PACMAN by
1.17.0