LCOV - code coverage report
Current view: top level - src/aobasis - ai_overlap_debug.F (source / functions) Hit Total Coverage
Test: CP2K Regtests (git:4dc10b3) Lines: 29 30 96.7 %
Date: 2024-11-21 06:45:46 Functions: 2 2 100.0 %

          Line data    Source code
       1             : !--------------------------------------------------------------------------------------------------!
       2             : !   CP2K: A general program to perform molecular dynamics simulations                              !
       3             : !   Copyright 2000-2024 CP2K developers group <https://cp2k.org>                                   !
       4             : !                                                                                                  !
       5             : !   SPDX-License-Identifier: GPL-2.0-or-later                                                      !
       6             : !--------------------------------------------------------------------------------------------------!
       7             : 
       8             : ! **************************************************************************************************
       9             : !> \brief Two-center overlap integrals over Cartesian Gaussian-type functions
      10             : !> \par Literature
      11             : !>      S. Obara and A. Saika, J. Chem. Phys. 84, 3963 (1986)
      12             : !> \par History
      13             : !>      none
      14             : !> \author Dorothea Golze
      15             : ! **************************************************************************************************
      16             : MODULE ai_overlap_debug
      17             : 
      18             :    USE kinds,                           ONLY: dp
      19             :    USE mathconstants,                   ONLY: pi
      20             : #include "../base/base_uses.f90"
      21             : 
      22             :    IMPLICIT NONE
      23             : 
      24             :    CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ai_overlap_debug'
      25             : 
      26             :    INTEGER, PARAMETER            :: lmax = 5
      27             : 
      28             :    REAL(dp)                      :: xa, xb
      29             :    REAL(dp), DIMENSION(3)        :: A, B
      30             :    REAL(dp), DIMENSION(3)        :: P
      31             :    REAL(dp)                      :: xsi, zeta, ss
      32             : 
      33             :    PRIVATE
      34             :    PUBLIC :: init_os_overlap2, os_overlap2
      35             : 
      36             : CONTAINS
      37             : 
      38             : ! **************************************************************************************************
      39             : !> \brief   Calculation of overlap integrals over
      40             : !>          Cartesian Gaussian-type functions.
      41             : !> \param ya ...
      42             : !> \param yb ...
      43             : !> \param rA ...
      44             : !> \param rB ...
      45             : ! **************************************************************************************************
      46        7298 :    SUBROUTINE init_os_overlap2(ya, yb, rA, rB)
      47             :       REAL(dp)                                           :: ya, yb
      48             :       REAL(dp), DIMENSION(3)                             :: rA, rB
      49             : 
      50        7298 :       xa = ya
      51        7298 :       xb = yb
      52        7298 :       A = rA
      53        7298 :       B = rB
      54             : 
      55        7298 :       xsi = xa + xb
      56        7298 :       zeta = xa*xb/xsi
      57             : 
      58       29192 :       P = (xa*A + xb*B)/xsi
      59             : 
      60       29192 :       ss = (pi/xsi)**(3._dp/2._dp)*EXP(-zeta*SUM((A - B)**2))
      61             : 
      62        7298 :    END SUBROUTINE init_os_overlap2
      63             : 
      64             : ! **************************************************************************************************
      65             : 
      66             : ! **************************************************************************************************
      67             : !> \brief ...
      68             : !> \param an ...
      69             : !> \param bn ...
      70             : !> \return ...
      71             : ! **************************************************************************************************
      72    16156411 :    RECURSIVE FUNCTION os_overlap2(an, bn) RESULT(IAB)
      73             :       INTEGER, DIMENSION(3)                              :: an, bn
      74             :       REAL(dp)                                           :: IAB
      75             : 
      76             :       INTEGER, DIMENSION(3), PARAMETER                   :: i1 = (/1, 0, 0/), i2 = (/0, 1, 0/), &
      77             :                                                             i3 = (/0, 0, 1/)
      78             : 
      79    16156411 :       IAB = 0._dp
      80    55939752 :       IF (ANY(an < 0)) RETURN
      81    46582512 :       IF (ANY(bn < 0)) RETURN
      82             : 
      83    46582512 :       IF (SUM(an + bn) == 0) THEN
      84     3929876 :          IAB = ss
      85     3929876 :          RETURN
      86             :       END IF
      87             : 
      88     7715752 :       IF (bn(1) > 0) THEN
      89     4352220 :          IAB = os_overlap2(an + i1, bn - i1) + (A(1) - B(1))*os_overlap2(an, bn - i1)
      90     7280530 :       ELSEIF (bn(2) > 0) THEN
      91     5079950 :          IAB = os_overlap2(an + i2, bn - i2) + (A(2) - B(2))*os_overlap2(an, bn - i2)
      92     6772535 :       ELSEIF (bn(3) > 0) THEN
      93     5808300 :          IAB = os_overlap2(an + i3, bn - i3) + (A(3) - B(3))*os_overlap2(an, bn - i3)
      94             :       ELSE
      95     6191705 :          IF (an(1) > 0) THEN
      96             :             IAB = (P(1) - A(1))*os_overlap2(an - i1, bn) + &
      97    13117405 :                   0.5_dp*(an(1) - 1)/xsi*os_overlap2(an - i1 - i1, bn)
      98     4317790 :          ELSEIF (an(2) > 0) THEN
      99             :             IAB = (P(2) - A(2))*os_overlap2(an - i2, bn) + &
     100    14447048 :                   0.5_dp*(an(2) - 1)/xsi*os_overlap2(an - i2 - i2, bn)
     101     2253926 :          ELSEIF (an(3) > 0) THEN
     102             :             IAB = (P(3) - A(3))*os_overlap2(an - i3, bn) + &
     103    15777482 :                   0.5_dp*(an(3) - 1)/xsi*os_overlap2(an - i3 - i3, bn)
     104             :          ELSE
     105           0 :             CPABORT("I(0000)")
     106             :          END IF
     107             :       END IF
     108             : 
     109             :    END FUNCTION os_overlap2
     110             : 
     111             : ! **************************************************************************************************
     112             : 
     113             : END MODULE ai_overlap_debug

Generated by: LCOV version 1.15