Re: xsc file format

From: Luca Muccioli (luca_at_ms.fci.unibo.it)
Date: Mon Dec 22 2008 - 05:22:16 CST

dear Kyriakos,

  in the most general case you have nine figures for the simulation cell in the
xst/xsc file, e.g.

# NAMD extended system configuration restart file
#$LABELS step a_x a_y a_z b_x b_y b_z c_x c_y c_z o_x o_y o_z
20000000 45.8525 0 0 0.144183 41.6781 0 0.362906 0.23746 43.5339 0 0 0
          1 2 3 4 5 6 7 8 9

they represent the cell axes (a,b,c), and they are the columns of the matrix
called CO in the fortran routines below. I adapted them, maybe they need some changes to
work.

to compute the distances, you need also the inverse of the CO matrix=OC, and do
like this:

     r12=Mol2%m_center-Mol1%m_center
     r12=matmul(OC/2._rk,r12)
     Delta=2._rk*NINT(0.5_rk*r12)
     r12=r12-Delta
     r12=matmul(CO/2._rk,r12)
     True_r=r12

cheers

Luca

-------------------------------------------

Luca Muccioli, Ph. D.
Dipartimento di Chimica Fisica e Inorganica, INSTM
Universita` di Bologna
Via Risorgimento 4
40136 Bologna (Italia)

E-mail: luca_at_fci.unibo.it
Phone: +39-051-6446992
Fax: +39-051-2093690
Web: http://www2.fci.unibo.it/~luca/

  function HMatrix(sides,angles) result(CO)
     real(rk),intent(in):: sides(3),angles(3)
     real(rk):: CO(3,3)
     real(rk):: ax,bx,by,cx,cy,cz,cang(3),qt

     co(2,1)=0._rk
     co(3,1)=0._rk
     co(3,2)=0._rk

     ax=sides(1)

     cang(1)=COS(deg_to_rad*angles(1))
     cang(2)=COS(deg_to_rad*angles(2))
     cang(3)=COS(deg_to_rad*angles(3))

     qt=SIN(deg_to_rad*angles(3))

     bx=sides(2)*cang(3)
     by=sides(2)*qt
     cx=sides(3)*cang(2)
     cy=sides(3)*(cang(1)-cang(2)*cang(3))/qt
     cz=sqrt(sides(3)**2-cx*cx-cy*cy)

     co(1,1)=ax
     co(1,2)=bx
     co(1,3)=cx
     co(2,2)=by
     co(2,3)=cy
     co(3,3)=cz

   end function HMatrix

  function BoxSides(co,alpha,beta,gamma) result(v)
     IMPLICIT none
     integer, intent(in) :: cfg
     real(rk):: CO(3,3)
     real(rk) :: V(3)
     real(rk),intent(out),optional:: alpha,beta,gamma

     real(rk):: ax,bx,cx,by,cy,cz,qt

     ax = CO(1,1)
     bx = CO(1,2)
     cx = CO(1,3)
     by = CO(2,2)
     cy = CO(2,3)
     cz = CO(3,3)

     v(1) = ax
     v(2) = sqrt(bx**2+by**2)
     v(3) = sqrt(cx**2+cy**2+cz**2)

     if (present(alpha).and.present(beta).and.present(gamma)) then
        gamma = bx/v(2)
        beta = cx/v(3)
        qt = by/v(2)
        alpha = cy*qt/v(3)+beta*gamma

        alpha = rad_to_deg*acos(alpha)
        beta = rad_to_deg*acos(beta)
        gamma = rad_to_deg*acos(gamma)
     endif

   end function BoxSides

On Mon, 22 Dec 2008, Kyriakos Kachrimanis wrote:

> Date: Mon, 22 Dec 2008 11:24:46 +0200
> From: Kyriakos Kachrimanis <kgk_at_pharm.auth.gr>
> To: namd-l_at_ks.uiuc.edu
> Subject: namd-l: xsc file format
>
> Dear NAMD users,
> I am new to NAMD and I would like to simulate an organic crystal and I could not find a detailed description of the .xsc file format. Could someone please provide an example of an xsc file for a crystalline system? How are the unit cell axes lengths and angles defined?
> Thanks in advance.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:50:17 CST