Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
74a8b948
Commit
74a8b948
authored
Dec 02, 2016
by
James Willis
Browse files
Comments.
parent
11728165
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/kernel_hydro.h
View file @
74a8b948
...
...
@@ -372,6 +372,18 @@ static const vector c4 = FILL_VEC(0.f);
static
const
vector
c5
=
FILL_VEC
(
1
.
f
);
#endif
/**
* @brief Computes the kernel function and its derivative using two interleaved vectors.
*
* Return 0 if $u > \\gamma = H/h$
*
* @param u The ratio of the distance to the smoothing length $u = x/h$.
* @param w (return) The value of the kernel function $W(x,h)$.
* @param dw_dx (return) The norm of the gradient of $|\\nabla W(x,h)|$.
* @param u2 The ratio of the distance to the smoothing length $u = x/h$ for second particle.
* @param w2 (return) The value of the kernel function $W(x,h)$ for second particle.
* @param dw_dx2 (return) The norm of the gradient of $|\\nabla W(x,h)|$ for second particle.
*/
__attribute__
((
always_inline
))
INLINE
static
void
kernel_deval_2_vec
(
vector
*
u
,
vector
*
w
,
vector
*
dw_dx
,
vector
*
u2
,
vector
*
w2
,
vector
*
dw_dx2
)
{
...
...
@@ -387,6 +399,7 @@ __attribute__((always_inline)) INLINE static void kernel_deval_2_vec(
dw_dx
->
v
=
c0
.
v
;
dw_dx2
->
v
=
c0
.
v
;
/* Calculate the polynomial interleaving vector operations */
dw_dx
->
v
=
vec_fma
(
dw_dx
->
v
,
x
.
v
,
w
->
v
);
dw_dx2
->
v
=
vec_fma
(
dw_dx2
->
v
,
x2
.
v
,
w2
->
v
);
w
->
v
=
vec_fma
(
x
.
v
,
w
->
v
,
c2
.
v
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment