--- trunk/OOPSE/libmdtools/simulation_module.F90 2003/04/11 18:46:37 491 +++ trunk/OOPSE/libmdtools/simulation_module.F90 2003/07/01 21:33:45 569 @@ -30,14 +30,12 @@ module simulation real(kind=dp), save :: rcut2 = 0.0_DP real(kind=dp), save :: rcut6 = 0.0_DP real(kind=dp), save :: rlist2 = 0.0_DP - real(kind=dp), public, dimension(3), save :: box - + real(kind=dp), public, dimension(3,3), save :: Hmat, HmatInv + logical, save :: boxIsOrthorhombic public :: SimulationSetup public :: getNlocal public :: setBox - public :: setBox_3d - public :: getBox public :: setRcut public :: getRcut public :: getRlist @@ -54,17 +52,7 @@ module simulation public :: SimRequiresPrepairCalc public :: SimRequiresPostpairCalc public :: SimUsesDirectionalAtoms - - interface getBox - module procedure getBox_3d - module procedure getBox_1d - end interface - interface setBox - module procedure setBox_3d - module procedure setBox_1d - end interface - contains subroutine SimulationSetup(setThisSim, CnGlobal, CnLocal, c_idents, & @@ -194,23 +182,22 @@ contains end subroutine SimulationSetup - subroutine setBox_3d(new_box_size) - real(kind=dp), dimension(3) :: new_box_size + subroutine setBox(cHmat, cHmatInv, cBoxIsOrthorhombic) + real(kind=dp), dimension(3,3) :: cHmat, cHamtInv + integer :: cBoxIsOrthorhombic integer :: smallest, status, i - thisSim%box = new_box_size - box = thisSim%box + Hmat = cHmat + HmatInv = cHmatInv + if(cBoxisOrthorhombic .eq. 0 )then + boxIsOrthorhombic = .false. + else boxIsOrthorhombic = .true. + endif + return - end subroutine setBox_3d + end subroutine setBox - subroutine setBox_1d(dim, new_box_size) - integer :: dim, status - real(kind=dp) :: new_box_size - thisSim%box(dim) = new_box_size - box(dim) = thisSim%box(dim) - end subroutine setBox_1d - subroutine setRcut(new_rcut, status) real(kind = dp) :: new_rcut integer :: myStatus, status @@ -220,18 +207,6 @@ contains status = 0 return end subroutine setRcut - - function getBox_3d() result(thisBox) - real( kind = dp ), dimension(3) :: thisBox - thisBox = thisSim%box - end function getBox_3d - - function getBox_1d(dim) result(thisBox) - integer, intent(in) :: dim - real( kind = dp ) :: thisBox - - thisBox = thisSim%box(dim) - end function getBox_1d subroutine getRcut(thisrcut,rc2,rc6,status) real( kind = dp ), intent(out) :: thisrcut