1
$\begingroup$

I have just started using dl_poly classic to work in Molecular Dynamics simulations. It produces a HISTORY file which records the trajectory after applying boundary conditions. Now, here I don't understand, how I am suppossed to calculate diffusivity using folded trajectories. Secondly is there a way in dl_poly to unfold the trajectories may be using some counters that they might already written (i.e. to do it without altering the source code).

However, from one of the answers based on a question here, I wrote a code to unfold the folded trajectories (am trying to verify this from a program I wrote myself for the simulation of argon liquid, not dl_poly) -

open(unit=11,file='test.out',status='unknown')

  rx(:,1) = x(:,1)
  do j=2,tsteps
  do i=1,nm

    tmp1 = x(i,j-1) - x(i,j) + boxl/2.d0
    tmp1 = tmp1 - boxL*floor(tmp1/boxL)
    tmp2 = boxL/2.d0 - tmp1
    rx(i,j) = rx(i,j-1) + tmp2
    write(11,*) i,j,x(i,j),ox(i,j),rx(i,j),ox(i,j)-rx(i,j)
  end do
  end do

In the above program, x(i,j) are folded coordinates, ox(i,j) are the unfolded ones that are there already (this is the output a simulation program I wrote) and rx(i,j) are the coordinates I am unfolding from x(i,j), where i corressponds to $i^{th}$ particle and j corresponds to $j^{th}$ timestep.

The problem I am facing with the above program is that, in some cases, I get a difference of +boxl or -boxl from the actual unfolded coordinates (i.e. between, ox(i,j) and rx(i,j) )

This is the answer I used to write down this logic, but I might written it down wrongly as well.

$\endgroup$
2
  • $\begingroup$ What do you mean by "folding?" $\endgroup$
    – mabraham
    Oct 21, 2015 at 5:12
  • $\begingroup$ Applying periodic boundary conditions to the trajectories !! $\endgroup$
    – user35952
    Oct 21, 2015 at 5:16

1 Answer 1

1
$\begingroup$

1) You can't, so you need trajectories that do not do such operations, or an analysis implementation that undoes such wrapping on the fly, e.g. by noticing a jump of around the size of the simulation cell.

2) Don't know, try the dl_poly documentation.

$\endgroup$
2
  • $\begingroup$ Please refer to the answer. It suggests how to unfold trajectories, my question is based on that. $\endgroup$
    – user35952
    Oct 21, 2015 at 5:36
  • 1
    $\begingroup$ Your questions preceded your code fragment. Your request for free debugging is not a question in the sense of this Q&A site, but you should start by observing that your code eliminates boxL / 2 from the computation. $\endgroup$
    – mabraham
    Oct 21, 2015 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.