-
Notifications
You must be signed in to change notification settings - Fork 101
/
README.dev
42 lines (30 loc) · 1.39 KB
/
README.dev
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
Develop README
==============
Adding a potential to the C integrator
--------------------------------------
1) Implement the potential in a .c file under
potential/potential_c_ext. Look at
potential/potential_c_ext/LogarithmicHaloPotential.c for the right
format
2) Add your new potential to
potential/potential_c_ext/galpy_potentials.h
3) Edit the code under orbit/orbit_c_ext/integratePlanarOrbit.c to
set up your new potential (in the 'parse_leapFuncArgs' function)
4) Edit the code in orbit/integratePlanarOrbit.py to set up your
new potential
5) Edit the code under orbit/orbit_c_ext/integrateFullOrbit.c to
set up your new potential (in the 'parse_leapFuncArgs_Full' function)
6) Edit the code in orbit/integrateFullOrbit.py to set up your
new potential
7) Finally, add 'self.hasC= True' to the initialization of the
potential in question (after the initialization of the super class)
8) It should work now!
9) If you implement the second derivatives of the potential necessary
to integrate phase-space volumes, also set self.hasC_dxdv=True to the
initialization of the potential in question.
10) If you add a potential that gets passed to C as a list, you need
to edit orbit/integrateLinearOrbit.py and
orbit/orbit_c_ext/integrateLinearPotential.c to parse it properly (for
regular 3D potentials this works out of the box).
11) If you add a 1D potential, do the steps above, but for
integrateLinearOrbit.*