od_chisym.f 3.5 KB
Newer Older
1 2 3 4 5 6
!--------------------------------------------------------------------------------
! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
! This file is part of FLEUR and available as free software under the conditions
! of the MIT license as expressed in the LICENSE file in more detail.
!--------------------------------------------------------------------------------

7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
      MODULE m_od_chisym
      use m_juDFT
c*************************************************************
c     establishes the rotational matrices and translational
c     vectors in the case of one-dimensional calculations
c     according to the one-dimensional group of symmetries
c                           Y.Mokrousov 2003
c**********************************************
c     CHIRAL SYMMETRY GROUP
c     The main feature is that this group, been represented in 3D space,
c     is cyclic, with the generator <psi|tau> been simultaneous rotation
c     of the system by angle psi around z-axis and translation by tau 
c     along z-direction. The input parameters, given to the program, are:
c          - M (odd%rot)
c          - N (odd%chi),
c     where N is the number of operations in the symmetry group, so that
c     psi = 2pi/N and M is some integer:tau = M/N in the internal units.
      
      CONTAINS
      SUBROUTINE od_chisym(odd,mrot,tau,zrfs,invs,invs2,amat)

      USE m_constants, ONLY : tpi_const
      USE m_types, ONLY : od_dim
      
      IMPLICIT NONE

      TYPE (od_dim), INTENT (IN) :: odd
      REAL, INTENT (IN) :: amat(3,3)
      LOGICAL, INTENT (IN) :: zrfs,invs,invs2
      REAL, INTENT (OUT) :: mrot(3,3,odd%nop),tau(3,odd%nop)      

      INTEGER n,j,i,half
   
      tau(:,:) = 0.
      mrot(1:3,1:3,1:odd%nop) = 0.
      mrot(3,3,:) = 1.
      mrot(1,1,1) = 1.
      mrot(2,2,1) = 1.

      IF (.NOT.odd%invs .AND. .NOT.odd%zrfs) THEN
c for systems without z-reflection and inversion symmetries
        DO n = 2,odd%nop
         mrot(1,1,n) =  cos(tpi_const*(n-1)/odd%nop)
         mrot(1,2,n) =  sin(tpi_const*(n-1)/odd%nop)
         mrot(2,1,n) = -sin(tpi_const*(n-1)/odd%nop)
         mrot(2,2,n) =  cos(tpi_const*(n-1)/odd%nop)
         IF (odd%chi.NE.1) THEN
            tau(3,n) = tau(3,n-1) +
     +           amat(3,3)*(odd%rot)/(odd%chi)
            IF (abs(tau(3,n)-amat(3,3)).LE.1.e-4) THEN
               tau(3,n) = 0.
            ELSEIF (tau(3,n)-amat(3,3).GT.1.e-4) THEN
               tau(3,n) = tau(3,n) - amat(3,3)
            END IF   
         END IF
        END DO
c for systems with inversion or z-relection symmetries
      ELSE
         half = NINT((odd%nop)/2.)
         IF ((odd%nop)/2. - half > 0.001) THEN
            CALL juDFT_error("nop =/= 2*n & (invs v zrfs) !",calledby
     +           ="od_chisym")
         ENDIF
         DO n = 2,half
            mrot(1,1,n) =  cos(tpi_const*(n-1)/half)
            mrot(1,2,n) =  sin(tpi_const*(n-1)/half)
            mrot(2,1,n) = -sin(tpi_const*(n-1)/half)
            mrot(2,2,n) =  cos(tpi_const*(n-1)/half)
         END DO 
         IF (odd%zrfs) THEN
            mrot(1,1,half+1) =  1.
            mrot(2,2,half+1) =  1.
            mrot(3,3,half+1) = -1. 
         ELSE IF (odd%invs) THEN
            mrot(1,1,half+1) = -1.
            mrot(2,2,half+1) = -1.
            mrot(3,3,half+1) = -1.
         END IF
         DO n = 2,half
           !CALL matmul3r(mrot(:,:,n),mrot(:,:,half+1),mrot(:,:,half+n))
           mrot(:,:,half+n)=matmul(mrot(:,:,n),mrot(:,:,half+1))
         END DO
      END IF
      RETURN
      END SUBROUTINE od_chisym
      END MODULE m_od_chisym