/* the normal, mass-weighted mean-squared displacement calcuation */
static real calc1_mw(t_corr *curr,int nx,atom_id index[],int nx0,rvec xc[],
		     rvec dcom,gmx_bool bTen,matrix mat,const output_env_t oenv)
{
  int  i;
  real g,tm;

  g=tm=0.0;
  clear_mat(mat);
  for(i=0; (i<nx); i++) 
    g += calc_one_mw(curr,index[i],nx0,xc,&tm,dcom,bTen,mat);
  
  g/=tm;
  if (bTen)
    msmul(mat,1/tm,mat);

  return g;
}
static real calc1_mol(t_corr *curr,int nx,atom_id index[],int nx0,rvec xc[],
		      rvec dcom,gmx_bool bTen,matrix mat, const output_env_t oenv)
{
  int  i;
  real g,tm,gtot,tt;

  tt = curr->time[in_data(curr,nx0)];
  gtot = 0;
  tm = 0;
  clear_mat(mat);
  for(i=0; (i<nx); i++) {
    g = calc_one_mw(curr,i,nx0,xc,&tm,dcom,bTen,mat);
    /* We don't need to normalize as the mass was set to 1 */
    gtot += g;
    if (tt >= curr->beginfit && (curr->endfit < 0 || tt <= curr->endfit))
      gmx_stats_add_point(curr->lsq[nx0][i],tt,g,0,0);
  }
  msmul(mat,1.0/nx,mat);

  return gtot/nx;
}
Beispiel #3
0
/* the normal, mass-weighted mean-squared displacement calcuation */
static real calc1_mw(t_corr *curr, int nx, int index[], int nx0, rvec xc[],
                     rvec dcom, gmx_bool bTen, matrix mat)
{
    int  i;
    real g, tm;

    g = tm = 0.0;
    clear_mat(mat);
    for (i = 0; (i < nx); i++)
    {
        g += calc_one_mw(curr, index[i], nx0, xc, &tm, dcom, bTen, mat);
    }

    g /= tm;
    if (bTen)
    {
        msmul(mat, 1/tm, mat);
    }

    return g;
}