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
4a5d4000
Commit
4a5d4000
authored
Feb 14, 2016
by
Matthieu Schaller
Browse files
New function initialising the extra arrays just after reading in the ICs
parent
b7869d73
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/cell.c
View file @
4a5d4000
...
...
@@ -564,6 +564,7 @@ void cell_init_parts(struct cell *c, void *data) {
xp
[
i
].
v_full
[
0
]
=
p
[
i
].
v
[
0
];
xp
[
i
].
v_full
[
1
]
=
p
[
i
].
v
[
1
];
xp
[
i
].
v_full
[
2
]
=
p
[
i
].
v
[
2
];
hydro_first_init_part
(
&
p
[
i
],
&
xp
[
i
]);
hydro_init_part
(
&
p
[
i
]);
hydro_reset_acceleration
(
&
p
[
i
]);
}
...
...
src/hydro/Default/hydro.h
View file @
4a5d4000
...
...
@@ -38,6 +38,18 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
return
fminf
(
dt_cfl
,
dt_u_change
);
}
/**
* @brief Initialises the particles for the first time
*
* This function is called only once just after the ICs have been
* read in to do some conversions.
*
* @param p The particle to act upon
* @param xp The extended particle data to act upon
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_first_init_part
(
struct
part
*
p
,
struct
xpart
*
xp
)
{}
/**
* @brief Prepares a particle for the density calculation.
*
...
...
src/hydro/Gadget2/hydro.h
View file @
4a5d4000
...
...
@@ -41,6 +41,18 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
return
fminf
(
dt_cfl
,
dt_accel
);
}
/**
* @brief Initialises the particles for the first time
*
* This function is called only once just after the ICs have been
* read in to do some conversions.
*
* @param p The particle to act upon
* @param xp The extended particle data to act upon
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_first_init_part
(
struct
part
*
p
,
struct
xpart
*
xp
)
{}
/**
* @brief Prepares a particle for the density calculation.
*
...
...
src/hydro/Minimal/hydro.h
View file @
4a5d4000
...
...
@@ -35,6 +35,21 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
return
dt_cfl
;
}
/**
* @brief Initialises the particles for the first time
*
* This function is called only once just after the ICs have been
* read in to do some conversions.
*
* @param p The particle to act upon
* @param xp The extended particle data to act upon
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_first_init_part
(
struct
part
*
p
,
struct
xpart
*
xp
)
{
xp
->
u_full
=
p
->
u
;
}
/**
* @brief Prepares a particle for the density calculation.
*
...
...
src/hydro/Minimal/hydro_part.h
View file @
4a5d4000
...
...
@@ -26,6 +26,9 @@ struct xpart {
/* Velocity at the last full step. */
float
v_full
[
3
];
/* Thermal energy at the last full step. */
float
u_full
;
}
__attribute__
((
aligned
(
xpart_align
)));
/* Data of a single particle. */
...
...
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