Skip to content
GitLab
Menu
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
af100ef5
Commit
af100ef5
authored
Jun 02, 2017
by
Matthieu Schaller
Browse files
Also set the value of rho and wcount to sensible values when no neighbours are found.
parent
76469999
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/hydro/Default/hydro.h
View file @
af100ef5
...
...
@@ -228,7 +228,14 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_part_has_no_neighbours
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
)
{
/* Some smoothing length multiples. */
const
float
h
=
p
->
h
;
const
float
h_inv
=
1
.
0
f
/
h
;
/* 1/h */
const
float
h_inv_dim
=
pow_dimension
(
h_inv
);
/* 1/h^d */
/* Re-set problematic values */
p
->
rho
=
p
->
mass
*
kernel_root
*
h_inv_dim
;
p
->
density
.
wcount
=
kernel_root
*
kernel_norm
*
h_inv_dim
;
p
->
rho_dh
=
0
.
f
;
p
->
density
.
wcount_dh
=
0
.
f
;
p
->
density
.
div_v
=
0
.
f
;
...
...
src/hydro/Gadget2/hydro.h
View file @
af100ef5
...
...
@@ -233,7 +233,14 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_part_has_no_neighbours
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
)
{
/* Some smoothing length multiples. */
const
float
h
=
p
->
h
;
const
float
h_inv
=
1
.
0
f
/
h
;
/* 1/h */
const
float
h_inv_dim
=
pow_dimension
(
h_inv
);
/* 1/h^d */
/* Re-set problematic values */
p
->
rho
=
p
->
mass
*
kernel_root
*
h_inv_dim
;
p
->
density
.
wcount
=
kernel_root
*
kernel_norm
*
h_inv_dim
;
p
->
density
.
rho_dh
=
0
.
f
;
p
->
density
.
wcount_dh
=
0
.
f
;
p
->
density
.
div_v
=
0
.
f
;
...
...
src/hydro/Gizmo/hydro.h
View file @
af100ef5
...
...
@@ -375,7 +375,13 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_part_has_no_neighbours
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
)
{
/* Some smoothing length multiples. */
const
float
h
=
p
->
h
;
const
float
h_inv
=
1
.
0
f
/
h
;
/* 1/h */
const
float
h_inv_dim
=
pow_dimension
(
h_inv
);
/* 1/h^d */
/* Re-set problematic values */
p
->
density
.
wcount
=
kernel_root
*
kernel_norm
*
h_inv_dim
;
p
->
density
.
wcount_dh
=
0
.
f
;
}
...
...
src/hydro/Minimal/hydro.h
View file @
af100ef5
...
...
@@ -236,7 +236,14 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_part_has_no_neighbours
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
)
{
/* Some smoothing length multiples. */
const
float
h
=
p
->
h
;
const
float
h_inv
=
1
.
0
f
/
h
;
/* 1/h */
const
float
h_inv_dim
=
pow_dimension
(
h_inv
);
/* 1/h^d */
/* Re-set problematic values */
p
->
rho
=
p
->
mass
*
kernel_root
*
h_inv_dim
;
p
->
density
.
wcount
=
kernel_root
*
kernel_norm
*
h_inv_dim
;
p
->
density
.
rho_dh
=
0
.
f
;
p
->
density
.
wcount_dh
=
0
.
f
;
}
...
...
src/hydro/PressureEntropy/hydro.h
View file @
af100ef5
...
...
@@ -245,7 +245,15 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_part_has_no_neighbours
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
)
{
/* Some smoothing length multiples. */
const
float
h
=
p
->
h
;
const
float
h_inv
=
1
.
0
f
/
h
;
/* 1/h */
const
float
h_inv_dim
=
pow_dimension
(
h_inv
);
/* 1/h^d */
/* Re-set problematic values */
p
->
rho
=
p
->
mass
*
kernel_root
*
h_inv_dim
;
p
->
rho_bar
=
p
->
mass
*
p
->
entropy_one_over_gamma
*
kernel_root
*
h_inv_dim
;
p
->
density
.
wcount
=
kernel_root
*
kernel_norm
*
h_inv_dim
;
p
->
density
.
rho_dh
=
0
.
f
;
p
->
density
.
wcount_dh
=
0
.
f
;
p
->
density
.
pressure_dh
=
0
.
f
;
// MATTHIEU: to be checked
...
...
src/hydro/Shadowswift/hydro.h
View file @
af100ef5
...
...
@@ -247,7 +247,13 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
__attribute__
((
always_inline
))
INLINE
static
void
hydro_part_has_no_neighbours
(
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
)
{
/* Some smoothing length multiples. */
const
float
h
=
p
->
h
;
const
float
h_inv
=
1
.
0
f
/
h
;
/* 1/h */
const
float
h_inv_dim
=
pow_dimension
(
h_inv
);
/* 1/h^d */
/* Re-set problematic values */
p
->
density
.
wcount
=
kernel_root
*
kernel_norm
*
h_inv_dim
;
p
->
density
.
wcount_dh
=
0
.
f
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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