Skip to content
Snippets Groups Projects
config_wrapper.h 1.70 KiB
/*******************************************************************************
 * This file is part of PYSWIFTSIM.
 * Copyright (c) 2018 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  __PYSWIFTSIM_CONFIG_H__
#define  __PYSWIFTSIM_CONFIG_H__

#include "pyswiftsim_tools.h"

/**
 * @brief give the cooling type name
 *
 * @return Cooling name (PyUnicode)
 */
PyObject* config_get_cooling() {
  char *cooling_name = "Not implemented";
  /* lambda */
#ifdef COOLING_CONST_LAMBDA
  cooling_name = "const_lambda";

  /* grackle */
#elif defined(COOLING_GRACKLE)
#if COOLING_GRACKLE_MODE == 0
  cooling_name = "grackle";
#elif COOLING_GRACKLE_MODE == 1
  cooling_name = "grackle1";
#elif COOLING_GRACKLE_MODE == 2
  cooling_name = "grackle2";  
#elif COOLING_GRACKLE_MODE == 3
  cooling_name = "grackle3";
#else
  error("Grackle mode unknown");
#endif // COOLING_GRACKLE_MODE
#endif // COOLING_GRACKLE
  
  return PyUnicode_FromString(cooling_name);
};


#endif //  __PYSWIFTSIM_CONFIG_H__