Project

General

Profile

dd_rerun.patch

updated version of patch - Mark Abraham, 04/30/2009 03:17 PM

View differences:

newmd.c 2009-04-25 16:26:06.000000000 +1000
926 926
      update_annealing_target_temp(&(ir->opts),t);
927 927
    
928 928
    if (bRerunMD) {
929
      for(i=0; i<mdatoms->nr; i++)
930
	copy_rvec(rerun_fr.x[i],state->x[i]);
931
      if (rerun_fr.bV)
932
	for(i=0; i<mdatoms->nr; i++)
933
	  copy_rvec(rerun_fr.v[i],state->v[i]);
934
      else {
935
	for(i=0; i<mdatoms->nr; i++)
936
	    clear_rvec(state->v[i]);
937
	if (bRerunWarnNoV) {
938
	  fprintf(stderr,"\nWARNING: Some frames do not contain velocities.\n"
939
		  "         Ekin, temperature and pressure are incorrect,\n"
940
		  "         the virial will be incorrect when constraints are present.\n"
941
		  "\n");
942
	  bRerunWarnNoV = FALSE;
943
	}
944
      }
945
      copy_mat(rerun_fr.box,state->box);
946

  
947
      if (vsite) {
948
	if (graph) {
949
	  /* Following is necessary because the graph may get out of sync
950
	   * with the coordinates if we only have every N'th coordinate set
951
	   */
952
	  mk_mshift(fplog,graph,fr->ePBC,state->box,state->x);
953
	  shift_self(graph,state->box,state->x);
954
	}
955
	construct_vsites(fplog,vsite,state->x,nrnb,ir->delta_t,state->v,
956
			 top->idef.iparams,top->idef.il,
957
			 fr->ePBC,fr->bMolPBC,graph,cr,state->box);
958
	if (graph)
959
	  unshift_self(graph,state->box,state->x);
929
      if (!DOMAINDECOMP(cr) || DDMASTER(cr->dd)) {
930
	t_state *rerun_state;
931
	if (!DOMAINDECOMP(cr)) {
932
	  rerun_state = state;
933
	} else { /* DDMASTER(cr->dd) == TRUE */
934
	  rerun_state = state_global;
935
	}
936
	for(i=0; i<rerun_state->natoms; i++) {
937
	  copy_rvec(rerun_fr.x[i],rerun_state->x[i]);
938
	}
939
	if (rerun_fr.bV)
940
	  for(i=0; i<rerun_state->natoms; i++)
941
	    copy_rvec(rerun_fr.v[i],rerun_state->v[i]);
942
	else {
943
	  for(i=0; i<rerun_state->natoms; i++)
944
	    clear_rvec(rerun_state->v[i]);
945
	  if (bRerunWarnNoV) {
946
	    fprintf(stderr,"\nWARNING: Some frames do not contain velocities.\n"
947
		    "         Ekin, temperature and pressure are incorrect,\n"
948
		    "         the virial will be incorrect when constraints are present.\n"
949
		    "\n");
950
	    bRerunWarnNoV = FALSE;
951
	  }
952
	}
953
	copy_mat(rerun_fr.box,rerun_state->box);
954
	
955
	if (vsite) {
956
	  if (graph) {
957
	    /* Following is necessary because the graph may get out of sync
958
	     * with the coordinates if we only have every N'th coordinate set
959
	     */
960
	    mk_mshift(fplog,graph,fr->ePBC,rerun_state->box,rerun_state->x);
961
	    shift_self(graph,rerun_state->box,rerun_state->x);
962
	  }
963
	  construct_vsites(fplog,vsite,rerun_state->x,nrnb,ir->delta_t,rerun_state->v,
964
			   top->idef.iparams,top->idef.il,
965
			   fr->ePBC,fr->bMolPBC,graph,cr,rerun_state->box);
966
	  if (graph)
967
	    unshift_self(graph,rerun_state->box,rerun_state->x);
968
	}
960 969
      }
961 970
    }
962 971