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
8dbefb16
Commit
8dbefb16
authored
Jul 06, 2018
by
Bert Vandenbroucke
Browse files
Fixed bug in test27cells when running shadowfax hydro. Tried to fix 1D shadowswift, no success yet.
parent
331eb21f
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/hydro/Shadowswift/hydro.h
View file @
8dbefb16
...
...
@@ -182,12 +182,13 @@ __attribute__((always_inline)) INLINE static void hydro_end_density(
if
(
hnew
<
p
->
h
)
{
/* Iteration succesful: we accept, but manually set h to a smaller value
for the next time step */
p
->
density
.
wcount
=
1
.
0
f
;
const
float
hinvdim
=
pow_dimension
(
1
.
0
f
/
p
->
h
);
p
->
density
.
wcount
=
hinvdim
;
p
->
h
=
1
.
1
f
*
hnew
;
}
else
{
/* Iteration not succesful: we force h to become 1.1*hnew */
p
->
density
.
wcount
=
0
.
0
f
;
p
->
density
.
wcount_dh
=
1
.
0
f
/
(
1
.
1
f
*
hnew
-
p
->
h
);
p
->
density
.
wcount_dh
=
p
->
h
/
(
1
.
1
f
*
hnew
-
p
->
h
);
return
;
}
volume
=
p
->
cell
.
volume
;
...
...
src/hydro_properties.c
View file @
8dbefb16
...
...
@@ -72,6 +72,7 @@ void hydro_props_init(struct hydro_props *p,
/* change the meaning of target_neighbours and delta_neighbours */
p
->
target_neighbours
=
1
.
0
f
;
p
->
delta_neighbours
=
0
.
0
f
;
p
->
eta_neighbours
=
1
.
0
f
;
#endif
/* Maximal smoothing length */
...
...
tests/test27cells.c
View file @
8dbefb16
...
...
@@ -217,8 +217,20 @@ void clean_up(struct cell *ci) {
* @brief Initializes all particles field to be ready for a density calculation
*/
void
zero_particle_fields
(
struct
cell
*
c
)
{
#ifdef SHADOWFAX_SPH
struct
hydro_space
hs
;
hs
.
anchor
[
0
]
=
0
.;
hs
.
anchor
[
1
]
=
0
.;
hs
.
anchor
[
2
]
=
0
.;
hs
.
side
[
0
]
=
1
.;
hs
.
side
[
1
]
=
1
.;
hs
.
side
[
2
]
=
1
.;
struct
hydro_space
*
hspointer
=
&
hs
;
#else
struct
hydro_space
*
hspointer
=
NULL
;
#endif
for
(
int
pid
=
0
;
pid
<
c
->
count
;
pid
++
)
{
hydro_init_part
(
&
c
->
parts
[
pid
],
NULL
);
hydro_init_part
(
&
c
->
parts
[
pid
],
hspointer
);
}
}
...
...
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