Skip to content
Snippets Groups Projects
Commit 5f4e83f8 authored by slevy's avatar slevy
Browse files

More debugging code.

parent 8e1d2eff
No related branches found
No related tags found
No related merge requests found
......@@ -9,6 +9,9 @@
/*
* $Log$
* Revision 1.12 2002/05/12 09:16:22 slevy
* More debugging code.
*
* Revision 1.11 2002/04/29 00:11:25 slevy
* Propagate velocity to sdb's, too. Allow delta-t arg to time: t=<time>,<dt>
* Need to pass vel=true arg to create_interpolated_tree*.
......@@ -255,6 +258,26 @@ struct worldstuff {
}
};
struct state {
int type;
int group;
double realtime;
double dt;
char axis;
float turnrate;
double turntime0;
Matrix T0;
int has_T0;
float mag0;
float colorscale;
float masslum; /* if set, ignore SPECK_LUM; use MASS**3 * masslum */
int oldtree;
struct stuff *st;
int port;
int lsock;
int verbose;
} curstate = { ST_POINT, 0, 0.0 };
void kira_invalidate( struct dyndata *dd, struct stuff *st ) {
if(st->sl) st->sl->used = -1000000;
worldstuff *ww = (worldstuff *)(dd->data);
......@@ -797,11 +820,22 @@ struct specklist *kira_get_parti( struct dyndata *dd, struct stuff *st, double r
int ih = ww->ih;
int nh = ww->nh;
if(ih < 0 || ih >= nh) ih = 0;
worldbundle *wb = ww->wh[ih];
for(; realtime > wb->get_t_max() && ih < nh-1; ih++, wb = ww->wh[ih])
;
for(; realtime < wb->get_t_min() && ih > 0; ih--, wb = ww->wh[ih])
;
/* Sanity check */
if(realtime < wb->get_t_min() || realtime > wb->get_t_max()) {
msg("ERROR: realtime %lg out of range %lg .. %lg of worldbundle %d of 0..%d",
realtime, wb->get_t_min(), wb->get_t_max(),
ih, nh-1);
ww->slvalid = 0;
return NULL;
}
if(ww->oldtree == 1) {
pdyn *root = create_interpolated_tree(wb, realtime, 1);
ww->center_pos = get_center_pos(); // but probably invalid here
......@@ -812,13 +846,19 @@ struct specklist *kira_get_parti( struct dyndata *dd, struct stuff *st, double r
pdyn *root = create_interpolated_tree2(wb, realtime, 1);
ww->center_pos = get_center_pos();
ww->center_vel = get_center_vel();
if(curstate.verbose>=3)
msg("realtime %lg pre-n_daughters %d n_leaves %d root %x wb %x timerange %lg .. %lg ih %d of 0..%d",
realtime, root->n_daughters(), root->n_leaves(), root,
wb, wb->get_t_min(), wb->get_t_max(),
ih, nh-1);
ww->sl = kira_to_parti(root, dd, st, ww);
if(curstate.verbose>=2)
msg("realtime %lg n_daughters %d nspecks %d sl %x root %x",
realtime, root->n_daughters(), ww->sl->nspecks, ww->sl, root);
}
if(getenv("DBGPID")) {
static int many;
if(many%256 < 4) fprintf(stderr, "kp%d(%d)%x ", getpid(),ww->bufno,ww->sl);
if(++many%256 == 4) fprintf(stderr, "\n");
}
ww->ih = ih;
ww->tcur = realtime;
......@@ -838,26 +878,6 @@ void msg( CONST char *fmt, ... ) {
va_end(args);
}
struct state {
int type;
int group;
double realtime;
double dt;
char axis;
float turnrate;
double turntime0;
Matrix T0;
int has_T0;
float mag0;
float colorscale;
float masslum; /* if set, ignore SPECK_LUM; use MASS**3 * masslum */
int oldtree;
struct stuff *st;
int port;
int lsock;
int verbose;
} curstate = { ST_POINT, 0, 0.0 };
int scanopt(char *opt, char *arg) {
float *tp;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment