TABLE OF CONTENTS


ABINIT/pbc_lotf [ Modules ]

[ Top ] [ Modules ]

NAME

 pbc_lotf

FUNCTION

COPYRIGHT

 Copyright (C) 2005-2018 ABINIT group (MMancini)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

SOURCE

16 #if defined HAVE_CONFIG_H
17 #include "config.h"
18 #endif
19 
20 #include "abi_common.h"
21 
22 module pbc_lotf
23 
24  use defs_basis
25 
26  implicit none
27  private
28 
29  real(dp),private :: aa(3,3),bb(3,3)
30  real(dp),public :: rd(3)  ! these are pbc output
31  real(dp),public  :: r2  ! these are pbc output
32 
33  public ::           &
34    dist_pbc,         &
35    pbc_init,         &
36    pbc_aa_contract,  &
37    pbc_bb_contract,  &
38    pbc_bb_proj
39 
40  private ::          &
41    vecp
42 
43 
44  interface dist_pbc
45    module procedure dist_pbc_ext
46    module procedure dist_pbc_int
47  end interface dist_pbc
48 
49 contains

pbc/dist_pbc_ext [ Functions ]

[ Top ] [ Functions ]

NAME

 dist_pbc_ext

FUNCTION

INPUTS

PARENTS

CHILDREN

SOURCE

239  subroutine dist_pbc_ext(RI,RJ,r2,RD)
240   ! ONLY aa AND bb MATRICES ARE USED IN THIS VERSION
241 
242 !This section has been created automatically by the script Abilint (TD).
243 !Do not modify the following lines by hand.
244 #undef ABI_FUNC
245 #define ABI_FUNC 'dist_pbc_ext'
246 !End of the abilint section
247 
248   implicit none
249 
250   !Arguments ------------------------
251   real(dp),intent(out) :: r2
252   real(dp),intent(in),dimension(3) :: RI, RJ
253   real(dp),intent(out),dimension(3) :: RD
254   !Local ---------------------------
255   integer :: ii
256   real(dp),dimension(3) :: rad, radi
257 
258 ! *************************************************************************
259 
260   !--at These are cartesian:
261   rad = RI - RJ
262 
263   !--at These are monoclinic:
264   radi(:) = matmul(rad,bb)
265 
266   do ii=1,3
267     if(radi(ii) < -half) then
268       rad = rad + aa(:,ii)
269     elseif(radi(ii) > half) then
270       rad = rad - aa(:,ii)
271     endif
272   enddo
273 
274   r2 = dot_product(rad,rad)
275   RD = rad
276  end subroutine dist_pbc_ext

pbc/dist_pbc_int [ Functions ]

[ Top ] [ Functions ]

NAME

 dist_pbc_int

FUNCTION

INPUTS

PARENTS

CHILDREN

SOURCE

293  subroutine dist_pbc_int(RI,RJ)
294   ! ONLY aa AND bb MATRICES ARE USED IN THIS VERSION
295 
296 !This section has been created automatically by the script Abilint (TD).
297 !Do not modify the following lines by hand.
298 #undef ABI_FUNC
299 #define ABI_FUNC 'dist_pbc_int'
300 !End of the abilint section
301 
302   implicit none
303 
304   !Arguments ------------------------
305   real(dp),intent(in),dimension(3) :: RI, RJ
306   !Local ---------------------------
307   integer :: ii
308   real(dp),dimension(3) :: rad, radi
309 
310 ! *************************************************************************
311 
312   !--at These are cartesian:
313   rad = RI - RJ
314 
315   !--at These are monoclinic:
316   radi(:) = matmul(rad,bb)
317 
318   do ii=1,3
319     if(radi(ii) < -half) then
320       rad = rad + aa(:,ii)
321     elseif(radi(ii) > half) then
322       rad = rad - aa(:,ii)
323     endif
324   enddo
325 
326   r2 = dot_product(rad,rad)
327   RD = rad
328  end subroutine dist_pbc_int
329 
330 end module pbc_lotf

pbc_lotf/pbc_aa_contract [ Functions ]

[ Top ] [ pbc_lotf ] [ Functions ]

NAME

 pbc_aa_contract

FUNCTION

  Compute the contraction of aa

INPUTS

CHILDREN

SOURCE

140  function pbc_aa_contract()
141 
142 
143 !This section has been created automatically by the script Abilint (TD).
144 !Do not modify the following lines by hand.
145 #undef ABI_FUNC
146 #define ABI_FUNC 'pbc_aa_contract'
147 !End of the abilint section
148 
149   implicit none
150 
151   !Arguments ------------------------
152   real(dp) :: pbc_aa_contract(3)
153   pbc_aa_contract = sqrt(sum(aa(:,:)**two,dim=1))
154   return
155  end function pbc_aa_contract

pbc_lotf/pbc_bb_contract [ Functions ]

[ Top ] [ pbc_lotf ] [ Functions ]

NAME

 pbc_bb_contract

FUNCTION

  Compute the contraction of bb

INPUTS

CHILDREN

SOURCE

170  function pbc_bb_contract()
171 
172 
173 !This section has been created automatically by the script Abilint (TD).
174 !Do not modify the following lines by hand.
175 #undef ABI_FUNC
176 #define ABI_FUNC 'pbc_bb_contract'
177 !End of the abilint section
178 
179   implicit none
180 
181   !Arguments ------------------------
182   real(dp) :: pbc_bb_contract(3)
183 
184 ! *************************************************************************
185 
186   pbc_bb_contract = sqrt(sum(bb(:,:)**two,dim=1))
187   return
188  end function pbc_bb_contract

pbc_lotf/pbc_bb_proj [ Functions ]

[ Top ] [ pbc_lotf ] [ Functions ]

NAME

 pbc_bb_proj

FUNCTION

  Compute the application of a vector on bb

INPUTS

  vi(3)=real vector

CHILDREN

SOURCE

204  function pbc_bb_proj(vi)
205 
206 
207 !This section has been created automatically by the script Abilint (TD).
208 !Do not modify the following lines by hand.
209 #undef ABI_FUNC
210 #define ABI_FUNC 'pbc_bb_proj'
211 !End of the abilint section
212 
213   implicit none
214 
215   !Arguments ------------------------
216   real(dp),intent(in) :: vi(3)
217   real(dp) :: pbc_bb_proj(3)
218 
219 ! *************************************************************************
220 
221   pbc_bb_proj = matmul(vi,bb)
222   return
223  end function pbc_bb_proj

pbc_lotf/pbc_init [ Functions ]

[ Top ] [ pbc_lotf ] [ Functions ]

NAME

 pbc_init

FUNCTION

INPUTS

PARENTS

      m_lotf

CHILDREN

SOURCE

101  subroutine pbc_init(rprimd)
102 
103 
104 !This section has been created automatically by the script Abilint (TD).
105 !Do not modify the following lines by hand.
106 #undef ABI_FUNC
107 #define ABI_FUNC 'pbc_init'
108 !End of the abilint section
109 
110   implicit none
111 
112   !Arguments ------------------------
113   real(dp),intent(in) :: rprimd(3,3)
114   !Local ---------------------------
115   real(dp) :: avol
116 
117   aa(:,:) =  rprimd(:,:)
118   call vecp(aa(1,2),aa(1,3),bb(1,1))     !--b^c
119   call vecp(aa(1,3),aa(1,1),bb(1,2))     !--c^a
120   call vecp(aa(1,1),aa(1,2),bb(1,3))     !--a^b
121   avol = dot_product(aa(:,3),bb(:,3))    !--c.(a^b)
122 
123   bb   = (one/avol)*bb
124  end subroutine pbc_init

pbc_lotf/vecp [ Functions ]

[ Top ] [ pbc_lotf ] [ Functions ]

NAME

 vecp

FUNCTION

INPUTS

PARENTS

      m_pbc_lotf

CHILDREN

SOURCE

66  subroutine vecp(a,b,c)
67 
68 
69 !This section has been created automatically by the script Abilint (TD).
70 !Do not modify the following lines by hand.
71 #undef ABI_FUNC
72 #define ABI_FUNC 'vecp'
73 !End of the abilint section
74 
75   real(dp),intent(in) :: a(3),b(3)
76   real(dp),intent(out) :: c(3)
77 
78 ! *************************************************************************
79 
80   c(1) = a(2) * b(3) - b(2) * a(3)
81   c(2) = a(3) * b(1) - b(3) * a(1)
82   c(3) = a(1) * b(2) - b(1) * a(2)
83  end subroutine vecp