SMILE  v2.5
Schwarzschild Modelling Interactive expLoratory Environment
Functions
snaporbits.cpp File Reference

Tool: Perform orbit analysis on trajectories of particles from an N-body snapshot. More...

#include <vector>
#include <iostream>
#include <io_nemo.h>
#include <gsl/gsl_errno.h>
#include "configfile.h"
#include "iodata.h"
#include "managepotential.h"
#include "orbitan.h"
#include "orbitint.h"
#include "orbitlib.h"
#include "potential.h"
#include "utils.h"
Include dependency graph for snaporbits.cpp:

Functions

int main (int argc, char *argv[])
 

Detailed Description

Tool: Perform orbit analysis on trajectories of particles from an N-body snapshot.

Author
EV
Date
2012-2015

This program demonstrates how to use SMILE orbit analysis machinery on trajectories from an N-body simulation. It loads NEMO snapshot file containing particles at multiple moments of time and treats trajectories of each particle as a separate orbit, performing the same kind of orbit analysis as for loading an orbit from a text file in SMILE GUI.

To conduct orbit analysis, one needs to provide the potential. It may be done either by specifying a potential coefs file or simply by using the first snapshot in the input file as the source data for potential approximation (using BSE or Spline potential expansions). In this latter case, several additional parameters may be given for initializing this potential approximation (number of radial and angular coefficients, symmetry and potential type), but they are not very important, since the potential is only used to compute the orbit energy and the natural orbital period, which serves as the unit of frequency. The potential coefficients are stored in a text file to simplify latter use (for instance, when loading the orbit library file to SMILE, one may provide this text file for the potential model). In addition, a point mass (central black hole) may be added to the potential. Beware that initializing the potential from the 1st snapshot itself or from another snapshot file will only account for the central point mass if it is precisely at origin; otherwise the potential will not be initialized properly. On the other hand, when loading the potential coefs from a text file, this additional central mass may need to be provided manually since it is not stored in the coefs file.

Once the entire snapshot file has been read, the orbit analysis is performed on each particle trajectory, and the resulting orbit library is saved in the output text file.

Note that all particles at all times are loaded to memory; to reduce memory demand, one may need to filter the input snapshot by standard NEMO tools such as snapmask input_file - select=0:1000 | snaporbits - out=output_library pot=input_file (note that in this case we must provide the original input file containing all particles that contribute to the potential, not only the subset of particles to be processed).