SMILE  v2.5
Schwarzschild Modelling Interactive expLoratory Environment
Functions | Variables
mkspherical.cpp File Reference

Tool: Create spherical mass models from a text table, Nbody snapshot, or analytic density profile. More...

#include <vector>
#include <iostream>
#include <fstream>
#include "configfile.h"
#include "icgenerator.h"
#include "iosnapshot.h"
#include "managepotential.h"
#include "massmodel.h"
#include "potential.h"
#include "utils.h"
Include dependency graph for mkspherical.cpp:

Functions

int main (int argc, char *argv[])
 main program begins here
 

Variables

const char * description
 usage description More...
 

Detailed Description

Tool: Create spherical mass models from a text table, Nbody snapshot, or analytic density profile.

Author
EV
Date
2010-2015

This program uses spherical mass models for two different purposes and created from several possible sources: either from a supplied table with r, m(r) values specifying enclosed mass as a function of radius, or an N-body snapshot, in which case it first fits a penalized spline to compute M(r) from the snapshot, or an analytic density profile, or potential expansion coefficients given in a text file.

The spherical model, in turn, may be used to compute a number of parameters as spline-interpolated functions of radius (potential, radial/circular period, distribution function via Eddington inversion formula, diffusion coefficients, etc.), or to generate an N-body snapshot, in which particles are distributed according to the given density profile and isotropically in velocities.

In short, this is a generalization of tools such as halogen or spherICs for creating a spherical isotropic model with a given arbitrary density profile, and at the same time a useful tool to study dynamical properties of a given system (or, rather, its spherically-symmetric isotropic counterpart).

Variable Documentation

const char* description
Initial value:
=
"mkspherical: Create spherical isotropic models for a given mass profile using Eddington inversion.\n"
"Input parameters must specify the model using one of the possible modes:\n"
" 1) a text file with a table describing the cumulative mass profile: each line contains 'r M(r)' values\n"
" 2) an N-body snapshot\n"
" 3) a density profile from SMILE described by its name and some parameters\n"
" 4) a potential coefficients file describing one of SMILE potential expansion types\n"
" 5) an ini file with all potential parameters\n"
"Output may consist of an extended table with many parameters as functions of radius and energy, and/or "
"an N-body snapshot corresponding to the spherical isotropic model (or both a table and a snapshot)\n\n"
"Command-line parameters and their default values:\n"
"file= input file (for modes 1,2,4,5); choice of mode is determined by file extension:"
" .mass (1), .coef_*** (4), .ini (5), anything else (2), but mode 1 may be forced by density=Coefs argument\n"
"density= name of the density profile (for mode 3), in this case may provide some more potential parameters\n"
"outtab= output table with r,M,Phi,f(E) and other parameters\n"
"rmin=0 output table inner nonzero radius [0 for auto-detect]\n"
"rmax=0 output table outer radius [0 for auto-detect]\n"
"npoints=100 output table number of grid points in radius [-1 to use input grid]\n"
"mbh=0 additional point mass (black hole) at origin\n"
"outsnap= output snapshot file name (to create an N-body representation of the model)\n"
"outformat=Text output snapshot format [Text/Nemo/Gadget]\n"
"nbody=0 number of points to create (must provide a value if outsnap is given)\n"
"quiet=0 0=noisy 1=somewhat quiet 2=more quiet\n"
"VERSION=2.5 Jan 2015 EV\n"

usage description