Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
SWIFTsim
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
70
Issues
70
List
Boards
Labels
Milestones
Merge Requests
13
Merge Requests
13
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SWIFT
SWIFTsim
Commits
f5d2a8bb
Commit
f5d2a8bb
authored
Apr 18, 2018
by
lhausamm
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
temporary fix for Grackle in parallel -> issue waiting on grackle side
parent
bc4279c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
6 deletions
+46
-6
src/cooling/grackle/cooling.h
src/cooling/grackle/cooling.h
+46
-6
No files found.
src/cooling/grackle/cooling.h
View file @
f5d2a8bb
...
@@ -314,7 +314,13 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
...
@@ -314,7 +314,13 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
cooling_copy_field_to_grackle(data, xp, rho, HeIII); \
cooling_copy_field_to_grackle(data, xp, rho, HeIII); \
cooling_copy_field_to_grackle(data, xp, rho, e);
cooling_copy_field_to_grackle(data, xp, rho, e);
#else
#else
#define cooling_copy_to_grackle1(data, p, xp, rho)
#define cooling_copy_to_grackle1(data, p, xp, rho) \
data.HI_density = NULL; \
data.HII_density = NULL; \
data.HeI_density = NULL; \
data.HeII_density = NULL; \
data.HeIII_density = NULL; \
data.e_density = NULL;
#endif
#endif
/**
/**
...
@@ -334,7 +340,10 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
...
@@ -334,7 +340,10 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
cooling_copy_field_to_grackle(data, xp, rho, H2I); \
cooling_copy_field_to_grackle(data, xp, rho, H2I); \
cooling_copy_field_to_grackle(data, xp, rho, H2II);
cooling_copy_field_to_grackle(data, xp, rho, H2II);
#else
#else
#define cooling_copy_to_grackle2(data, p, xp, rho)
#define cooling_copy_to_grackle2(data, p, xp, rho) \
data.HM_density = NULL; \
data.H2I_density = NULL; \
data.H2II_density = NULL;
#endif
#endif
/**
/**
...
@@ -354,7 +363,10 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
...
@@ -354,7 +363,10 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
cooling_copy_field_to_grackle(data, xp, rho, DII); \
cooling_copy_field_to_grackle(data, xp, rho, DII); \
cooling_copy_field_to_grackle(data, xp, rho, HDI);
cooling_copy_field_to_grackle(data, xp, rho, HDI);
#else
#else
#define cooling_copy_to_grackle3(data, p, xp, rho)
#define cooling_copy_to_grackle3(data, p, xp, rho) \
data.DI_density = NULL; \
data.DII_density = NULL; \
data.HDI_density = NULL;
#endif
#endif
/**
/**
...
@@ -427,6 +439,13 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
...
@@ -427,6 +439,13 @@ __attribute__((always_inline)) INLINE static void cooling_print_backend(
cooling_copy_to_grackle1(data, p, xp, rho); \
cooling_copy_to_grackle1(data, p, xp, rho); \
cooling_copy_to_grackle2(data, p, xp, rho); \
cooling_copy_to_grackle2(data, p, xp, rho); \
cooling_copy_to_grackle3(data, p, xp, rho); \
cooling_copy_to_grackle3(data, p, xp, rho); \
data.volumetric_heating_rate = NULL; \
data.specific_heating_rate = NULL; \
data.RT_heating_rate = NULL; \
data.RT_HI_ionization_rate = NULL; \
data.RT_HeI_ionization_rate = NULL; \
data.RT_HeII_ionization_rate = NULL; \
data.RT_H2_dissociation_rate = NULL; \
gr_float metal_density = chemistry_metal_mass_fraction(p, xp) * rho; \
gr_float metal_density = chemistry_metal_mass_fraction(p, xp) * rho; \
data.metal_density = &metal_density;
data.metal_density = &metal_density;
...
@@ -481,6 +500,7 @@ __attribute__((always_inline)) INLINE static gr_float cooling_rate(
...
@@ -481,6 +500,7 @@ __attribute__((always_inline)) INLINE static gr_float cooling_rate(
int
grid_start
[
GRACKLE_RANK
]
=
{
0
,
0
,
0
};
int
grid_start
[
GRACKLE_RANK
]
=
{
0
,
0
,
0
};
int
grid_end
[
GRACKLE_RANK
]
=
{
GRACKLE_NPART
-
1
,
0
,
0
};
int
grid_end
[
GRACKLE_RANK
]
=
{
GRACKLE_NPART
-
1
,
0
,
0
};
data
.
grid_dx
=
0
.;
data
.
grid_rank
=
GRACKLE_RANK
;
data
.
grid_rank
=
GRACKLE_RANK
;
data
.
grid_dimension
=
grid_dimension
;
data
.
grid_dimension
=
grid_dimension
;
data
.
grid_start
=
grid_start
;
data
.
grid_start
=
grid_start
;
...
@@ -506,9 +526,29 @@ __attribute__((always_inline)) INLINE static gr_float cooling_rate(
...
@@ -506,9 +526,29 @@ __attribute__((always_inline)) INLINE static gr_float cooling_rate(
cooling_copy_to_grackle
(
data
,
p
,
xp
,
density
);
cooling_copy_to_grackle
(
data
,
p
,
xp
,
density
);
/* solve chemistry with table */
/* solve chemistry with table */
if
(
solve_chemistry
(
&
units
,
&
data
,
dt
)
==
0
)
{
error
(
"Error in solve_chemistry."
);
}
chemistry_data
chemistry_grackle
=
cooling
->
chemistry
;
chemistry_data_storage
my_rates
=
grackle_rates
;
_solve_chemistry
(
&
chemistry_grackle
,
&
my_rates
,
&
units
,
dt
,
data
.
grid_dx
,
data
.
grid_rank
,
data
.
grid_dimension
,
data
.
grid_start
,
data
.
grid_end
,
data
.
density
,
data
.
internal_energy
,
data
.
x_velocity
,
data
.
y_velocity
,
data
.
z_velocity
,
data
.
HI_density
,
data
.
HII_density
,
data
.
HM_density
,
data
.
HeI_density
,
data
.
HeII_density
,
data
.
HeIII_density
,
data
.
H2I_density
,
data
.
H2II_density
,
data
.
DI_density
,
data
.
DII_density
,
data
.
HDI_density
,
data
.
e_density
,
data
.
metal_density
,
data
.
volumetric_heating_rate
,
data
.
specific_heating_rate
,
data
.
RT_heating_rate
,
data
.
RT_HI_ionization_rate
,
data
.
RT_HeI_ionization_rate
,
data
.
RT_HeII_ionization_rate
,
data
.
RT_H2_dissociation_rate
,
NULL
);
//if (solve_chemistry(&units, &data, dt) == 0) {
// error("Error in solve_chemistry.");
//}
/* copy from grackle data to particle */
/* copy from grackle data to particle */
cooling_copy_from_grackle
(
data
,
p
,
xp
,
density
);
cooling_copy_from_grackle
(
data
,
p
,
xp
,
density
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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