Commit 2d21a063 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Print more particle info.

parent 54ad18df
......@@ -38,7 +38,7 @@
* (Should be used for debugging only as it runs in O(N).)
*/
void printParticle(struct part *parts, long long int id, int N) {
void printParticle(struct part *parts, struct xpart *xparts, long long int id, int N) {
int i, found = 0;
......@@ -47,12 +47,14 @@ void printParticle(struct part *parts, long long int id, int N) {
if (parts[i].id == id) {
printf(
"## Particle[%d]:\n id=%lld, x=[%.3e,%.3e,%.3e], "
"v=[%.3e,%.3e,%.3e], a=[%.3e,%.3e,%.3e],\n h=%.3e, "
"v=[%.3e,%.3e,%.3e],v_full=[%.3e,%.3e,%.3e] \n a=[%.3e,%.3e,%.3e],\n h=%.3e, "
"wcount=%d, m=%.3e, dh_drho=%.3e, rho=%.3e, P=%.3e, S=%.3e, dS/dt=%.3e,\n"
"divV=%.3e, curlV=%.3e, rotV=[%.3e,%.3e,%.3e] \n "
"v_sig=%e t_begin=%.3e, t_end=%.3e\n",
i, parts[i].id, parts[i].x[0], parts[i].x[1], parts[i].x[2],
parts[i].v[0], parts[i].v[1], parts[i].v[2], parts[i].a[0],
parts[i].v[0], parts[i].v[1], parts[i].v[2],
xparts[i].v_full[0], xparts[i].v_full[1], xparts[i].v_full[2],
parts[i].a[0],
parts[i].a[1], parts[i].a[2], 2.*parts[i].h,
(int)parts[i].density.wcount, parts[i].mass,
parts[i].rho_dh,
......
......@@ -23,7 +23,7 @@
#include "cell.h"
#include "part.h"
void printParticle(struct part *parts, long long int i, int N);
void printParticle(struct part *parts, struct xpart *xparts, long long int i, int N);
void printgParticle(struct gpart *parts, long long int i, int N);
void printParticle_single(struct part *p);
......
......@@ -1734,8 +1734,8 @@ void engine_init_particles(struct engine *e) {
space_map_cells_pre(s, 1, cell_convert_hydro, NULL);
printParticle(e->s->parts, 1000, e->s->nr_parts);
printParticle(e->s->parts, 515050, e->s->nr_parts);
printParticle(e->s->parts, e->s->xparts,1000, e->s->nr_parts);
printParticle(e->s->parts, e->s->xparts,515050, e->s->nr_parts);
/* Ready to go */
e->step = 0;
......@@ -1815,8 +1815,8 @@ if ( e->nodeID == 0 )
/* Drift everybody */
engine_launch(e, e->nr_threads, 1 << task_type_drift, 0);
printParticle(e->s->parts, 1000, e->s->nr_parts);
printParticle(e->s->parts, 515050, e->s->nr_parts);
printParticle(e->s->parts, e->s->xparts, 1000, e->s->nr_parts);
printParticle(e->s->parts, e->s->xparts, 515050, e->s->nr_parts);
if(e->step == 2) exit(0);
......@@ -1854,8 +1854,8 @@ if ( e->nodeID == 0 )
TIMER_TOC2(timer_step);
printParticle(e->s->parts, 1000, e->s->nr_parts);
printParticle(e->s->parts, 515050, e->s->nr_parts);
printParticle(e->s->parts, e->s->xparts,1000, e->s->nr_parts);
printParticle(e->s->parts, e->s->xparts,515050, e->s->nr_parts);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment