void integrate (int n_local, particle_t* particles_local, int T, double dt, MPI_Comm comm) { int status; MPI_Recv((particle_t *)particles_local, n_local, MPI_PARTICLE_T, 0, 50, comm, &status); int P = mpih_getSize (MPI_COMM_WORLD); int regionWidth = (DOMAIN_SIZE / sqrt(P)); int rank = mpih_getRank (comm); double* ax = (double *)malloc (n_local * sizeof (double)); double* ay = (double *)malloc (n_local * sizeof (double)); mpih_assert (ax && ay); const double t_start = MPI_Wtime (); for (int k = 0; k < T; ++k) { evalForces (n_local, particles_local, ax, ay, comm); moveParticles__ (n_local, particles_local, dt, ax, ay); } t_all__ += MPI_Wtime () - t_start; free (ax); free (ay); }
void SoftBody::step( ){ //for (int i=0; i<npoints; i++){ forces[i].set(0.0); } evalForces( ); applyConstrains(); move_LeapFrog( ); }