aboutsummaryrefslogtreecommitdiffstats
path: root/test/ccured_olden/bh/code.h
blob: 89b8a098e2e75bbf8c797074de3d6bfb7a28e92d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/****************************************************************************/
/* CODE.H: define various global things for code.c and io.c.                */
/*                                                                          */
/* Copyright (c) 1993 by Joshua E. Barnes, Honolulu, HI.                    */
/* It's free because it's yours.                                            */
/****************************************************************************/

#include "defs.h"

global string infile;			/* file name for snapshot input     */

global string outfile;			/* file name for snapshot output    */

global real freq;			/* inverse of integration timestep  */

global real freqout;			/* output frequency                 */

global real tstop;			/* time to stop calculation         */

extern string headline;			/* message describing calculation   */

global real tnow;			/* current value of time            */

global real tout;			/* time of next output              */

global int nstep;			/* number of time-steps             */

global int nfcalc;			/* count force calculations         */

global int n2bcalc;			/* count body-body interactions     */

global int nbccalc;			/* count body-cell interactions     */

global int nbody;			/* number of bodies in system       */

global bodyptr bodytab;			/* points to array of bodies        */

/*
 * Global function prototypes.
 */

void initoutput(void);				/* open files for output    */
void stopoutput(void);				/* close output files       */
void inputdata(void);				/* read initial data file   */
void maketree(bodyptr, int);			/* construct tree structure */
void hackgrav(bodyptr, bool);			/* compute force on body    */
void output(void);				/* perform output operation */

/*
 * Utility routines used in code.c and io.c.  These are defined in util.c
 * and getparam.c, which must be compiled with same choice of precision.
 */

bool streq(string, string);			/* test string equality     */
real xrandom(real, real);			/* generate a random number */
void initparam(string *, string *);		/* initialize parameter pkg */
string getparam(string);			/* get parameter as string  */
int getiparam(string);				/* get parameter as integer */
bool getbparam(string);				/* get parameter as bool    */
real getrparam(string);				/* get parameter as real    */