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
1290a351
Commit
1290a351
authored
Jul 21, 2016
by
Matthieu Schaller
Browse files
Define kernel_norm to simply code readability
parent
ecd3b766
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/hydro/Default/hydro.h
View file @
1290a351
...
...
@@ -103,8 +103,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Finish the calculation by inserting the missing h-factors */
p
->
rho
*=
ih
*
ih2
;
p
->
rho_dh
*=
ih4
;
p
->
density
.
wcount
*=
(
4
.
0
f
/
3
.
0
f
*
M_PI
*
kernel_gamma3
)
;
p
->
density
.
wcount_dh
*=
ih
*
(
4
.
0
f
/
3
.
0
f
*
M_PI
*
kernel_gamma4
)
;
p
->
density
.
wcount
*=
kernel_norm
;
p
->
density
.
wcount_dh
*=
ih
*
kernel_gamma
*
kernel_norm
;
const
float
irho
=
1
.
f
/
p
->
rho
;
...
...
src/hydro/Gadget2/hydro.h
View file @
1290a351
...
...
@@ -97,8 +97,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Finish the calculation by inserting the missing h-factors */
p
->
rho
*=
ih
*
ih2
;
p
->
rho_dh
*=
ih4
;
p
->
density
.
wcount
*=
(
4
.
0
f
/
3
.
0
f
*
M_PI
*
kernel_gamma3
)
;
p
->
density
.
wcount_dh
*=
ih
*
(
4
.
0
f
/
3
.
0
f
*
M_PI
*
kernel_gamma4
)
;
p
->
density
.
wcount
*=
kernel_norm
;
p
->
density
.
wcount_dh
*=
ih
*
kernel_gamma
*
kernel_norm
;
const
float
irho
=
1
.
f
/
p
->
rho
;
...
...
src/hydro/Minimal/hydro.h
View file @
1290a351
...
...
@@ -106,8 +106,8 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
/* Finish the calculation by inserting the missing h-factors */
p
->
rho
*=
ih
*
ih2
;
p
->
rho_dh
*=
ih4
;
p
->
density
.
wcount
*=
(
4
.
0
f
/
3
.
0
f
*
M_PI
*
kernel_gamma3
)
;
p
->
density
.
wcount_dh
*=
ih
*
(
4
.
0
f
/
3
.
0
f
*
M_PI
*
kernel_gamma4
)
;
p
->
density
.
wcount
*=
kernel_norm
;
p
->
density
.
wcount_dh
*=
ih
*
kernel_gamma
*
kernel_norm
;
const
float
irho
=
1
.
f
/
p
->
rho
;
...
...
src/kernel_hydro.h
View file @
1290a351
...
...
@@ -154,6 +154,9 @@ static const float kernel_coeffs[(kernel_degree + 1) * (kernel_ivals + 1)]
#define kernel_root \
((float)(kernel_coeffs[kernel_degree]) * kernel_constant * kernel_igamma3)
/* Kernel normalisation constant (volume term) */
#define kernel_norm ((float)(4.0 * M_PI * kernel_gamma3 / 3.0))
/**
* @brief Computes the kernel function and its derivative.
*
...
...
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