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
da3eec1c
Commit
da3eec1c
authored
7 years ago
by
lhausamm
Browse files
Options
Downloads
Patches
Plain Diff
Remove grackle wrapper
parent
6c3f0c6a
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!484
Rework of Grackle
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/cooling/grackle/grackle_wrapper.c
+0
-104
0 additions, 104 deletions
src/cooling/grackle/grackle_wrapper.c
src/cooling/grackle/grackle_wrapper.h
+0
-48
0 additions, 48 deletions
src/cooling/grackle/grackle_wrapper.h
with
0 additions
and
152 deletions
src/cooling/grackle/grackle_wrapper.c
deleted
100644 → 0
+
0
−
104
View file @
6c3f0c6a
/***********************************************************************
/
/ Grackle c wrapper
/
/
/ Copyright (c) 2013, Enzo/Grackle Development Team.
/
/ Distributed under the terms of the Enzo Public Licence.
/
/ The full license is in the file LICENSE, distributed with this
/ software.
************************************************************************/
#include
"grackle_wrapper.h"
#ifdef SWIFT_DEBUG_CHECKS
#include
<assert.h>
#define GRACKLE_ASSERT(X) assert((X))
#else
#define GRACKLE_ASSERT(X)
#endif
code_units
my_units
;
// arrays passed to grackle as input and to be filled
#define FIELD_SIZE 1
gr_float
HDI_density
[
FIELD_SIZE
];
// Set grid dimension and size.
// grid_start and grid_end are used to ignore ghost zones.
const
int
grid_rank
=
1
;
int
wrap_get_cooling_time
(
double
rho
,
double
u
,
double
Z
,
double
a_now
,
double
*
coolingtime
)
{
gr_float
den_factor
=
1
.
0
;
gr_float
u_factor
=
1
.
0
;
gr_float
x_velocity
[
FIELD_SIZE
]
=
{
0
.
0
};
gr_float
y_velocity
[
FIELD_SIZE
]
=
{
0
.
0
};
gr_float
z_velocity
[
FIELD_SIZE
]
=
{
0
.
0
};
gr_float
density
[
FIELD_SIZE
]
=
{
rho
*
den_factor
};
gr_float
metal_density
[
FIELD_SIZE
]
=
{
Z
*
density
[
0
]};
gr_float
energy
[
FIELD_SIZE
]
=
{
u
*
u_factor
};
gr_float
cooling_time
[
FIELD_SIZE
]
=
{
0
.
0
};
int
grid_dimension
[
3
]
=
{
1
,
0
,
0
};
int
grid_start
[
3
]
=
{
0
,
0
,
0
};
int
grid_end
[
3
]
=
{
0
,
0
,
0
};
if
(
FIELD_SIZE
!=
1
)
{
error
(
"field_size must currently be set to 1."
);
}
if
(
calculate_cooling_time_table
(
&
my_units
,
a_now
,
grid_rank
,
grid_dimension
,
grid_start
,
grid_end
,
density
,
energy
,
x_velocity
,
y_velocity
,
z_velocity
,
metal_density
,
cooling_time
)
==
0
)
{
error
(
"Error in calculate_cooling_time."
);
}
// return updated chemistry and energy
for
(
int
i
=
0
;
i
<
FIELD_SIZE
;
i
++
)
{
coolingtime
[
i
]
=
cooling_time
[
i
];
}
return
1
;
}
int
wrap_do_cooling
(
double
rho
,
double
*
u
,
double
dt
,
double
Z
,
double
a_now
)
{
GRACKLE_ASSERT
(
FIELD_SIZE
==
1
);
gr_float
den_factor
=
1
.
0
;
gr_float
u_factor
=
1
.
0
;
gr_float
x_velocity
[
FIELD_SIZE
]
=
{
0
.
0
};
gr_float
y_velocity
[
FIELD_SIZE
]
=
{
0
.
0
};
gr_float
z_velocity
[
FIELD_SIZE
]
=
{
0
.
0
};
gr_float
density
[
FIELD_SIZE
]
=
{
rho
*
den_factor
};
gr_float
metal_density
[
FIELD_SIZE
]
=
{
Z
*
density
[
0
]};
gr_float
energy
[
FIELD_SIZE
]
=
{(
*
u
)
*
u_factor
};
int
grid_dimension
[
3
]
=
{
1
,
0
,
0
};
int
grid_start
[
3
]
=
{
0
,
0
,
0
};
int
grid_end
[
3
]
=
{
0
,
0
,
0
};
if
(
solve_chemistry_table
(
&
my_units
,
a_now
,
dt
,
grid_rank
,
grid_dimension
,
grid_start
,
grid_end
,
density
,
energy
,
x_velocity
,
y_velocity
,
z_velocity
,
metal_density
)
==
0
)
{
error
(
"Error in solve_chemistry."
);
return
0
;
}
// return updated chemistry and energy
for
(
int
i
=
0
;
i
<
FIELD_SIZE
;
i
++
)
{
u
[
i
]
=
energy
[
i
]
/
u_factor
;
}
return
1
;
}
This diff is collapsed.
Click to expand it.
src/cooling/grackle/grackle_wrapper.h
deleted
100644 → 0
+
0
−
48
View file @
6c3f0c6a
/***********************************************************************
/
/ Grackle c wrapper
/
/
/ Copyright (c) 2013, Enzo/Grackle Development Team.
/
/ Distributed under the terms of the Enzo Public Licence.
/
/ The full license is in the file LICENSE, distributed with this
/ software.
************************************************************************/
#ifndef SWIFT_COOLING_GRACKLE_WRAPPER_H
#define SWIFT_COOLING_GRACKLE_WRAPPER_H
#include
"config.h"
#include
"error.h"
#include
<chemistry_data.h>
#include
<grackle.h>
#include
<math.h>
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
"config.h"
#include
"error.h"
int
wrap_init_cooling
(
char
*
CloudyTable
,
int
UVbackground
,
double
udensity
,
double
ulength
,
double
utime
,
int
grackle_chemistry
);
int
wrap_init_cooling
(
char
*
CloudyTable
,
int
UVbackground
,
double
udensity
,
double
ulength
,
double
utime
,
int
grackle_chemistry
);
int
wrap_set_UVbackground_on
();
int
wrap_set_UVbackground_off
();
int
wrap_get_cooling_time
(
double
rho
,
double
u
,
double
Z
,
double
a_now
,
double
*
coolingtime
);
int
wrap_do_cooling
(
double
density
,
double
*
energy
,
double
dtime
,
double
Z
,
double
a_now
);
void
grackle_print_data
();
void
cloudy_print_data
(
const
cloudy_data
c
,
const
int
print_mmw
);
#endif
/* SWIFT_COOLING_GRACKLE_WRAPPER_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