ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/UseTheForce/DarkSide/interactions.F90
Revision: 2259
Committed: Mon Jun 27 21:01:36 2005 UTC (19 years ago) by gezelter
File size: 5294 byte(s)
Log Message:
Breaky breaky!

File Contents

# Content
1 !!
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 !! 1. Acknowledgement of the program authors must be made in any
10 !! publication of scientific results based in part on use of the
11 !! program. An acceptable form of acknowledgement is citation of
12 !! the article in which the program was described (Matthew
13 !! A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 !! J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 !! Parallel Simulation Engine for Molecular Dynamics,"
16 !! J. Comput. Chem. 26, pp. 252-271 (2005))
17 !!
18 !! 2. Redistributions of source code must retain the above copyright
19 !! notice, this list of conditions and the following disclaimer.
20 !!
21 !! 3. Redistributions in binary form must reproduce the above copyright
22 !! notice, this list of conditions and the following disclaimer in the
23 !! documentation and/or other materials provided with the
24 !! distribution.
25 !!
26 !! This software is provided "AS IS," without a warranty of any
27 !! kind. All express or implied conditions, representations and
28 !! warranties, including any implied warranty of merchantability,
29 !! fitness for a particular purpose or non-infringement, are hereby
30 !! excluded. The University of Notre Dame and its licensors shall not
31 !! be liable for any damages suffered by licensee as a result of
32 !! using, modifying or distributing the software or its
33 !! derivatives. In no event will the University of Notre Dame or its
34 !! licensors be liable for any lost revenue, profit or data, or for
35 !! direct, indirect, special, consequential, incidental or punitive
36 !! damages, however caused and regardless of the theory of liability,
37 !! arising out of the use of or inability to use software, even if the
38 !! University of Notre Dame has been advised of the possibility of
39 !! such damages.
40 !!
41
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