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
7263d03f
Commit
7263d03f
authored
Feb 03, 2019
by
Matthieu Schaller
Browse files
Remove the debugging information from the snapshots and stdout.
parent
a7e80ee6
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/runner.c
View file @
7263d03f
...
...
@@ -522,9 +522,9 @@ void runner_do_star_formation(struct runner *r, struct cell *c, int timer) {
dt_star
=
get_timestep
(
p
->
time_bin
,
time_base
);
}
if
(
star_formation_convert_to_star
(
e
,
starform
,
p
,
xp
,
constants
,
cosmo
,
hydro_props
,
us
,
cooling
,
dt_star
,
with_cosmology
))
{
if
(
star_formation_
should_
convert_to_star
(
e
,
starform
,
p
,
xp
,
constants
,
cosmo
,
hydro_props
,
us
,
cooling
,
dt_star
,
with_cosmology
))
{
/* Convert your particle to a star */
struct
spart
*
sp
=
cell_convert_part_to_spart
(
e
,
c
,
p
,
xp
);
...
...
src/star_formation/EAGLE/star_formation.h
View file @
7263d03f
...
...
@@ -212,7 +212,7 @@ INLINE static float EOS_temperature(const float n_H,
* @param cooling The cooling data struct.
*
*/
INLINE
static
int
star_formation_
potential_to_become_star
(
INLINE
static
int
star_formation_
is_star_forming
(
const
struct
star_formation
*
starform
,
const
struct
part
*
restrict
p
,
const
struct
xpart
*
restrict
xp
,
const
struct
phys_const
*
const
phys_const
,
const
struct
cosmology
*
cosmo
,
...
...
@@ -277,7 +277,7 @@ INLINE static int star_formation_potential_to_become_star(
* @param dt_star The time-step of this particle.
* @param with_cosmology Are we running with cosmology on?
*/
INLINE
static
int
star_formation_convert_to_star
(
INLINE
static
int
star_formation_
should_
convert_to_star
(
const
struct
engine
*
e
,
const
struct
star_formation
*
starform
,
const
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
const
struct
phys_const
*
const
phys_const
,
const
struct
cosmology
*
cosmo
,
...
...
@@ -287,10 +287,12 @@ INLINE static int star_formation_convert_to_star(
const
int
with_cosmology
)
{
/* Abort early if time-step size is 0 */
if
(
dt_star
==
0
.
f
)
return
0
;
if
(
dt_star
==
0
.
f
)
{
return
0
;
}
if
(
star_formation_
potential_to_become_star
(
starform
,
p
,
xp
,
phys_const
,
cosmo
,
hydro_props
,
us
,
cooling
))
{
if
(
star_formation_
is_star_forming
(
starform
,
p
,
xp
,
phys_const
,
cosmo
,
hydro_props
,
us
,
cooling
))
{
/* Hydrogen number density of this particle */
const
double
physical_density
=
hydro_get_physical_density
(
p
,
cosmo
);
...
...
@@ -322,7 +324,6 @@ INLINE static int star_formation_convert_to_star(
/* Store the SFR */
xp
->
sf_data
.
SFR
=
SFRpergasmass
*
p
->
mass
;
xp
->
sf_data
.
sSFR
=
SFRpergasmass
;
/* Calculate the propability of forming a star */
const
double
prop
=
SFRpergasmass
*
dt_star
;
...
...
@@ -339,10 +340,8 @@ INLINE static int star_formation_convert_to_star(
if
(
xp
->
sf_data
.
SFR
>
0
.
f
)
{
if
(
with_cosmology
)
{
xp
->
sf_data
.
SFR
=
-
cosmo
->
a
;
xp
->
sf_data
.
sSFR
=
0
.
f
;
}
else
{
xp
->
sf_data
.
SFR
=
-
e
->
time
;
xp
->
sf_data
.
sSFR
=
0
.
f
;
}
}
...
...
@@ -389,10 +388,6 @@ INLINE static void star_formation_copy_properties(
/* Store the birth density in the star particle */
sp
->
birth_density
=
hydro_get_physical_density
(
p
,
cosmo
);
sp
->
new_star_flag
=
1
;
message
(
"A star has been formed!"
);
}
/**
...
...
src/star_formation/EAGLE/star_formation_io.h
View file @
7263d03f
...
...
@@ -41,10 +41,7 @@ __attribute__((always_inline)) INLINE static int star_formation_write_particles(
list
[
0
]
=
io_make_output_field
(
"SFR"
,
FLOAT
,
1
,
UNIT_CONV_SFR
,
xparts
,
sf_data
.
SFR
);
list
[
1
]
=
io_make_output_field
(
"sSFR"
,
FLOAT
,
1
,
UNIT_CONV_SSFR
,
xparts
,
sf_data
.
sSFR
);
return
2
;
return
1
;
}
#endif
/* SWIFT_STAR_FORMATION_EAGLE_IO_H */
src/star_formation/EAGLE/star_formation_struct.h
View file @
7263d03f
...
...
@@ -27,9 +27,6 @@ struct star_formation_xpart_data {
/*! Star formation rate */
float
SFR
;
/*! Specific star formation rate */
float
sSFR
;
};
#endif
/* SWIFT_EAGLE_STAR_FORMATION_STRUCT_H */
src/stars/EAGLE/stars.h
View file @
7263d03f
...
...
@@ -45,8 +45,7 @@ __attribute__((always_inline)) INLINE static void stars_first_init_spart(
struct
spart
*
sp
)
{
sp
->
time_bin
=
0
;
sp
->
new_star_flag
=
0
;
sp
->
birth_density
=
0
.
f
;
sp
->
birth_density
=
-
1
.
f
;
}
/**
...
...
src/stars/EAGLE/stars_io.h
View file @
7263d03f
...
...
@@ -62,7 +62,7 @@ INLINE static void stars_write_particles(const struct spart *sparts,
int
*
num_fields
)
{
/* Say how much we want to write */
*
num_fields
=
9
;
*
num_fields
=
8
;
/* List what we want to write */
list
[
0
]
=
io_make_output_field
(
"Coordinates"
,
DOUBLE
,
3
,
UNIT_CONV_LENGTH
,
...
...
@@ -75,13 +75,11 @@ INLINE static void stars_write_particles(const struct spart *sparts,
sparts
,
id
);
list
[
4
]
=
io_make_output_field
(
"SmoothingLength"
,
FLOAT
,
1
,
UNIT_CONV_LENGTH
,
sparts
,
h
);
list
[
5
]
=
io_make_output_field
(
"NewStarFlag"
,
INT
,
1
,
UNIT_CONV_NO_UNITS
,
sparts
,
new_star_flag
);
list
[
6
]
=
io_make_output_field
(
"BirthDensity"
,
FLOAT
,
1
,
UNIT_CONV_DENSITY
,
list
[
5
]
=
io_make_output_field
(
"BirthDensity"
,
FLOAT
,
1
,
UNIT_CONV_DENSITY
,
sparts
,
birth_density
);
list
[
7
]
=
io_make_output_field
(
"Initial_Masses"
,
FLOAT
,
1
,
UNIT_CONV_MASS
,
list
[
6
]
=
io_make_output_field
(
"Initial_Masses"
,
FLOAT
,
1
,
UNIT_CONV_MASS
,
sparts
,
mass_init
);
list
[
8
]
=
io_make_output_field
(
"Birth_time"
,
FLOAT
,
1
,
UNIT_CONV_TIME
,
sparts
,
list
[
7
]
=
io_make_output_field
(
"Birth_time"
,
FLOAT
,
1
,
UNIT_CONV_TIME
,
sparts
,
birth_time
);
}
...
...
src/stars/EAGLE/stars_part.h
View file @
7263d03f
...
...
@@ -70,9 +70,6 @@ struct spart {
/*! Birth density */
float
birth_density
;
/*! New star flag */
int
new_star_flag
;
/*! Tracer structure */
struct
tracers_xpart_data
tracers_data
;
...
...
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