Пример #1
0
void apply_sph(fluid_sim* fsimp)
{
    clear_particle_data(fsimp->lpg);
    std::vector<interaction> interactions = collect_interactions(fsimp->lpg);
    compute_densities(interactions, fsimp->lpg.step);
    compute_pressures(fsimp->f);
    apply_forces(interactions, fsimp->f);
}
Пример #2
0
real pull_potential(int ePull,t_pull *pull, t_mdatoms *md, t_pbc *pbc,
		    t_commrec *cr, double t, real lambda,
		    rvec *x, rvec *f, tensor vir, real *dvdlambda)
{
  real V,dVdl;

  pull_calc_coms(cr,pull,md,pbc,t,x,NULL);

  do_pull_pot(ePull,pull,pbc,t,lambda,
	      &V,pull->bVirial && MASTER(cr) ? vir : NULL,&dVdl);

  /* Distribute forces over pulled groups */
  apply_forces(pull, md, DOMAINDECOMP(cr) ? cr->dd->ga2la : NULL, f);

  if (MASTER(cr)) {
    *dvdlambda += dVdl;
  }

  return (MASTER(cr) ? V : 0.0);
}