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
a3d0c6bc
Commit
a3d0c6bc
authored
Aug 22, 2016
by
Matthieu Schaller
Browse files
Also update the prediction set interface fot Gizmo.
parent
a0cc3bf9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/hydro/Gizmo/hydro.h
View file @
a3d0c6bc
...
...
@@ -271,8 +271,6 @@ __attribute__((always_inline)) INLINE static void hydro_convert_quantities(
/**
* @brief Extra operations to be done during the drift
*
* Not used for GIZMO.
*
* @param p Particle to act upon.
* @param xp The extended particle data to act upon.
* @param dt The drift time-step.
...
...
@@ -281,11 +279,10 @@ __attribute__((always_inline)) INLINE static void hydro_convert_quantities(
* @param timeBase Conversion factor between integer and physical time.
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_predict_extra
(
struct
part
*
p
,
struct
xpart
*
xp
,
int
t0
,
int
t1
,
double
timeBase
)
{
struct
part
*
p
,
struct
xpart
*
xp
,
float
dt
,
int
t0
,
int
t1
,
double
timeBase
)
{
const
float
dt
=
(
t1
-
t0
)
*
timeBase
;
const
float
h_inv
=
1
.
0
f
/
p
->
h
;
const
float
w
=
-
hydro_dimension
*
p
->
force
.
h_dt
*
h_inv
*
dt
;
/* Predict smoothing length */
const
float
w1
=
p
->
force
.
h_dt
*
h_inv
*
dt
;
...
...
@@ -294,15 +291,17 @@ __attribute__((always_inline)) INLINE static void hydro_predict_extra(
else
p
->
h
*=
expf
(
w1
);
if
(
fabsf
(
w
)
<
0
.
2
f
)
{
p
->
primitives
.
rho
*=
approx_expf
(
w
);
const
float
w2
=
-
hydro_dimension
*
w1
;
if
(
fabsf
(
w2
)
<
0
.
2
f
)
{
p
->
primitives
.
rho
*=
approx_expf
(
w2
);
}
else
{
p
->
primitives
.
rho
*=
expf
(
w
);
p
->
primitives
.
rho
*=
expf
(
w
2
);
}
p
->
primitives
.
v
[
0
]
+=
(
p
->
a_hydro
[
0
]
+
p
->
gravity
.
old_a
[
0
])
*
dt
;
p
->
primitives
.
v
[
1
]
+=
(
p
->
a_hydro
[
1
]
+
p
->
gravity
.
old_a
[
1
])
*
dt
;
p
->
primitives
.
v
[
2
]
+=
(
p
->
a_hydro
[
2
]
+
p
->
gravity
.
old_a
[
2
])
*
dt
;
float
u
=
p
->
conserved
.
energy
+
p
->
du_dt
*
dt
;
const
float
u
=
p
->
conserved
.
energy
+
p
->
du_dt
*
dt
;
p
->
primitives
.
P
=
hydro_gamma_minus_one
*
u
*
p
->
primitives
.
rho
/
p
->
conserved
.
mass
;
}
...
...
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