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
4884a894
Commit
4884a894
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Also add the checks that have been added to the COLIBRE version of feedback.
parent
767e4e3d
No related branches found
No related tags found
1 merge request
!949
Fix rounding error problem in the enrichment routines.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/feedback/EAGLE/feedback.c
+10
-0
10 additions, 0 deletions
src/feedback/EAGLE/feedback.c
with
10 additions
and
0 deletions
src/feedback/EAGLE/feedback.c
+
10
−
0
View file @
4884a894
...
@@ -728,6 +728,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props,
...
@@ -728,6 +728,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props,
const
float
enrichment_weight_inv
=
const
float
enrichment_weight_inv
=
sp
->
feedback_data
.
to_collect
.
enrichment_weight_inv
;
sp
->
feedback_data
.
to_collect
.
enrichment_weight_inv
;
#ifdef SWIFT_DEBUG_CHECKS
if
(
sp
->
feedback_data
.
to_collect
.
enrichment_weight_inv
<
0
.)
error
(
"Negative inverse weight!"
);
#endif
/* Now we start filling the data structure for information to apply to the
/* Now we start filling the data structure for information to apply to the
* particles. Do _NOT_ read from the to_collect substructure any more. */
* particles. Do _NOT_ read from the to_collect substructure any more. */
...
@@ -739,6 +744,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props,
...
@@ -739,6 +744,11 @@ void compute_stellar_evolution(const struct feedback_props* feedback_props,
(
enrichment_weight_inv
!=
0
.
f
)
?
1
.
f
/
enrichment_weight_inv
:
0
.
f
;
(
enrichment_weight_inv
!=
0
.
f
)
?
1
.
f
/
enrichment_weight_inv
:
0
.
f
;
sp
->
feedback_data
.
to_distribute
.
enrichment_weight
=
enrichment_weight
;
sp
->
feedback_data
.
to_distribute
.
enrichment_weight
=
enrichment_weight
;
#ifdef SWIFT_DEBUG_CHECKS
if
(
sp
->
feedback_data
.
to_collect
.
enrichment_weight
<
0
.)
error
(
"Negative weight!"
);
#endif
/* Compute properties of the stochastic SNII feedback model. */
/* Compute properties of the stochastic SNII feedback model. */
if
(
feedback_props
->
with_SNII_feedback
)
{
if
(
feedback_props
->
with_SNII_feedback
)
{
compute_SNII_feedback
(
sp
,
age
,
dt
,
ngb_gas_mass
,
feedback_props
);
compute_SNII_feedback
(
sp
,
age
,
dt
,
ngb_gas_mass
,
feedback_props
);
...
...
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