supernovae_ii.h 3.61 KB
Newer Older
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/*******************************************************************************
 * This file is part of SWIFT.
 * Copyright (c) 2019 Loic Hausammann (loic.hausammann@epfl.ch)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 ******************************************************************************/
#ifndef SWIFT_SUPERNOVAE_II_GEAR_H
#define SWIFT_SUPERNOVAE_II_GEAR_H

#include "hdf5_functions.h"
#include "interpolation.h"
#include "stellar_evolution_struct.h"

/**
 * @brief Print the supernovae II model.
 *
 * @param snii The #supernovae_ii.
 */
void supernovae_ii_print(const struct supernovae_ii *snii);
int supernovae_ii_can_explode(const struct supernovae_ii *snii, float m_low,
                              float m_high);
Loic Hausammann's avatar
Loic Hausammann committed
34 35 36 37 38 39 40 41 42 43 44
float supernovae_ii_get_number_per_unit_mass(const struct supernovae_ii *snii,
                                             float m1, float m2);
void supernovae_ii_get_yields_from_integral(const struct supernovae_ii *snii,
                                            float log_m1, float log_m2,
                                            float *yields);
void supernovae_ii_get_yields_from_raw(const struct supernovae_ii *snii,
                                       float log_m, float *yields);
float supernovae_ii_get_ejected_mass_fraction_non_processed_from_integral(
    const struct supernovae_ii *snii, float log_m1, float log_m2);
float supernovae_ii_get_ejected_mass_fraction_non_processed_from_raw(
    const struct supernovae_ii *snii, float log_m);
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
45

46
float supernovae_ii_get_ejected_mass_fraction_processed_from_integral(
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
47
    const struct supernovae_ii *snii, float log_m1, float log_m2);
48 49
float supernovae_ii_get_ejected_mass_fraction_processed_from_raw(
    const struct supernovae_ii *snii, float log_m);
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
50
void supernovae_ii_read_yields_array(
51
    struct supernovae_ii *snii, struct interpolation_1d *interp_raw,
52 53
    struct interpolation_1d *interp_int, const struct stellar_model *sm,
    hid_t group_id, const char *hdf5_dataset_name, hsize_t *previous_count,
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
54 55 56
    int interpolation_size);
void supernovae_ii_read_yields(struct supernovae_ii *snii,
                               struct swift_params *params,
57 58
                               const struct stellar_model *sm,
                               const int restart);
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
59 60 61 62
void supernovae_ii_read_from_params(struct supernovae_ii *snii,
                                    struct swift_params *params);

void supernovae_ii_read_from_tables(struct supernovae_ii *snii,
Loic Hausammann's avatar
Loic Hausammann committed
63 64
                                    struct swift_params *params,
                                    const char *filename);
65
void supernovae_ii_init(struct supernovae_ii *snii, struct swift_params *params,
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
66 67 68 69
                        const struct stellar_model *sm);
void supernovae_ii_dump(const struct supernovae_ii *snii, FILE *stream,
                        const struct stellar_model *sm);
void supernovae_ii_restore(struct supernovae_ii *snii, FILE *stream,
70
                           const struct stellar_model *sm);
Loic Hausammann's avatar
Gear  
Loic Hausammann committed
71 72
void supernovae_ii_clean(struct supernovae_ii *snii);
#endif  // SWIFT_SUPERNOVAE_II_GEAR_H