diff --git a/src/engine.c b/src/engine.c index 3437a495efb662ebd7cad1970f2132d8481e93e8..2e70d45a1ae50252077fe4e411000bdebf89ba7a 100644 --- a/src/engine.c +++ b/src/engine.c @@ -1618,7 +1618,7 @@ void engine_barrier(struct engine *e, int tid) { } /** - * @brief Mapping function to collect the data from the second kick. + * @brief Mapping function to collect the data from the kick. */ void engine_collect_kick(struct cell *c) { @@ -1666,120 +1666,9 @@ void engine_collect_kick(struct cell *c) { c->ang[2] = ang[2]; } -/** - * @brief Compute the force on a single particle brute-force. - */ -// void engine_single_density ( double *dim , long long int pid , struct part -// *__restrict__ parts , int N , int periodic ) { -// -// int i, k; -// double r2, dx[3]; -// float fdx[3], ih; -// struct part p; -// -// /* Find "our" part. */ -// for ( k = 0 ; k < N && parts[k].id != pid ; k++ ); -// if ( k == N ) -// error( "Part not found." ); -// p = parts[k]; -// -// /* Clear accumulators. */ -// ih = 1.0f / p.h; -// p.rho = 0.0f; p.rho_dh = 0.0f; -// p.density.wcount = 0.0f; p.density.wcount_dh = 0.0f; -// p.density.div_v = 0.0; -// for ( k=0 ; k < 3 ; k++) -// p.density.curl_v[k] = 0.0; -// -// /* Loop over all particle pairs (force). */ -// for ( k = 0 ; k < N ; k++ ) { -// if ( parts[k].id == p.id ) -// continue; -// for ( i = 0 ; i < 3 ; i++ ) { -// dx[i] = p.x[i] - parts[k].x[i]; -// if ( periodic ) { -// if ( dx[i] < -dim[i]/2 ) -// dx[i] += dim[i]; -// else if ( dx[i] > dim[i]/2 ) -// dx[i] -= dim[i]; -// } -// fdx[i] = dx[i]; -// } -// r2 = fdx[0]*fdx[0] + fdx[1]*fdx[1] + fdx[2]*fdx[2]; -// if ( r2 < p.h*p.h*kernel_gamma2 ) { -// runner_iact_nonsym_density( r2 , fdx , p.h , parts[k].h , &p , -// &parts[k] ); -// } -// } -// -// /* Dump the result. */ -// p.rho = ih * ih * ih * ( p.rho + p.mass*kernel_root ); -// p.rho_dh = p.rho_dh * ih * ih * ih * ih; -// p.density.wcount = ( p.density.wcount + kernel_root ) * ( 4.0f / 3.0 * -// M_PI * kernel_gamma3 ); -// message( "part %lli (h=%e) has wcount=%e, rho=%e, rho_dh=%e." , p.id , -// p.h , p.density.wcount , p.rho , p.rho_dh ); -// fflush(stdout); -// -// } - -// void engine_single_force ( double *dim , long long int pid , struct part -// *__restrict__ parts , int N , int periodic ) { -// -// int i, k; -// double r2, dx[3]; -// float fdx[3]; -// struct part p; -// -// /* Find "our" part. */ -// for ( k = 0 ; k < N && parts[k].id != pid ; k++ ); -// if ( k == N ) -// error( "Part not found." ); -// p = parts[k]; -// -// /* Clear accumulators. */ -// p.a[0] = 0.0f; p.a[1] = 0.0f; p.a[2] = 0.0f; -// p.force.u_dt = 0.0f; p.force.h_dt = 0.0f; p.force.v_sig = 0.0f; -// -// /* Loop over all particle pairs (force). */ -// for ( k = 0 ; k < N ; k++ ) { -// // for ( k = N-1 ; k >= 0 ; k-- ) { -// if ( parts[k].id == p.id ) -// continue; -// for ( i = 0 ; i < 3 ; i++ ) { -// dx[i] = p.x[i] - parts[k].x[i]; -// if ( periodic ) { -// if ( dx[i] < -dim[i]/2 ) -// dx[i] += dim[i]; -// else if ( dx[i] > dim[i]/2 ) -// dx[i] -= dim[i]; -// } -// fdx[i] = dx[i]; -// } -// r2 = fdx[0]*fdx[0] + fdx[1]*fdx[1] + fdx[2]*fdx[2]; -// if ( r2 < p.h*p.h*kernel_gamma2 || r2 < -// parts[k].h*parts[k].h*kernel_gamma2 ) { -// p.a[0] = 0.0f; p.a[1] = 0.0f; p.a[2] = 0.0f; -// p.force.u_dt = 0.0f; p.force.h_dt = 0.0f; p.force.v_sig = 0.0f; -// runner_iact_nonsym_force( r2 , fdx , p.h , parts[k].h , &p , -// &parts[k] ); -// double dvdr = ( (p.v[0]-parts[k].v[0])*fdx[0] + -// (p.v[1]-parts[k].v[1])*fdx[1] + (p.v[2]-parts[k].v[2])*fdx[2] ) / sqrt(r2); -// message( "part %lli and %lli interact (r=%.3e,dvdr=%.3e) with -// a=[%.3e,%.3e,%.3e], dudt=%.3e." , -// p.id , parts[k].id , sqrt(r2) , dvdr , p.a[0] , p.a[1], -// p.a[2] , p.force.u_dt ); -// } -// } -// -// /* Dump the result. */ -// // message( "part %lli (h=%e) has a=[%.3e,%.3e,%.3e], udt=%e." , p.id , -// p.h , p.a[0] , p.a[1] , p.a[2] , p.force.u_dt ); -// fflush(stdout); -// -// } + /** * @brief Launch the runners. *