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
354db2e6
Commit
354db2e6
authored
6 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Corrected rounding error for the stellar age and SNII feedback.
parent
a8038b01
No related branches found
No related tags found
1 merge request
!805
Communication tasks for on-the-fly star formation
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/feedback/EAGLE/feedback.c
+10
-6
10 additions, 6 deletions
src/feedback/EAGLE/feedback.c
src/feedback/EAGLE/feedback.h
+2
-2
2 additions, 2 deletions
src/feedback/EAGLE/feedback.h
src/feedback/EAGLE/feedback_properties.h
+1
-1
1 addition, 1 deletion
src/feedback/EAGLE/feedback_properties.h
with
13 additions
and
9 deletions
src/feedback/EAGLE/feedback.c
+
10
−
6
View file @
354db2e6
...
@@ -138,14 +138,18 @@ INLINE static void compute_SNII_feedback(
...
@@ -138,14 +138,18 @@ INLINE static void compute_SNII_feedback(
const
float
ngb_gas_mass
,
const
struct
feedback_props
*
feedback_props
)
{
const
float
ngb_gas_mass
,
const
struct
feedback_props
*
feedback_props
)
{
/* Time after birth considered for SNII feedback (internal units) */
/* Time after birth considered for SNII feedback (internal units) */
const
float
SNII_wind_delay
=
feedback_props
->
SNII_wind_delay
;
const
double
SNII_wind_delay
=
feedback_props
->
SNII_wind_delay
;
/* Are we doing feedback this step? */
/* Are we doing feedback this step? */
if
(
star_age
<=
SNII_wind_delay
&&
(
star_age
+
dt
)
>
SNII_wind_delay
)
{
if
(
star_age
<=
SNII_wind_delay
&&
(
star_age
+
dt
)
>
SNII_wind_delay
)
{
if
(
sp
->
f_E
!=
-
1
.
f
)
{
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
if
(
sp
->
f_E
!=
-
1
.
f
)
error
(
"Star has already done feedback!"
);
message
(
"Star has already done feedback! sp->id=%lld age=%e d=%e"
,
sp
->
id
,
star_age
,
dt
);
#endif
#endif
return
;
}
/* Properties of the model (all in internal units) */
/* Properties of the model (all in internal units) */
const
double
delta_T
=
const
double
delta_T
=
...
@@ -685,8 +689,8 @@ INLINE static void evolve_AGB(const float log10_min_mass, float log10_max_mass,
...
@@ -685,8 +689,8 @@ INLINE static void evolve_AGB(const float log10_min_mass, float log10_max_mass,
*/
*/
void
compute_stellar_evolution
(
const
struct
feedback_props
*
feedback_props
,
void
compute_stellar_evolution
(
const
struct
feedback_props
*
feedback_props
,
const
struct
cosmology
*
cosmo
,
struct
spart
*
sp
,
const
struct
cosmology
*
cosmo
,
struct
spart
*
sp
,
const
struct
unit_system
*
us
,
const
float
age
,
const
struct
unit_system
*
us
,
const
double
age
,
const
float
dt
)
{
const
double
dt
)
{
TIMER_TIC
;
TIMER_TIC
;
...
@@ -843,9 +847,9 @@ void feedback_props_init(struct feedback_props* fp,
...
@@ -843,9 +847,9 @@ void feedback_props_init(struct feedback_props* fp,
/* Properties of the SNII energy feedback model ------------------------- */
/* Properties of the SNII energy feedback model ------------------------- */
/* Set the delay time before SNII occur */
/* Set the delay time before SNII occur */
const
float
Gyr_in_cgs
=
1e9
*
365
*
24
*
3600
;
const
double
Gyr_in_cgs
=
1
.0
e9
*
365
.
*
24
.
*
3600
.
;
fp
->
SNII_wind_delay
=
fp
->
SNII_wind_delay
=
parser_get_param_
float
(
params
,
"EAGLEFeedback:SNII_wind_delay_Gyr"
)
*
parser_get_param_
double
(
params
,
"EAGLEFeedback:SNII_wind_delay_Gyr"
)
*
Gyr_in_cgs
/
units_cgs_conversion_factor
(
us
,
UNIT_CONV_TIME
);
Gyr_in_cgs
/
units_cgs_conversion_factor
(
us
,
UNIT_CONV_TIME
);
/* Read the temperature change to use in stochastic heating */
/* Read the temperature change to use in stochastic heating */
...
...
This diff is collapsed.
Click to expand it.
src/feedback/EAGLE/feedback.h
+
2
−
2
View file @
354db2e6
...
@@ -30,8 +30,8 @@
...
@@ -30,8 +30,8 @@
void
compute_stellar_evolution
(
const
struct
feedback_props
*
feedback_props
,
void
compute_stellar_evolution
(
const
struct
feedback_props
*
feedback_props
,
const
struct
cosmology
*
cosmo
,
struct
spart
*
sp
,
const
struct
cosmology
*
cosmo
,
struct
spart
*
sp
,
const
struct
unit_system
*
us
,
const
float
age
,
const
struct
unit_system
*
us
,
const
double
age
,
const
float
dt
);
const
double
dt
);
/**
/**
* @brief Should we do feedback for this star?
* @brief Should we do feedback for this star?
...
...
This diff is collapsed.
Click to expand it.
src/feedback/EAGLE/feedback_properties.h
+
1
−
1
View file @
354db2e6
...
@@ -201,7 +201,7 @@ struct feedback_props {
...
@@ -201,7 +201,7 @@ struct feedback_props {
float
num_SNII_per_msun
;
float
num_SNII_per_msun
;
/*! Wind delay time for SNII */
/*! Wind delay time for SNII */
float
SNII_wind_delay
;
double
SNII_wind_delay
;
/*! Temperature increase induced by SNe feedback */
/*! Temperature increase induced by SNe feedback */
float
SNe_deltaT_desired
;
float
SNe_deltaT_desired
;
...
...
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