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
d0236bd7
Commit
d0236bd7
authored
7 years ago
by
lhausamm
Browse files
Options
Downloads
Patches
Plain Diff
Removing compilation errors
parent
f3520640
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!469
Update cooling grackle
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
configure.ac
+1
-0
1 addition, 0 deletions
configure.ac
src/Makefile.am
+2
-0
2 additions, 0 deletions
src/Makefile.am
src/cooling/grackle/cooling.h
+9
-16
9 additions, 16 deletions
src/cooling/grackle/cooling.h
src/hydro/Gadget2/hydro_part.h
+0
-3
0 additions, 3 deletions
src/hydro/Gadget2/hydro_part.h
with
12 additions
and
19 deletions
configure.ac
+
1
−
0
View file @
d0236bd7
...
...
@@ -431,6 +431,7 @@ AC_ARG_WITH([grackle],
[with_grackle="no"]
)
if test "x$with_grackle" != "xno"; then
AC_PROG_FC
AC_FC_LIBRARY_LDFLAGS
if test "x$with_grackle" != "xyes" -a "x$with_grackle" != "x"; then
GRACKLE_LIBS="-L$with_grackle/lib -lgrackle $FCLIBS"
...
...
This diff is collapsed.
Click to expand it.
src/Makefile.am
+
2
−
0
View file @
d0236bd7
...
...
@@ -116,6 +116,8 @@ nobase_noinst_HEADERS = align.h approx_math.h atomic.h barrier.h cycle.h error.h
cooling/none/cooling.h cooling/none/cooling_struct.h
\
cooling/const_du/cooling.h cooling/const_du/cooling_struct.h
\
cooling/const_lambda/cooling.h cooling/const_lambda/cooling_struct.h
\
cooling/grackle/cooling.h cooling/grackle/cooling_struct.h
\
cooling/grackle/grackle_wrapper.h
\
memswap.h dump.h logger.h
...
...
This diff is collapsed.
Click to expand it.
src/cooling/grackle/cooling.h
+
9
−
16
View file @
d0236bd7
...
...
@@ -47,7 +47,7 @@
* between step t0 and t1.
*/
static
INLINE
double
DoC
ooling_
GRACKLE
(
double
energy
,
double
density
,
double
dtime
,
double
*
ne
,
double
Z
,
double
a_now
)
static
INLINE
double
do_c
ooling_
grackle
(
double
energy
,
double
density
,
double
dtime
,
double
*
ne
,
double
Z
,
double
a_now
)
{
...
...
@@ -57,7 +57,7 @@ static INLINE double DoCooling_GRACKLE(double energy, double density, double dti
*********************************************************************/
if
(
wrap_do_cooling
(
density
,
&
energy
,
dtime
,
Z
,
a_now
)
==
0
)
{
fprintf
(
stderr
,
"Error in do_cooling.
\n
"
);
error
(
"Error in do_cooling.
\n
"
);
return
0
;
}
...
...
@@ -68,10 +68,6 @@ static INLINE double DoCooling_GRACKLE(double energy, double density, double dti
}
/**
* @brief Apply the cooling function to a particle.
*
...
...
@@ -85,7 +81,7 @@ static INLINE double DoCooling_GRACKLE(double energy, double density, double dti
*/
__attribute__
((
always_inline
))
INLINE
static
void
cooling_cool_part
(
const
struct
phys_const
*
restrict
phys_const
,
const
struct
U
nit
S
ystem
*
restrict
us
,
const
struct
u
nit
_s
ystem
*
restrict
us
,
const
struct
cooling_function_data
*
restrict
cooling
,
struct
part
*
restrict
p
,
struct
xpart
*
restrict
xp
,
float
dt
)
{
...
...
@@ -93,7 +89,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
/* Get current internal energy (dt=0) */
const
float
u_old
=
hydro_get_internal_energy
(
p
,
0
.
f
);
const
float
u_old
=
hydro_get_internal_energy
(
p
);
/* Get current density */
const
float
rho
=
hydro_get_density
(
p
);
/* Actual scaling fractor */
...
...
@@ -108,7 +104,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
float
u_new
;
float
delta_u
;
u_new
=
DoC
ooling_
GRACKLE
(
u_old
,
rho
,
dt
,
&
ne
,
Z
,
a_now
);
u_new
=
do_c
ooling_
grackle
(
u_old
,
rho
,
dt
,
&
ne
,
Z
,
a_now
);
//u_new = u_old * 0.99;
...
...
@@ -129,11 +125,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
/* Update the internal energy */
hydro_set_internal_energy
(
p
,
u_new
);
hydro_set_internal_energy_dt
(
p
,
delta_u
/
dt
);
}
...
...
@@ -150,7 +142,7 @@ __attribute__((always_inline)) INLINE static void cooling_cool_part(
__attribute__
((
always_inline
))
INLINE
static
float
cooling_timestep
(
const
struct
cooling_function_data
*
restrict
cooling
,
const
struct
phys_const
*
restrict
phys_const
,
const
struct
U
nit
S
ystem
*
restrict
us
,
const
struct
part
*
restrict
p
)
{
const
struct
u
nit
_s
ystem
*
restrict
us
,
const
struct
part
*
restrict
p
)
{
return
FLT_MAX
;
}
...
...
@@ -188,7 +180,8 @@ __attribute__((always_inline)) INLINE static float cooling_get_radiated_energy(
* @param cooling The cooling properties to initialize
*/
static
INLINE
void
cooling_init_backend
(
const
struct
swift_params
*
parameter_file
,
const
struct
UnitSystem
*
us
,
const
struct
swift_params
*
parameter_file
,
const
struct
unit_system
*
us
,
const
struct
phys_const
*
phys_const
,
struct
cooling_function_data
*
cooling
)
{
...
...
This diff is collapsed.
Click to expand it.
src/hydro/Gadget2/hydro_part.h
+
0
−
3
View file @
d0236bd7
...
...
@@ -45,9 +45,6 @@ struct xpart {
/* Velocity at the last full step. */
float
v_full
[
3
];
/* Radiated energy */
float
e_radcool
;
/* Entropy at the last full step. */
float
entropy_full
;
...
...
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