HNBody Version 1.0.10

- Main Page
- Related Pages
- Data Structures
- Files

Creating Custom Drivers

The drivers/ directory contains source code for the standard HNBody driver program (hnbody) and two example customized drivers (lunar and ems). A usage summary for the standard driver (or any custom driver based upon it, including lunar and ems) can be obtained in this way:

            hnbody -h

To give another usage example, here's how to restart an integration that was saved to file `save.dat` (see the SaveFiles entry in the options reference manual) and initialized using an input file named `integrate.hnb:`

            hnbody -s save.dat integrate.hnb

    The lunar driver is an example of a simple customized driver to which only

a conservative potential has been added to the system (specifically, to model the mean Earth-Moon quadrupole potential); it is included pre-compiled in the binary distribution. The makefile Makefile.custom is set up to compile this type of custom driver automatically. Here's how to use it to make the lunar driver:

            make -f Makefile.custom DRIVER=lunar

Any custom driver using a compatible naming scheme can be compiled this way. The input file qtd.hnb can be used to test the lunar driver:

            lunar ../input/qtd.hnb

(The special qtd target in Makefile.custom can be used to build the lunar driver in "QTD mode"; see the comments in lunar.c for details.) Use qtd.hnb as input to hnbody —the standard driver—and compare results to see what effect the quadrupole term has.

The ems driver is an example of an advanced customized driver implementing a sub-integration (in this case, an explicit integration of the Moon) that is advanced in lock step with the main planetary integration. This driver is also included pre-compiled in the binary distribution. The file ems.hnb (which uses both ems-base.hnb and ems-moon.hnb) contains sample input to this driver.

# Platform-specific Notes

- The pre-compiled libraries for Linux (linux-x86) were created with the PGI compiler. To successfully link a custom-built driver on this platform, you will need to download and install the Linux portability package from the PGI Downloads page. Then simply append `-Lpgilib -lpgc` (where `pgilib` is the PGI library directory appropriate for your glibc version) to the command line when linking your custom driver.