LCOV - code coverage report
Current view: top level - mix - stdmix.f90 (source / functions) Hit Total Coverage
Test: FLEUR test coverage Lines: 0 4 0.0 %
Date: 2024-04-25 04:21:55 Functions: 0 1 0.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------
       2             : ! Copyright (c) 2016 Peter Grünberg Institut, Forschungszentrum Jülich, Germany
       3             : ! This file is part of FLEUR and available as free software under the conditions
       4             : ! of the MIT license as expressed in the LICENSE file in more detail.
       5             : !--------------------------------------------------------------------------------
       6             : 
       7             : MODULE m_stmix
       8             :   !! Simple or straight mixing
       9             :   
      10             : CONTAINS
      11           0 :   SUBROUTINE stmix(atoms,input,noco,fsm,fsm_mag,sm)
      12             :     !!Simple mixing
      13             :     USE m_types_mixvector
      14             :     USE m_types
      15             :     IMPLICIT NONE
      16             :     TYPE(t_input),INTENT(IN)        :: input  
      17             :     TYPE(t_noco),INTENT(IN)         :: noco
      18             :     TYPE(t_atoms),INTENT(IN)        :: atoms
      19             :     TYPE(t_mixvector),INTENT(IN)    :: fsm !!Difference of input and output density
      20             :     TYPE(t_mixvector),INTENT(IN)    :: fsm_mag !!Difference of input and output magnetisation
      21             :     TYPE(t_mixvector),INTENT(INOUT) :: sm          !!input: input-density, output: mixed density 
      22             :     !     ..
      23             :     !     .. Local Scalars ..
      24             :     REAL,PARAMETER:: tol_6=1.0e-6
      25             :     !     ..
      26             :     !
      27           0 :     sm = sm + input%alpha*fsm
      28             : 
      29           0 :     IF ( ABS(input%spinf-1.0).LE.tol_6 .OR. input%jspins.EQ.1 .or.input%imix.ne.0.or.noco%l_noco) RETURN
      30             :     !  Done with     sm1 = sm + alpha * F(sm)
      31             :     
      32             :     
      33             :     !Spin enhancement factor
      34           0 :     sm = sm + input%alpha/2.0*(input%spinf-1.0)*fsm_mag
      35             :        !     -->perform simple mixing with the mixing parameters
      36             :        !        for charge and spin
      37             :        !
      38             :        !       sm1+/_ = (sm+/_) + alpha* F(sm)
      39             :        !                +/-0.5alpha(spinf-1)( F(sm+) + F(sm-) )
      40             :        ! The F(sm+) and F(sm-) terms do not only include diagonal elements of the density matrices (as one could think) 
      41             :        ! but also contain off-diag. elements (jspins=3,4) of the density matrices in the fully noncolinear case. 
      42             :        ! Choosing a spinf>1 therefore might be helpful when it comes to converging noncolinear systems.
      43             :        ! DW: Actually for noco, this spinf>1 has the potential to break symmetry in the noco case, hence it is disabled. 
      44             :    
      45             :   END SUBROUTINE stmix
      46             : END MODULE m_stmix

Generated by: LCOV version 1.14