/usr/include/python2.7/MMTK/trajectory.h is in python-mmtk 2.7.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | /*
* Include file for trajectory objects
*
* Written by Konrad Hinsen
*/
#ifndef MMTK_TRAJECTORY_H
/* General include files */
#include "MMTK/core.h"
#include "Scientific/netcdfmodule.h"
#ifdef USE_NETCDF_H_FROM_SCIENTIFIC
# include "Scientific/netcdf.h"
#else
# include "netcdf.h"
#endif
#include <time.h>
/* Unit names */
#define length_unit_name "nanometer"
#define volume_unit_name "nanometer3"
#define time_unit_name "picosecond"
#define frequency_unit_name "picosecond-1"
#define frequency_square_unit_name "picosecond-2"
#define velocity_unit_name "nanometer picosecond-1"
#define mass_unit_name "atomic_mass_unit"
#define energy_unit_name "kilojoule mole-1"
#define energy_gradient_unit_name "kilojoule mole-1 nanometer-1"
#define temperature_unit_name "kelvin"
#define pressure_unit_name "kilojoule mole-1 nanometer-3"
/* Trajectory object structure */
typedef struct {
PyObject_HEAD
PyObject *universe;
PyArrayObject *index_map;
PyNetCDFFileObject *file;
PyNetCDFVariableObject *var_step;
PyArrayObject *sbuffer, *vbuffer;
PyArrayObject *box_buffer;
clock_t last_flush;
int box_buffer_first, box_buffer_last, box_buffer_skip;
int floattype;
int natoms, trajectory_atoms;
int steps;
int block_size;
int cycle;
int first_step;
int write;
} PyTrajectoryObject;
extern PyTypeObject PyTrajectory_Type;
/* Trajectory variable types */
enum PyTrajectory_VariableTypes { PyTrajectory_Scalar,
PyTrajectory_ParticleScalar,
PyTrajectory_ParticleVector,
PyTrajectory_IntScalar,
PyTrajectory_BoxSize };
enum PyTrajectory_DataClass { PyTrajectory_Configuration = 1,
PyTrajectory_Velocities = 2,
PyTrajectory_Gradients = 4,
PyTrajectory_Energy = 8,
PyTrajectory_Thermodynamic = 16,
PyTrajectory_Time = 32,
PyTrajectory_Internal = 64,
PyTrajectory_Auxiliary = 128 };
typedef struct {
char *name;
char *text;
char *unit;
union data { int *ip; double *dp; PyArrayObject *array; } value;
int length;
int type;
int class;
int modified;
} PyTrajectoryVariable;
/* Trajectory function declaration */
typedef int trajectory_fn(PyTrajectoryVariable *, PyObject *,
int step, void **scratch, PyObject *universe);
/* Output specification structure */
typedef struct {
PyObject *destination;
PyObject **variables;
trajectory_fn *function;
PyObject *parameters;
PyObject *universe;
void *scratch;
int first;
int last;
int frequency;
int type;
int close;
int what;
} PyTrajectoryOutputSpec;
/*
* C API functions
*/
/* Type definitions */
#define PyTrajectory_Type_NUM 0
/* Open a trajectory file */
#define PyTrajectory_Open_RET PyTrajectoryObject *
#define PyTrajectory_Open_PROTO Py_PROTO((PyObject *universe, \
PyObject *description, \
PyArrayObject *index_map, \
char *filename, char *mode, \
int floatttype, int cycle, \
int block_size))
#define PyTrajectory_Open_NUM 1
/* Close a trajectory file */
#define PyTrajectory_Close_RET int
#define PyTrajectory_Close_PROTO Py_PROTO((PyTrajectoryObject *trajectory))
#define PyTrajectory_Close_NUM 2
/* Prepare output */
#define PyTrajectory_OutputSpecification_RET PyTrajectoryOutputSpec *
#define PyTrajectory_OutputSpecification_PROTO \
Py_PROTO((PyObject *universe, PyListObject *spec_list, char *description,\
PyTrajectoryVariable *data))
#define PyTrajectory_OutputSpecification_NUM 3
/* Finish output */
#define PyTrajectory_OutputFinish_RET void
#define PyTrajectory_OutputFinish_PROTO \
Py_PROTO((PyTrajectoryOutputSpec *spec, int step, int error_flag,\
int time_stamp_flag, PyTrajectoryVariable *data))
#define PyTrajectory_OutputFinish_NUM 4
/* Do output */
#define PyTrajectory_Output_RET int
#define PyTrajectory_Output_PROTO \
Py_PROTO((PyTrajectoryOutputSpec *spec, int step, \
PyTrajectoryVariable *data, PyThreadState **thread))
#define PyTrajectory_Output_NUM 5
/* Total number of C API pointers */
#define PyTrajectory_API_pointers 6
#ifdef _TRAJECTORY_MODULE
/* Type object declarations */
extern PyTypeObject PyTrajectory_Type;
/* Type check macros */
#define PyTrajectory_Check(op) ((op)->ob_type == &PyTrajectory_Type)
/* C API function declarations */
static PyTrajectory_Open_RET PyTrajectory_Open PyTrajectory_Open_PROTO;
static PyTrajectory_Close_RET PyTrajectory_Close PyTrajectory_Close_PROTO;
static PyTrajectory_OutputSpecification_RET PyTrajectory_OutputSpecification \
PyTrajectory_OutputSpecification_PROTO;
static PyTrajectory_OutputFinish_RET PyTrajectory_OutputFinish \
PyTrajectory_OutputFinish_PROTO;
static PyTrajectory_Output_RET PyTrajectory_Output \
PyTrajectory_Output_PROTO;
#else
/* C API address pointer */
static void **PyTrajectory_API;
/* Type check macros */
#define PyTrajectory_Check(op) \
((op)->ob_type == (PyTypeObject *)PyTrajectory_API[PyTrajectory_Type_NUM])
/* C API function declarations */
#define PyTrajectory_Open \
(*(PyTrajectory_Open_RET (*)PyTrajectory_Open_PROTO) \
PyTrajectory_API[PyTrajectory_Open_NUM])
#define PyTrajectory_Close \
(*(PyTrajectory_Close_RET (*)PyTrajectory_Close_PROTO) \
PyTrajectory_API[PyTrajectory_Close_NUM])
#define PyTrajectory_OutputSpecification \
(*(PyTrajectory_OutputSpecification_RET \
(*)PyTrajectory_OutputSpecification_PROTO) \
PyTrajectory_API[PyTrajectory_OutputSpecification_NUM])
#define PyTrajectory_OutputFinish \
(*(PyTrajectory_OutputFinish_RET \
(*)PyTrajectory_OutputFinish_PROTO) \
PyTrajectory_API[PyTrajectory_OutputFinish_NUM])
#define PyTrajectory_Output \
(*(PyTrajectory_Output_RET \
(*)PyTrajectory_Output_PROTO) \
PyTrajectory_API[PyTrajectory_Output_NUM])
#endif
/* Import macro */
#define import_MMTK_trajectory() \
{ \
PyObject *module = PyImport_ImportModule("MMTK_trajectory"); \
if (module != NULL) { \
PyObject *module_dict = PyModule_GetDict(module); \
PyObject *c_api_object = PyDict_GetItemString(module_dict, "_C_API"); \
if (PyCObject_Check(c_api_object)) { \
PyTrajectory_API = (void **)PyCObject_AsVoidPtr(c_api_object); \
} \
} \
}
#define MMTK_TRAJECTORY_H
#endif
|