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
8637788b
Commit
8637788b
authored
8 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Generalized the mechanism to add an extra initialisation loop to the SPH set-up.
parent
aefe3c71
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!252
Implementation Pressure entropy SPH
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/engine.c
+9
-2
9 additions, 2 deletions
src/engine.c
src/part.h
+5
-0
5 additions, 0 deletions
src/part.h
with
14 additions
and
2 deletions
src/engine.c
+
9
−
2
View file @
8637788b
...
...
@@ -2658,8 +2658,15 @@ void engine_init_particles(struct engine *e, int flag_entropy_ICs) {
TIMER_TOC
(
timer_runners
);
/* Apply some conversions (e.g. internal energy -> entropy) */
if
(
!
flag_entropy_ICs
)
space_map_cells_pre
(
s
,
0
,
cell_convert_hydro
,
NULL
);
if
(
1
)
engine_launch
(
e
,
e
->
nr_threads
,
mask
,
submask
);
if
(
!
flag_entropy_ICs
)
{
/* Apply the conversion */
space_map_cells_pre
(
s
,
0
,
cell_convert_hydro
,
NULL
);
/* Correct what we did (e.g. in PE-SPH, need to recompute rho_bar) */
if
(
hydro_need_extra_init_loop
)
engine_launch
(
e
,
e
->
nr_threads
,
mask
,
submask
);
}
clocks_gettime
(
&
time2
);
...
...
This diff is collapsed.
Click to expand it.
src/part.h
+
5
−
0
View file @
8637788b
...
...
@@ -42,14 +42,19 @@
/* Import the right hydro particle definition */
#if defined(MINIMAL_SPH)
#include
"./hydro/Minimal/hydro_part.h"
#define hydro_need_extra_init_loop 0
#elif defined(GADGET2_SPH)
#include
"./hydro/Gadget2/hydro_part.h"
#define hydro_need_extra_init_loop 0
#elif defined(HOPKINS_PE_SPH)
#include
"./hydro/PressureEntropy/hydro_part.h"
#define hydro_need_extra_init_loop 1
#elif defined(DEFAULT_SPH)
#include
"./hydro/Default/hydro_part.h"
#define hydro_need_extra_init_loop 0
#elif defined(GIZMO_SPH)
#include
"./hydro/Gizmo/hydro_part.h"
#define hydro_need_extra_init_loop 0
#define EXTRA_HYDRO_LOOP
#else
#error "Invalid choice of SPH variant"
...
...
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