atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
dvtb.F90
Go to the documentation of this file.
1! This file is part of the 'atomes' software.
2!
3! 'atomes' is free software: you can redistribute it and/or modify it under the terms
4! of the GNU Affero General Public License as published by the Free Software Foundation,
5! either version 3 of the License, or (at your option) any later version.
6!
7! 'atomes' is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
8! without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9! See the GNU General Public License for more details.
10!
11! You should have received a copy of the GNU Affero General Public License along with 'atomes'.
12! If not, see <https://www.gnu.org/licenses/>
13!
14! Copyright (C) 2022-2024 by CNRS and University of Strasbourg
15!
20
21LOGICAL FUNCTION dvtbox(ST, NAS, NAT, NPOS)
22
23!
24! Create a superlattice
25! Size of the superlattice will be NBX*NBX*NBX with NBX >= 3
26! NBX is set in dmtx.f90
27!
28
29USE parameters
30
31IMPLICIT NONE
32
33INTEGER, INTENT(IN) :: st, nas, nat
34DOUBLE PRECISION, DIMENSION(NAT,3), INTENT(INOUT) :: npos
35DOUBLE PRECISION, DIMENSION(3) :: dvt
36INTEGER :: iid, jid, kid, lid, mid, nid
37
38iid=0
39do jid=-nbx+(nbx/2)+1, nbx-(nbx/2)-1, 1
40 do kid=-nbx+(nbx/2)+1, nbx-(nbx/2)-1, 1
41 do lid=-nbx+(nbx/2)+1, nbx-(nbx/2)-1, 1
42 if (ncells .gt. 1) then
43 mid = st
44 else
45 mid = 1
46 endif
47 dvt(1)=jid*the_box(mid)%lvect(1,1)+kid*the_box(mid)%lvect(2,1)+lid*the_box(mid)%lvect(3,1)
48 dvt(2)=jid*the_box(mid)%lvect(1,2)+kid*the_box(mid)%lvect(2,2)+lid*the_box(mid)%lvect(3,2)
49 dvt(3)=jid*the_box(mid)%lvect(1,3)+kid*the_box(mid)%lvect(2,3)+lid*the_box(mid)%lvect(3,3)
50 do mid=1, nas
51 iid = iid + 1
52 do nid=1, 3
53 npos(iid,nid)=fullpos(mid,nid,st)+dvt(nid)
54 enddo
55 enddo
56 enddo
57 enddo
58enddo
59
60dvtbox=.true.
61
62END FUNCTION
logical function dvtbox(st, nas, nat, npos)
Definition dvtb.F90:22
double precision, dimension(:,:,:), allocatable fullpos
integer ncells
integer nbx
type(lattice), dimension(:), allocatable, target the_box