head	1.3;
access;
symbols;
locks
	ids:1.3; strict;
comment	@ * @;


1.3
date	93.06.24.18.08.28;	author ids;	state Exp;
branches;
next	1.2;

1.2
date	93.06.23.12.29.57;	author ids;	state Exp;
branches;
next	1.1;

1.1
date	93.06.21.20.55.00;	author ids;	state Exp;
branches;
next	;


desc
@@


1.3
log
@some low-level stuff moved to here
incr_state now uses the "+=" approach.
@
text
@#ifndef GRAVITY_SUPPORT_H_INCLUDED
#define GRAVITY_SUPPORT_H_INCLUDED


#define NMAX            100         /* max no. of bodies in simulation */
#define NDIMS           3           /* no. of space dimensions */
#define NAMELENGTH      20          /* length of name of a body */

typedef char   Identifier[NAMELENGTH+1];
typedef double VECTOR[NDIMS];


typedef struct {
          Identifier name;
          double     mass;
          VECTOR     position;
          VECTOR     velocity;
        } Body;

typedef struct {
          double Time;
          int    n;     /* no. of bodies; should be 0 to NMAX */
          Body   bodydata[NMAX];
        } STATE;


/*
for the time-derivative ("dot") types, we only bother with the parts that
change, and n for completeness of course.
*/
typedef struct {
          VECTOR position_dot;
          VECTOR velocity_dot;
        } Body_dot;

typedef struct {
          int      n;	/* no. of bodies; should be 0 to NMAX */
          Body_dot bodydata[NMAX];
        } STATE_DOT;




/* low-level functions. */

extern void CreateZeroVector (VECTOR Vresult);
extern double lengthsquared (VECTOR V);

extern void copy_state (STATE *state1, STATE *state2);
/*
treats *state1 as read-only; copies *state1 to *state2.
Assumes "static" parts of *state2 are already filled in.
*/

extern void incr_state (STATE *state, double delta_t, STATE_DOT *speed);
/* treats *speed as read-only; does "state = state + delta_t * speed". */




#endif /* GRAVITY_SUPPORT_H_INCLUDED */
@


1.2
log
@minor parameter-name tidyups.
@
text
@d49 11
@


1.1
log
@Initial revision
@
text
@d46 2
a47 2
extern void CreateZeroVector (VECTOR AVector);
extern double lengthsquared (VECTOR v);
@
