[gmx-developers] Modifying velocities and coordinates

Walter Ash wlash at ucalgary.ca
Thu Oct 9 23:58:15 CEST 2003

Hi,  I'm writing a routine to modify coordinates and velocities at the
end of the do_md() main MD loop.  I use a call something liek the

if (condition) {

with a function like:

int modifyxv(rvec *x, rvec *v, int natoms) {
  for(i=0;i<natoms;i++) {
	for(j=0;j<DIM;j++) {
	    x[i][j] = ##;
	    v[i][j] = ##;

Unfortunately whenever I do this the program crashed with a segfault.  I
think the function modifyxv is working fine, and as far as I know the
way I call it is fine.  My question is, are there other things to
concern myself with (assuming I don't put atoms outside the box, etc)
after changing coordinates and velocities, besides updating the
neighborlist?  Is the force array important, or does it get calculated
from scratch at the beginning of the main MD loop?

More information about the gromacs.org_gmx-developers mailing list