atomes
1.1.14
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
21
LOGICAL
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
29
USE
parameters
30
31
IMPLICIT NONE
32
33
INTEGER
,
INTENT(IN)
:: st, nas, nat
34
DOUBLE PRECISION
,
DIMENSION(NAT,3)
,
INTENT(INOUT)
:: npos
35
DOUBLE PRECISION
,
DIMENSION(3)
:: dvt
36
INTEGER
:: iid, jid, kid, lid, mid, nid
37
38
iid=0
39
do
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
58
enddo
59
60
dvtbox
=.true.
61
62
END FUNCTION
dvtbox
logical function dvtbox(st, nas, nat, npos)
Definition
dvtb.F90:22
parameters
Definition
parameters.F90:59
parameters::fullpos
double precision, dimension(:,:,:), allocatable fullpos
Definition
parameters.F90:546
parameters::ncells
integer ncells
Definition
parameters.F90:157
parameters::nbx
integer nbx
Definition
parameters.F90:128
parameters::the_box
type(lattice), dimension(:), allocatable, target the_box
Definition
parameters.F90:667
fortran
dvtb.F90
Generated by
1.10.0