Commit fda78037 authored by Tom Theuns's avatar Tom Theuns
Browse files

Now compiles and runs

parent 853cd4b6
......@@ -475,7 +475,7 @@ int main(int argc, char *argv[]) {
message("%zi parts in %i cells.", s.nr_parts, s.tot_cells);
message("%zi gparts in %i cells.", s.nr_gparts, s.tot_cells);
message("maximum depth is %d.", s.maxdepth);
message("gparts[10].id = %ld.", gparts[10].id);
message("gparts[10].id = %lld.", gparts[10].id);
// message( "cutoffs in [ %g %g ]." , s.h_min , s.h_max ); fflush(stdout);
}
......
......@@ -63,7 +63,7 @@ struct gpart {
union {
/* Particle ID. By default: gravity only particles have a negative ID*/
long id;
long long id;
/* Pointer to corresponding SPH part. */
struct part* part;
......
......@@ -142,7 +142,7 @@ void runner_dograv_external(struct runner *r, struct cell *c) {
L[0] = dy * g->v_full[2] - dz * g->v_full[1];
L[1] = dz * g->v_full[0] - dx * g->v_full[2];
L[2] = dx * g->v_full[1] - dy * g->v_full[0];
if(g->id == 0) {
if(abs(g->id) == 1) {
float v2 = g->v_full[0]*g->v_full[0] + g->v_full[1]*g->v_full[1] + g->v_full[2]*g->v_full[2];
float fg = const_G * External_Potential_Mass * rinv;
//message("grav_external time= %f\t V_c^2= %f GM/r= %f E= %f L[2]= %f x= %f y= %f vx= %f vy= %f\n", r->e->time, v2, fg, E, L[2], g->x[0], g->x[1], g->v_full[0], g->v_full[1]);
......
......@@ -164,11 +164,11 @@ void space_regrid(struct space *s, double cell_max, int verbose) {
// tic = getticks();
if(nr_parts) {
if (s->cells != NULL) {
for (k = 0; k < s->nr_cells; k++) {
for (int k = 0; k < s->nr_cells; k++) {
if (s->cells[k].h_max > h_max) h_max = s->cells[k].h_max;
}
} else {
for (k = 0; k < nr_parts; k++) {
for (int k = 0; k < nr_parts; k++) {
if (s->parts[k].h > h_max) h_max = s->parts[k].h;
}
s->h_max = h_max;
......
Markdown is supported
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