00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00020
00021
00022
00023
00024
00025
00026 #include "dyn.h"
00027
00028 #ifndef TOOLBOX
00029
00030 void add_plummer(dyn *b,
00031 real coeff, real scale,
00032 vector center,
00033 bool n_flag,
00034 bool verbose)
00035 {
00036 add_power_law(b, coeff, 0, scale, center, n_flag, verbose, false);
00037 }
00038
00039 #else
00040
00041 main(int argc, char *argv[])
00042 {
00043 bool c_flag = false;
00044 char *comment;
00045
00046 real mass = 1, scale = 1;
00047 vector center = 0;
00048
00049 bool n_flag = false;
00050
00051 check_help();
00052
00053 extern char *poptarg;
00054 extern char *poparr[];
00055 int c;
00056 char* param_string = "a:c:C:::M:nR:";
00057
00058 dyn *b = get_dyn(cin);
00059 if (b == NULL) err_exit("Can't read input snapshot");
00060
00061 b->log_history(argc, argv);
00062
00063
00064
00065 while ((c = pgetopt(argc, argv, param_string)) != -1) {
00066 switch (c) {
00067 case 'c': c_flag = TRUE;
00068 comment = poptarg;
00069 break;
00070 case 'C': center = vector(atof(poparr[0]),
00071 atof(poparr[1]),
00072 atof(poparr[2]));
00073 break;
00074 case 'M': mass = atof(poptarg);
00075 break;
00076 case 'a':
00077 case 'R': scale = atof(poptarg);
00078 break;
00079
00080 case 'n': n_flag = true;
00081 break;
00082
00083 default:
00084 case '?': params_to_usage(cerr, argv[0], param_string);
00085 get_help();
00086 return false;
00087 }
00088 }
00089
00090 add_plummer(b, mass, scale, center, n_flag, true);
00091 put_node(cout, *b);
00092 }
00093
00094 #endif