Skip to content
Snippets Groups Projects
wrapper.c 928 B
#include "units_wrapper.h"
#include "part_wrapper.h"
#include "pyswiftsim_tools.h"


#include <Python.h>
#include <math.h>
#include <numpy/arrayobject.h>


/* definition of the method table */      
      
static PyMethodDef wrapper_methods[] = {

  {"partTestStruct",  part_test_struct, METH_VARARGS,
   "Construct a part object and return it."},	   	         

  {"unitSystemTestStruct",  unit_system_test_struct, METH_VARARGS,
   "Construct a unit_system object and return it."},	   	         
  
  {NULL, NULL, 0, NULL}        /* Sentinel */
};      
      
      

static struct PyModuleDef wrapper_cmodule = {
  PyModuleDef_HEAD_INIT,
  "wrapper",
  "Wrapper around the SPH cosmological simulation code SWIFT",
  -1,
  wrapper_methods
};


PyMODINIT_FUNC PyInit_wrapper(void)
{
  PyObject *m;

  Py_Initialize();
  import_array();
  m = PyModule_Create(&wrapper_cmodule);

  if (m == NULL)
    return NULL;

  return m;
}