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
cde83f0c
Commit
cde83f0c
authored
7 years ago
by
lhausamm
Browse files
Options
Downloads
Patches
Plain Diff
Initialize grackle data
parent
ac06f5c6
No related branches found
No related tags found
1 merge request
!499
Improved grackle
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cooling/grackle/cooling.h
+41
-13
41 additions, 13 deletions
src/cooling/grackle/cooling.h
src/cooling/grackle/cooling_struct.h
+1
-1
1 addition, 1 deletion
src/cooling/grackle/cooling_struct.h
with
42 additions
and
14 deletions
src/cooling/grackle/cooling.h
+
41
−
13
View file @
cde83f0c
...
@@ -69,6 +69,34 @@ __attribute__((always_inline)) INLINE static void cooling_first_init_part(
...
@@ -69,6 +69,34 @@ __attribute__((always_inline)) INLINE static void cooling_first_init_part(
const
struct
cooling_function_data
*
cooling
)
{
const
struct
cooling_function_data
*
cooling
)
{
xp
->
cooling_data
.
radiated_energy
=
0
.
f
;
xp
->
cooling_data
.
radiated_energy
=
0
.
f
;
#if COOLING_GRACKLE_MODE >= 1
/* primordial chemistry >= 1 */
xp
->
cooling_data
.
HI_density
=
0
.
f
;
xp
->
cooling_data
.
HII_density
=
0
.
f
;
xp
->
cooling_data
.
HeI_density
=
0
.
f
;
xp
->
cooling_data
.
HeII_density
=
0
.
f
;
xp
->
cooling_data
.
HeIII_density
=
0
.
f
;
xp
->
cooling_data
.
e_density
=
0
.
f
;
#if COOLING_GRACKLE_MODE >= 2
/* primordial chemistry >= 2 */
xp
->
cooling_data
.
HM_density
=
0
.
f
;
xp
->
cooling_data
.
H2I_density
=
0
.
f
;
xp
->
cooling_data
.
H2II_density
=
0
.
f
;
#if COOLING_GRACKLE_MODE >= 3
/* primordial chemistry >= 3 */
xp
->
cooling_data
.
DI_density
=
0
.
f
;
xp
->
cooling_data
.
DII_density
=
0
.
f
;
xp
->
cooling_data
.
HDI_density
=
0
.
f
;
#endif // MODE >= 3
#endif // MODE >= 2
#endif // MODE >= 1
/* metal cooling = 1 */
xp
->
cooling_data
.
metal_density
=
0
.
f
;
}
}
/**
/**
...
@@ -168,24 +196,24 @@ __attribute__((always_inline)) INLINE static double cooling_rate(
...
@@ -168,24 +196,24 @@ __attribute__((always_inline)) INLINE static double cooling_rate(
#if COOLING_GRACKLE_MODE >= 1
#if COOLING_GRACKLE_MODE >= 1
/* primordial chemistry >= 1 */
/* primordial chemistry >= 1 */
data
.
HI_density
=
&
xp
->
HI_density
;
data
.
HI_density
=
&
xp
->
cooling_data
.
HI_density
;
data
.
HII_density
=
&
xp
->
HII_density
;
data
.
HII_density
=
&
xp
->
cooling_data
.
HII_density
;
data
.
HeI_density
=
&
xp
->
HeI_density
;
data
.
HeI_density
=
&
xp
->
cooling_data
.
HeI_density
;
data
.
HeII_density
=
&
xp
->
HeII_density
;
data
.
HeII_density
=
&
xp
->
cooling_data
.
HeII_density
;
data
.
HeIII_density
=
&
xp
->
HeIII_density
;
data
.
HeIII_density
=
&
xp
->
cooling_data
.
HeIII_density
;
data
.
e_density
=
&
xp
->
e_density
;
data
.
e_density
=
&
xp
->
cooling_data
.
e_density
;
#if COOLING_GRACKLE_MODE >= 2
#if COOLING_GRACKLE_MODE >= 2
/* primordial chemistry >= 2 */
/* primordial chemistry >= 2 */
data
.
HM_density
=
&
xp
->
HM_density
;
data
.
HM_density
=
&
xp
->
cooling_data
.
HM_density
;
data
.
H2I_density
=
&
xp
->
H2I_density
;
data
.
H2I_density
=
&
xp
->
cooling_data
.
H2I_density
;
data
.
H2II_density
=
&
xp
->
H2II_density
;
data
.
H2II_density
=
&
xp
->
cooling_data
.
H2II_density
;
#if COOLING_GRACKLE_MODE >= 3
#if COOLING_GRACKLE_MODE >= 3
/* primordial chemistry >= 3 */
/* primordial chemistry >= 3 */
data
.
DI_density
=
&
xp
->
DI_density
;
data
.
DI_density
=
&
xp
->
cooling_data
.
DI_density
;
data
.
DII_density
=
&
xp
->
DII_density
;
data
.
DII_density
=
&
xp
->
cooling_data
.
DII_density
;
data
.
HDI_density
=
&
xp
->
HDI_density
;
data
.
HDI_density
=
&
xp
->
cooling_data
.
HDI_density
;
#endif // MODE >= 3
#endif // MODE >= 3
#endif // MODE >= 2
#endif // MODE >= 2
...
@@ -193,7 +221,7 @@ __attribute__((always_inline)) INLINE static double cooling_rate(
...
@@ -193,7 +221,7 @@ __attribute__((always_inline)) INLINE static double cooling_rate(
#endif // MODE >= 1
#endif // MODE >= 1
/* metal cooling = 1 */
/* metal cooling = 1 */
data
.
metal_density
=
&
xp
->
metal_density
;
data
.
metal_density
=
&
xp
->
cooling_data
.
metal_density
;
/* /\* volumetric heating rate *\/ */
/* /\* volumetric heating rate *\/ */
/* gr_float volumetric_heating_rate = 0.; */
/* gr_float volumetric_heating_rate = 0.; */
...
...
This diff is collapsed.
Click to expand it.
src/cooling/grackle/cooling_struct.h
+
1
−
1
View file @
cde83f0c
...
@@ -88,7 +88,7 @@ struct cooling_xpart_data {
...
@@ -88,7 +88,7 @@ struct cooling_xpart_data {
#endif // MODE >= 1
#endif // MODE >= 1
/* metal cooling = 1 */
/* metal cooling = 1 */
gr_float
metal_density
=
density
*
grackle_data
->
SolarMetalFractionByMass
;
gr_float
metal_density
;
};
};
#endif
/* SWIFT_COOLING_STRUCT_NONE_H */
#endif
/* SWIFT_COOLING_STRUCT_NONE_H */
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