brown/c/interaction/interaction.h

61 lines
1.2 KiB
C
Raw Normal View History

2019-07-08 09:21:51 +00:00
#ifndef interaction_h
#define interaction_h
#include <Python.h>
#include "structmember.h"
// XXX
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
2019-07-08 09:21:51 +00:00
#include <numpy/ndarraytypes.h>
#include <numpy/ufuncobject.h>
#include <stddef.h>
2019-07-08 09:21:51 +00:00
2019-07-31 09:58:11 +00:00
static void
interaction_ufunc_float2D
( char ** args
, npy_intp * dimensions
, npy_intp * steps
, void * data);
static void
interaction_ufunc_force
( char ** args
, npy_intp * dimensions
, npy_intp * steps
, void * data);
2019-07-08 09:21:51 +00:00
/*
* This is a quite generic force function mapping a
* distance to the magnitude of a force. The coefficients
* are an array of length 19 and the force function
* is given as:
*
* (c0 + c1*r + c2*r^2 + ... + c6*r^6) * c7 * exp(c8*(r - c9))
* + c10 * exp(c11 * (r - c12))
* + c13 * exp(c14 * (r - c15)^2)
* + c16 * exp(c17 * (r - c18)^2)
* */
static float
interaction_force_function
( float r
, float * coefficients);
2019-07-31 09:58:11 +00:00
static float
interaction_potential_function
( float r
, float * coefficients);
2019-07-08 09:21:51 +00:00
static void
2019-07-31 09:58:11 +00:00
interaction_ufunc_force
2019-07-08 09:21:51 +00:00
( char ** args
, npy_intp * dimensions
, npy_intp * steps
, void * data);
static void
2019-07-31 09:58:11 +00:00
interaction_ufunc_potential
( char ** args
, npy_intp * dimensions
, npy_intp * steps
2019-07-12 18:24:02 +00:00
, void * data);
2019-07-08 09:21:51 +00:00
#endif