LCOV - code coverage report
Current view: top level - types - types_forcetheo.F90 (source / functions) Hit Total Coverage
Test: combined.info Lines: 13 14 92.9 %
Date: 2019-09-08 04:53:50 Functions: 4 5 80.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             : 
       8             : !>This module defines the basic type for calculations of force-theorem type
       9             : !! Here only a dummy is defined that should be extended by a custom made data-type
      10             : !! The functionality is encoded into four functions/subroutines:
      11             : !! start: This routine is called in each SC-loop before the force theorem-loop
      12             : !! next_job: This function returns .true. if another job should be done, it also modifies its
      13             : !!           arguments appropriately to perform the calculation
      14             : !! eval: Here the calculation is done in this function, the results might be stored in
      15             : !!           MODULE variables, IF a .TRUE. is returned, the rest of the loop (charge generation)
      16             : !!           is skipped
      17             : !! postprocess: After the calculation here some IO etc. can be done
      18             : !!
      19             : !!
      20             : !! An example for a non-trivial force-theorem type extending this datatype can be found in
      21             : !! forcetheorem/mae.F90
      22             : 
      23             : MODULE m_types_forcetheo
      24             :   TYPE :: t_forcetheo
      25             :      LOGICAL,PRIVATE :: firstloop
      26             :      LOGICAL :: l_IO
      27             :    CONTAINS
      28             :      PROCEDURE :: start   =>forcetheo_start
      29             :      PROCEDURE :: next_job=>forcetheo_next_job 
      30             :      PROCEDURE :: eval    =>forcetheo_eval
      31             :      PROCEDURE :: postprocess => forcetheo_postprocess
      32             :   END TYPE t_forcetheo
      33             : 
      34             : CONTAINS
      35         340 :   SUBROUTINE forcetheo_start(this,potden,l_io)
      36             :     USE m_types_potden
      37             :     IMPLICIT NONE
      38             :     CLASS(t_forcetheo),INTENT(INOUT):: this
      39             :     TYPE(t_potden) ,INTENT(INOUT)   :: potden
      40             :     LOGICAL,INTENT(IN)              :: l_io
      41         340 :     this%firstloop=.TRUE.
      42         340 :     this%l_io=l_io
      43         340 :   END SUBROUTINE forcetheo_start
      44             : 
      45         662 :   LOGICAL FUNCTION forcetheo_next_job(this,lastiter,atoms,noco)
      46             :     USE m_types_setup
      47             :     IMPLICIT NONE
      48             :     CLASS(t_forcetheo),INTENT(INOUT):: this
      49             :     LOGICAL,INTENT(IN)                  :: lastiter
      50             :     TYPE(t_atoms),INTENT(IN)            :: atoms
      51             :     !Stuff that might be modified...
      52             :     TYPE(t_noco),INTENT(INOUT) :: noco
      53         662 :     forcetheo_next_job=this%firstloop
      54         662 :     this%firstloop=.FALSE.
      55         662 :   END FUNCTION forcetheo_next_job
      56             : 
      57         340 :   FUNCTION forcetheo_eval(this,eig_id,DIMENSION,atoms,kpts,sym,&
      58             :        cell,noco, input,mpi, oneD,enpara,v,results)RESULT(skip)
      59             :     USE m_types_setup
      60             :     USE m_types_mpi
      61             :     USE m_types_potden
      62             :     USE m_types_misc
      63             :     USE m_types_kpts
      64             :     USE m_types_enpara
      65             :     
      66             :     IMPLICIT NONE
      67             :     CLASS(t_forcetheo),INTENT(INOUT):: this
      68             :     LOGICAL :: skip
      69             :     !Stuff that might be used...
      70             :     TYPE(t_mpi),INTENT(IN)         :: mpi
      71             :     TYPE(t_dimension),INTENT(IN)   :: dimension
      72             :     TYPE(t_oneD),INTENT(IN)        :: oneD
      73             :     TYPE(t_input),INTENT(IN)       :: input
      74             :     TYPE(t_noco),INTENT(IN)        :: noco
      75             :     TYPE(t_sym),INTENT(IN)         :: sym
      76             :     TYPE(t_cell),INTENT(IN)        :: cell
      77             :     TYPE(t_kpts),INTENT(IN)        :: kpts
      78             :     TYPE(t_atoms),INTENT(IN)       :: atoms
      79             :     TYPE(t_enpara),INTENT(IN)      :: enpara
      80             :     TYPE(t_potden),INTENT(IN)      :: v
      81             :     TYPE(t_results),INTENT(IN)     :: results
      82             :     INTEGER,INTENT(IN)             :: eig_id
      83         340 :     skip=.FALSE.
      84         340 :   END FUNCTION forcetheo_eval
      85             : 
      86         322 :   SUBROUTINE forcetheo_postprocess(this)
      87             :     IMPLICIT NONE
      88             :     CLASS(t_forcetheo),INTENT(INOUT):: this
      89         322 :   END SUBROUTINE forcetheo_postprocess
      90             : 
      91             :   
      92           0 : END MODULE m_types_forcetheo
      93             : 

Generated by: LCOV version 1.13