-
Notifications
You must be signed in to change notification settings - Fork 2
/
ngravs.h
87 lines (74 loc) · 3.9 KB
/
ngravs.h
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
#include "allvars.h"
#ifdef NOTYPEPREFIX_FFTW
#include <fftw.h>
#else
#ifdef DOUBLEPRECISION_FFTW
#include <dfftw.h> /* double precision FFTW */
#else
#include <sfftw.h>
#endif
#endif
struct ngravsInterpolant {
fftw_plan plan;
int ntab;
int len;
int ngravs_tpm_n;
int ol;
};
// Gravitational interactions (accelerations)
double none(double target, double source, double h, double r, long N);
double newtonian(double target, double source, double h, double r, long N);
double neg_newtonian(double target, double source, double h, double r, long N);
double bambam(double target, double source, double h, double r, long N);
double sourcebaryonbam(double target, double source, double h, double r, long N);
double sourcebambaryon(double target, double source, double h, double r, long N);
double newyukawa(double target, double source, double h, double r, long N);
double yukawa(double target, double source, double h, double r, long N);
double coloyuk(double target, double source, double h, double r, long N);
// (Periodic) Greens functions
double newtonKGreen(double target, double source, double k2, double k, long N);
double pgdelta(double target, double source, double k2, double k, long N);
double neg_pgdelta(double target, double source, double k2, double k, long N);
double pgyukawa(double target, double source, double k2, double k, long N);
double pgcoloyuk(double target, double source, double k2, double k, long N);
// (Periodic) Normed Greens functions
double normed_pgdelta(double target, double source, double k2, double k, long N);
double normed_pgyukawa(double target, double source, double k2, double k, long N);
double normed_pgcoloyuk(double target, double source, double k2, double k, long N);
// Potential functions
double newtonian_pot(double target, double source, double h, double r, long N);
double neg_newtonian_pot(double target, double source, double h, double r, long N);
double bambam_pot(double target, double source, double h, double r, long N);
double sourcebambaryon_pot(double target, double source, double h, double r, long N);
double sourcebaryonbam_pot(double target, double source, double h, double r, long N);
// Spline functions
double plummer(double target, double source, double h, double r, long N);
double neg_plummer(double target, double source, double h, double r, long N);
double null_spline(double target, double source, double h, double r, long N);
double sourcebaryonbam_spline(double target, double source, double h, double r, long N);
double sourcebambaryon_spline(double target, double source, double h, double r, long N);
double bambam_spline(double target, double source, double h, double r, long N);
// Potential spline functions
double plummer_pot(double target, double source, double h, double r, long N);
double neg_plummer_pot(double target, double source, double h, double r, long N);
// Lattice functions
void coloyuk_lattice_force(int iii, int jjj, int kkk, double x[3], double force[3]);
void lattice_force_none(int iii, int jjj, int kkk, double x[3], double force[3]);
double lattice_pot_none(double x[3]);
void yukawa_lattice_force(int iii, int jjj, int kkk, double x[3], double force[3]);
double yukawa_lattice_psi(double x[3]);
double yukawa_madelung(double ym);
// Functions required for convolution
int gadgetToFourier(int i, struct ngravsInterpolant *s);
int performConvolution(struct ngravsInterpolant *s, gravity normKGreen, double Z, double *oRes, double *oResI);
struct ngravsInterpolant *ngravsConvolutionInit(int ntab, int len, int ol);
void ngravsConvolutionFree(struct ngravsInterpolant *s);
double mTox(int m, struct ngravsInterpolant *s);
double jTok(int m, double Z, struct ngravsInterpolant *s);
double normKtoGridK(double normk);
double gridKtoNormK(double gridk);
void kConversionUnitTest(void);
double fourierIntegrand(double k, gravity normKGreen, double Z);
// Initialization functions for ngravs extension
void wire_grav_maps(void);
void init_grav_maps(void);