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
9cdbe7b0
Commit
9cdbe7b0
authored
4 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of gitlab.cosma.dur.ac.uk:swift/swiftsim
parents
415f21ce
8833dcba
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/feedback/GEAR/feedback.c
+8
-1
8 additions, 1 deletion
src/feedback/GEAR/feedback.c
src/feedback/GEAR/stellar_evolution.c
+5
-3
5 additions, 3 deletions
src/feedback/GEAR/stellar_evolution.c
with
13 additions
and
4 deletions
src/feedback/GEAR/feedback.c
+
8
−
1
View file @
9cdbe7b0
...
@@ -225,7 +225,13 @@ void feedback_evolve_spart(struct spart* restrict sp,
...
@@ -225,7 +225,13 @@ void feedback_evolve_spart(struct spart* restrict sp,
#ifdef SWIFT_DEBUG_CHECKS
#ifdef SWIFT_DEBUG_CHECKS
if
(
sp
->
birth_time
==
-
1
.)
error
(
"Evolving a star particle that should not!"
);
if
(
sp
->
birth_time
==
-
1
.)
error
(
"Evolving a star particle that should not!"
);
if
(
star_age_beg_step
<
-
1e-6
)
{
error
(
"Negative age for a star"
);
}
#endif
#endif
const
double
star_age_beg_step_safe
=
star_age_beg_step
<
0
?
0
:
star_age_beg_step
;
/* Reset the feedback */
/* Reset the feedback */
feedback_reset_feedback
(
sp
,
feedback_props
);
feedback_reset_feedback
(
sp
,
feedback_props
);
...
@@ -238,7 +244,8 @@ void feedback_evolve_spart(struct spart* restrict sp,
...
@@ -238,7 +244,8 @@ void feedback_evolve_spart(struct spart* restrict sp,
/* Compute the stellar evolution */
/* Compute the stellar evolution */
stellar_evolution_evolve_spart
(
sp
,
&
feedback_props
->
stellar_model
,
cosmo
,
us
,
stellar_evolution_evolve_spart
(
sp
,
&
feedback_props
->
stellar_model
,
cosmo
,
us
,
phys_const
,
ti_begin
,
star_age_beg_step
,
dt
);
phys_const
,
ti_begin
,
star_age_beg_step_safe
,
dt
);
/* Transform the number of SN to the energy */
/* Transform the number of SN to the energy */
sp
->
feedback_data
.
energy_ejected
=
sp
->
feedback_data
.
energy_ejected
=
...
...
This diff is collapsed.
Click to expand it.
src/feedback/GEAR/stellar_evolution.c
+
5
−
3
View file @
9cdbe7b0
...
@@ -187,10 +187,12 @@ void stellar_evolution_compute_discrete_feedback_properties(
...
@@ -187,10 +187,12 @@ void stellar_evolution_compute_discrete_feedback_properties(
const
float
log_m_end_step
,
const
float
m_beg_step
,
const
float
m_end_step
,
const
float
log_m_end_step
,
const
float
m_beg_step
,
const
float
m_end_step
,
const
float
m_init
,
const
int
number_snia
,
const
int
number_snii
)
{
const
float
m_init
,
const
int
number_snia
,
const
int
number_snii
)
{
/* Limit the mass within the imf limits */
const
float
m_beg_lim
=
min
(
m_beg_step
,
sm
->
imf
.
mass_max
);
const
float
m_end_lim
=
max
(
m_end_step
,
sm
->
imf
.
mass_min
);
/* Compute the average mass */
/* Compute the average mass */
const
float
m_avg
=
const
float
m_avg
=
0
.
5
*
(
m_beg_lim
+
m_end_lim
);
initial_mass_function_get_integral_imf
(
&
sm
->
imf
,
m_end_step
,
m_beg_step
)
/
initial_mass_function_get_integral_xi
(
&
sm
->
imf
,
m_end_step
,
m_beg_step
);
const
float
log_m_avg
=
log10
(
m_avg
);
const
float
log_m_avg
=
log10
(
m_avg
);
/* Compute the mass ejected */
/* Compute the mass ejected */
...
...
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