Re: xsc file format

From: Kyriakos Kachrimanis (kgk_at_pharm.auth.gr)
Date: Mon Dec 22 2008 - 06:40:44 CST

Dear Luca,

thank you for your reply, but I still can't understand what those numbers
represent (this is probably because I am thinking in terms of unit cells and
not simulation boxes). Isn't the cell represented by axis lengths and
angles? Is it represented by a lattice vector matrix?
In the practical case of a crystal with the following unit cell parameters
(monoclinic) :
length a =10.066, length b =28.719, length c =4.831
angle alpha =90, angle beta =103.45, angle gamma =90
how should I represent the lattice lengths and angles in an xsc file? If
lattice vectors are needed, I can easily obtain the lattice vector matrix
for the unit cell using crystallographic software, but maybe I should have
asked first, is it possible to define a non-orthorhombic unit cell in namd?
I looked it up under "periodic boundary conditions" in the user manual but
it is not clear whether namd supports non-orthorhombic simulation boxes.

Regards,

Kyriakos.

----- Original Message -----
From: "Luca Muccioli" <luca_at_ms.fci.unibo.it>
To: "Kyriakos Kachrimanis" <kgk_at_pharm.auth.gr>
Cc: <namd-l_at_ks.uiuc.edu>
Sent: Monday, December 22, 2008 1:22 PM
Subject: Re: namd-l: xsc file format

> 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:18 CST