Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
73bff3f1
Commit
73bff3f1
authored
9 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Done with the minimal hydro implementation. Documentation to follow
parent
4b1b4db5
No related branches found
No related tags found
2 merge requests
!136
Master
,
!90
Improved multi-timestep SPH
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/engine.c
+5
-7
5 additions, 7 deletions
src/engine.c
src/hydro/Minimal/hydro.h
+3
-4
3 additions, 4 deletions
src/hydro/Minimal/hydro.h
src/hydro/Minimal/hydro_debug.h
+5
-3
5 additions, 3 deletions
src/hydro/Minimal/hydro_debug.h
with
13 additions
and
14 deletions
src/engine.c
+
5
−
7
View file @
73bff3f1
...
...
@@ -1708,18 +1708,18 @@ void engine_init_particles(struct engine *e) {
message
(
"Initialising particles"
);
engine_prepare
(
e
);
/* Make sure all particles are ready to go */
/* i.e. clean-up any stupid state in the ICs */
space_map_cells_pre
(
s
,
1
,
cell_init_parts
,
NULL
);
engine_prepare
(
e
);
engine_marktasks
(
e
);
/
/
printParticle(e->s->parts, 1000, e->s->nr_parts);
/
/
printParticle(e->s->parts, 515050, e->s->nr_parts);
/
*
printParticle(e->s->parts,
e->s->xparts,
1000, e->s->nr_parts);
*/
/
*
printParticle(e->s->parts,
e->s->xparts,
515050, e->s->nr_parts);
*/
/
/
message("\n0th DENSITY CALC\n");
/
*
message("\n0th DENSITY CALC\n");
*/
/* Now do a density calculation */
TIMER_TIC
;
...
...
@@ -1825,8 +1825,6 @@ if ( e->nodeID == 0 )
/* printParticle(e->s->parts, e->s->xparts, 1000, e->s->nr_parts); */
/* printParticle(e->s->parts, e->s->xparts, 515050, e->s->nr_parts); */
// if(e->step == 2) exit(0);
/* message("\nACCELERATION AND KICK\n"); */
/* Re-distribute the particles amongst the nodes? */
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Minimal/hydro.h
+
3
−
4
View file @
73bff3f1
...
...
@@ -45,7 +45,7 @@ __attribute__((always_inline)) INLINE static float hydro_compute_timestep(
* @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
)
{
INLINE
static
void
hydro_first_init_part
(
struct
part
*
p
,
struct
xpart
*
xp
)
{
xp
->
u_full
=
p
->
u
;
}
...
...
@@ -175,9 +175,8 @@ __attribute__((always_inline))
* @param dt The time-step for this kick
* @param half_dt The half time-step for this kick
*/
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
struct
xpart
*
xp
,
float
dt
,
float
half_dt
)
{
__attribute__
((
always_inline
))
INLINE
static
void
hydro_kick_extra
(
struct
part
*
p
,
struct
xpart
*
xp
,
float
dt
,
float
half_dt
)
{
/* Kick in momentum space */
xp
->
u_full
+=
p
->
u_dt
*
dt
;
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Minimal/hydro_debug.h
+
5
−
3
View file @
73bff3f1
...
...
@@ -21,11 +21,13 @@ __attribute__((always_inline))
INLINE
static
void
hydro_debug_particle
(
struct
part
*
p
,
struct
xpart
*
xp
)
{
printf
(
"x=[%.3e,%.3e,%.3e], "
"v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e]
\n
a=[%.3e,%.3e,%.3e],
\n
"
"h=%.3e, "
"v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e]
\n
a=[%.3e,%.3e,%.3e], "
"u_full=%.3e, u=%.3e, du/dt=%.3e v_sig=%.3e, P=%.3e
\n
"
"h=%.3e, dh/dt=%.3e "
"wcount=%d, m=%.3e, dh_drho=%.3e, rho=%.3e, t_begin=%.3e, t_end=%.3e
\n
"
,
p
->
x
[
0
],
p
->
x
[
1
],
p
->
x
[
2
],
p
->
v
[
0
],
p
->
v
[
1
],
p
->
v
[
2
],
xp
->
v_full
[
0
],
xp
->
v_full
[
1
],
xp
->
v_full
[
2
],
p
->
a_hydro
[
0
],
p
->
a_hydro
[
1
],
p
->
a_hydro
[
2
],
p
->
h
,
(
int
)
p
->
density
.
wcount
,
p
->
mass
,
p
->
rho_dh
,
p
->
rho
,
p
->
t_begin
,
xp
->
u_full
,
p
->
u
,
p
->
u_dt
,
p
->
force
.
v_sig
,
p
->
force
.
pressure
,
p
->
h
,
p
->
h_dt
,
(
int
)
p
->
density
.
wcount
,
p
->
mass
,
p
->
rho_dh
,
p
->
rho
,
p
->
t_begin
,
p
->
t_end
);
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment