/***********************************************************************************
Copyright 2008 Charles F. Gammie and Xiaoyue Guan
HAM version 1.0 (released Jan 15, 2008)
This file is part of HAM. HAM is a program that solves non-relativistic
hyperbolic partial differential equation in conservative form using
high-resolution shock-capturing techniques. This version of HAM has been
configured to solve the magnetohydrodynamic equations of motion in
axisymmetry to evolve a shearing box model.
You are morally obligated to cite the following paper in his/her
scientific literature that results from use of any part of HAM:
[1] Guan, X. \& Gammie, C.F. \ 2008, Astrophysical Journal, Supplement,
174, 145
The latest version of the HAM is available on our code distribution
website:
http://rainman.astro.uiuc.edu/codelib/
HAM is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
HAM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with HAM; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************************/
/*
* HAM Main Program
*
*
*/
#include "decs.h"
#include "defs.h"
main (argc, argv)
int argc;
char *argv[];
{
void init (), timestep (), step_ch (), dump (), diag ();
double tnext;
int nstep;
/* warn user about boundary conditions */
if (PER)
fprintf (stderr, "Using PER boundary conditions\n");
else if (STD)
fprintf (stderr, "Using STD boundary conditions\n");
else if (SHBOX)
fprintf (stderr, "Using SHBOX boundary conditions\n");
else
{
fprintf (stderr, "Unknown boundary conditions\n");
return (1);
}
/* perform initializations */
init ();
/* do initial diagnostics */
diag (0);
nstep = 0;
tnext = t;
while (t < tf)
{
fprintf (stderr, "%g %g\n", t, dt);
/* step variables forward in time */
step_ch ();
/* perform diagnostics */
if (t >= tnext)
{
bounds (p);
diag (1);
tnext += DTl;
}
nstep++;
}
fprintf (stderr, "ns,ts: %d %d\n", nstep, nstep * N1 * N2);
/* do final diagnostics */
diag (2);
exit (0);
}