int main(int argc, string argv[]) { initparam(argv, defv); layout_body(bodyfields, Precision, NDIM); readsphr(getparam("in")); sphrprof(); testdisk(); if (! strnull(getparam("out"))) writegal(getparam("out")); return (0); }
void nemo_main() { stream outstr; potential = get_potential(getparam("potname"), getparam("potpars"), getparam("potfile")); rmin = getdparam("rmin"); rmax = getdparam("rmax"); rref = rmax; if (hasvalue("rref")) rref = getdparam("rref"); Qkey = hasvalue("key"); if (Qkey) key = getiparam("key"); Qconstant = getbparam("constant"); ndisk = getiparam("nbody"); jz_sign = getiparam("sign"); nmodel = getiparam("nmodel"); totmass = getdparam("mass"); offset = getdparam("phase") * PI / 180.0; Qtest = getbparam("test"); Quniform = getbparam("uniform"); if (ABS(jz_sign) != 1) error("sign must be +1 or -1"); Qlinear = hasvalue("k"); if (Qlinear) SPk = getdparam("k"); /* corrected for rot counter clock wise */ else if (hasvalue("pitch")) pitch = getdparam("pitch"); /* corrected for rot counter clock wise */ else error("Either k= (linear) or pitch= (logarithmic) spiral indicator needed"); init_xrandom(getparam("seed")); outstr = stropen(getparam("out"), "w"); put_history(outstr); if (hasvalue("headline")) set_headline(getparam("headline")); setdensity(); while (nmodel--) { testdisk(nmodel); writegalaxy(outstr); } strclose(outstr); free(disk); }