diff --git a/src/cooling/grackle/grackle_wrapper.c b/src/cooling/grackle/grackle_wrapper.c deleted file mode 100644 index a277638788c309a9dd8ab97c56704361fd598f98..0000000000000000000000000000000000000000 --- a/src/cooling/grackle/grackle_wrapper.c +++ /dev/null @@ -1,104 +0,0 @@ -/*********************************************************************** -/ -/ 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; -} - diff --git a/src/cooling/grackle/grackle_wrapper.h b/src/cooling/grackle/grackle_wrapper.h deleted file mode 100644 index 10c8b793ccd7785e899a97b7602cd3995e42bb20..0000000000000000000000000000000000000000 --- a/src/cooling/grackle/grackle_wrapper.h +++ /dev/null @@ -1,48 +0,0 @@ -/*********************************************************************** -/ -/ 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 */