| 1 |
gezelter |
560 |
!! |
| 2 |
|
|
!! Copyright (c) 2005 The University of Notre Dame. All Rights Reserved. |
| 3 |
|
|
!! |
| 4 |
|
|
!! The University of Notre Dame grants you ("Licensee") a |
| 5 |
|
|
!! non-exclusive, royalty free, license to use, modify and |
| 6 |
|
|
!! redistribute this software in source and binary code form, provided |
| 7 |
|
|
!! that the following conditions are met: |
| 8 |
|
|
!! |
| 9 |
gezelter |
1390 |
!! 1. Redistributions of source code must retain the above copyright |
| 10 |
gezelter |
560 |
!! notice, this list of conditions and the following disclaimer. |
| 11 |
|
|
!! |
| 12 |
gezelter |
1390 |
!! 2. Redistributions in binary form must reproduce the above copyright |
| 13 |
gezelter |
560 |
!! notice, this list of conditions and the following disclaimer in the |
| 14 |
|
|
!! documentation and/or other materials provided with the |
| 15 |
|
|
!! distribution. |
| 16 |
|
|
!! |
| 17 |
|
|
!! This software is provided "AS IS," without a warranty of any |
| 18 |
|
|
!! kind. All express or implied conditions, representations and |
| 19 |
|
|
!! warranties, including any implied warranty of merchantability, |
| 20 |
|
|
!! fitness for a particular purpose or non-infringement, are hereby |
| 21 |
|
|
!! excluded. The University of Notre Dame and its licensors shall not |
| 22 |
|
|
!! be liable for any damages suffered by licensee as a result of |
| 23 |
|
|
!! using, modifying or distributing the software or its |
| 24 |
|
|
!! derivatives. In no event will the University of Notre Dame or its |
| 25 |
|
|
!! licensors be liable for any lost revenue, profit or data, or for |
| 26 |
|
|
!! direct, indirect, special, consequential, incidental or punitive |
| 27 |
|
|
!! damages, however caused and regardless of the theory of liability, |
| 28 |
|
|
!! arising out of the use of or inability to use software, even if the |
| 29 |
|
|
!! University of Notre Dame has been advised of the possibility of |
| 30 |
|
|
!! such damages. |
| 31 |
|
|
!! |
| 32 |
gezelter |
1390 |
!! SUPPORT OPEN SCIENCE! If you use OpenMD or its source code in your |
| 33 |
|
|
!! research, please cite the appropriate papers when you publish your |
| 34 |
|
|
!! work. Good starting points are: |
| 35 |
|
|
!! |
| 36 |
|
|
!! [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). |
| 37 |
|
|
!! [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). |
| 38 |
|
|
!! [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). |
| 39 |
|
|
!! [4] Vardeman & Gezelter, in progress (2009). |
| 40 |
|
|
!! |
| 41 |
gezelter |
560 |
|
| 42 |
|
|
!! module defines atypes available to simulation |
| 43 |
|
|
|
| 44 |
|
|
module interactions |
| 45 |
|
|
|
| 46 |
|
|
use vector_class |
| 47 |
|
|
use atype_module |
| 48 |
|
|
use lj |
| 49 |
|
|
|
| 50 |
|
|
implicit none |
| 51 |
|
|
private |
| 52 |
|
|
|
| 53 |
|
|
#define __FORTRAN90 |
| 54 |
|
|
#include "UseTheForce/DarkSide/fInteractionMap.h" |
| 55 |
|
|
|
| 56 |
|
|
type, public :: Interaction |
| 57 |
|
|
integer :: InteractionHash |
| 58 |
|
|
real(kind=dp) :: rCut |
| 59 |
|
|
end type Interaction |
| 60 |
|
|
|
| 61 |
|
|
type(Interaction), public, dimension(:,:), allocatable :: InteractionMap |
| 62 |
|
|
|
| 63 |
|
|
!public :: addInteraction |
| 64 |
|
|
!public :: setInteractionHash |
| 65 |
|
|
!public :: getInteractionHash |
| 66 |
|
|
|
| 67 |
|
|
public :: createInteractionMap |
| 68 |
|
|
|
| 69 |
|
|
|
| 70 |
|
|
contains |
| 71 |
|
|
|
| 72 |
|
|
subroutine createInteractionMap(status) |
| 73 |
|
|
integer :: nAtypes |
| 74 |
|
|
integer :: status |
| 75 |
|
|
integer :: i |
| 76 |
|
|
integer :: j |
| 77 |
|
|
|
| 78 |
|
|
if (.not. associated(atypes)) then |
| 79 |
|
|
call handleError("atype", "atypes was not present before call of createDefaultInteractionMap!") |
| 80 |
|
|
status = -1 |
| 81 |
|
|
return |
| 82 |
|
|
endif |
| 83 |
|
|
|
| 84 |
|
|
nAtypes = getSize(atypes) |
| 85 |
|
|
|
| 86 |
|
|
if (nAtypes == 0) then |
| 87 |
|
|
status = -1 |
| 88 |
|
|
return |
| 89 |
|
|
end if |
| 90 |
|
|
|
| 91 |
|
|
if (.not. allocated(InteractionMap)) then |
| 92 |
|
|
allocate(InteractionMap(nAtypes,nAtypes)) |
| 93 |
|
|
endif |
| 94 |
|
|
|
| 95 |
|
|
do i = 1, nAtypes |
| 96 |
|
|
call getElementProperty(atypes, i, "is_LennardJones", i_is_LJ) |
| 97 |
|
|
call getElementProperty(atypes, i, "is_Electrostatic", i_is_Elect) |
| 98 |
|
|
call getElementProperty(atypes, i, "is_Sticky", i_is_Sticky) |
| 99 |
|
|
call getElementProperty(atypes, i, "is_StickyPower", i_is_StickyP) |
| 100 |
|
|
call getElementProperty(atypes, i, "is_GayBerne", i_is_GB) |
| 101 |
|
|
call getElementProperty(atypes, i, "is_EAM", i_is_EAM) |
| 102 |
|
|
call getElementProperty(atypes, i, "is_Shape", i_is_Shape) |
| 103 |
|
|
|
| 104 |
|
|
do j = i, nAtypes |
| 105 |
|
|
|
| 106 |
|
|
iHash = 0 |
| 107 |
|
|
myRcut = 0.0_dp |
| 108 |
|
|
|
| 109 |
|
|
call getElementProperty(atypes, j, "is_LennardJones", j_is_LJ) |
| 110 |
|
|
call getElementProperty(atypes, j, "is_Electrostatic", j_is_Elect) |
| 111 |
|
|
call getElementProperty(atypes, j, "is_Sticky", j_is_Sticky) |
| 112 |
|
|
call getElementProperty(atypes, j, "is_StickyPower", j_is_StickyP) |
| 113 |
|
|
call getElementProperty(atypes, j, "is_GayBerne", j_is_GB) |
| 114 |
|
|
call getElementProperty(atypes, j, "is_EAM", j_is_EAM) |
| 115 |
|
|
call getElementProperty(atypes, j, "is_Shape", j_is_Shape) |
| 116 |
|
|
|
| 117 |
|
|
if (i_is_LJ .and. j_is_LJ) then |
| 118 |
|
|
iHash = ior(iHash, LJ_PAIR) |
| 119 |
|
|
|
| 120 |
|
|
|
| 121 |
|
|
|
| 122 |
|
|
endif |
| 123 |
|
|
|
| 124 |
|
|
|
| 125 |
|
|
|
| 126 |
|
|
if (i_is_Elect .and. j_is_Elect) iHash = ior(iHash, ELECTROSTATIC_PAIR) |
| 127 |
|
|
if (i_is_Sticky .and. j_is_Sticky) iHash = ior(iHash, STICKY_PAIR) |
| 128 |
|
|
if (i_is_StickyP .and. j_is_StickyP) iHash = ior(iHash, STICKYPOWER_PAIR) |
| 129 |
|
|
|
| 130 |
|
|
if (i_is_EAM .and. j_is_EAM) iHash = ior(iHash, EAM_PAIR) |
| 131 |
|
|
|
| 132 |
|
|
if (i_is_GB .and. j_is_GB) iHash = ior(iHash, GAYBERNE_PAIR) |
| 133 |
|
|
if (i_is_GB .and. j_is_LJ) iHash = ior(iHash, GAYBERNE_LJ) |
| 134 |
|
|
if (i_is_LJ .and. j_is_GB) iHash = ior(iHash, GAYBERNE_LJ) |
| 135 |
|
|
|
| 136 |
|
|
if (i_is_Shape .and. j_is_Shape) iHash = ior(iHash, SHAPE_PAIR) |
| 137 |
|
|
if (i_is_Shape .and. j_is_LJ) iHash = ior(iHash, SHAPE_LJ) |
| 138 |
|
|
if (i_is_LJ .and. j_is_Shape) iHash = ior(iHash, SHAPE_LJ) |
| 139 |
|
|
|
| 140 |
|
|
|
| 141 |
|
|
InteractionMap(i,j)%InteractionHash = iHash |
| 142 |
|
|
InteractionMap(j,i)%InteractionHash = iHash |
| 143 |
|
|
|
| 144 |
|
|
end do |
| 145 |
|
|
|
| 146 |
|
|
end do |
| 147 |
|
|
end subroutine createInteractionMap |
| 148 |
|
|
|
| 149 |
|
|
end module interactions |