From ddb940de48e9b0efd87b9356c9a761d210dd3ed3 Mon Sep 17 00:00:00 2001 From: Pierre-Francois Loos Date: Wed, 25 Mar 2020 12:56:28 +0100 Subject: [PATCH] debug numgrid --- input/basis | 35 ++++++++++++++++++++++++++++------- input/dft | 4 ++-- input/molecule | 4 ++-- input/molecule.xyz | 2 +- input/weight | 35 ++++++++++++++++++++++++++++------- src/eDFT/allocate_grid.f90 | 10 +++------- src/eDFT/build_grid.f90 | 24 ++++++------------------ src/eDFT/eDFT.f90 | 14 +++++++------- src/eDFT/read_grid.f90 | 14 ++++++++------ 9 files changed, 85 insertions(+), 57 deletions(-) diff --git a/input/basis b/input/basis index 6796e3b..1ea2746 100644 --- a/input/basis +++ b/input/basis @@ -1,9 +1,30 @@ -1 3 -S 3 - 1 38.3600000 0.0238090 - 2 5.7700000 0.1548910 - 3 1.2400000 0.4699870 +1 6 +S 8 + 1 2940.0000000 0.0006800 + 2 441.2000000 0.0052360 + 3 100.5000000 0.0266060 + 4 28.4300000 0.0999930 + 5 9.1690000 0.2697020 + 6 3.1960000 0.4514690 + 7 1.1590000 0.2950740 + 8 0.1811000 0.0125870 +S 8 + 1 2940.0000000 -0.0001230 + 2 441.2000000 -0.0009660 + 3 100.5000000 -0.0048310 + 4 28.4300000 -0.0193140 + 5 9.1690000 -0.0532800 + 6 3.1960000 -0.1207230 + 7 1.1590000 -0.1334350 + 8 0.1811000 0.5307670 S 1 - 1 0.2976000 1.0000000 + 1 0.0589000 1.0000000 +P 3 + 1 3.6190000 0.0291110 + 2 0.7110000 0.1693650 + 3 0.1951000 0.5134580 P 1 - 1 1.2750000 1.0000000 + 1 0.0601800 1.0000000 +D 1 + 1 0.2380000 1.0000000 + diff --git a/input/dft b/input/dft index 86fa632..bc4839a 100644 --- a/input/dft +++ b/input/dft @@ -13,7 +13,7 @@ # GGA = 2: # Hybrid = 4: # Hartree-Fock = 666 - 1 RMFL20 + 1 RVWN5 # quadrature grid SG-n 1 # Number of states in ensemble (nEns) @@ -21,4 +21,4 @@ # Ensemble weights: wEns(1),...,wEns(nEns-1) 0.50000 0.00000 # GOK-DFT: maxSCF thresh DIIS n_diis guess_type ortho_type - 32 0.0000001 T 5 1 1 + 32 0.00001 T 5 1 1 diff --git a/input/molecule b/input/molecule index c78e87e..6a6f6d1 100644 --- a/input/molecule +++ b/input/molecule @@ -1,4 +1,4 @@ # nAt nEla nElb nCore nRyd - 1 1 1 0 0 + 1 2 2 0 0 # Znuc x y z - He 0.0 0.0 0.0 + Be 0.0 0.0 0.0 diff --git a/input/molecule.xyz b/input/molecule.xyz index 797b5fc..8023e37 100644 --- a/input/molecule.xyz +++ b/input/molecule.xyz @@ -1,3 +1,3 @@ 1 - He 0.0000000000 0.0000000000 0.0000000000 + Be 0.0000000000 0.0000000000 0.0000000000 diff --git a/input/weight b/input/weight index 6796e3b..1ea2746 100644 --- a/input/weight +++ b/input/weight @@ -1,9 +1,30 @@ -1 3 -S 3 - 1 38.3600000 0.0238090 - 2 5.7700000 0.1548910 - 3 1.2400000 0.4699870 +1 6 +S 8 + 1 2940.0000000 0.0006800 + 2 441.2000000 0.0052360 + 3 100.5000000 0.0266060 + 4 28.4300000 0.0999930 + 5 9.1690000 0.2697020 + 6 3.1960000 0.4514690 + 7 1.1590000 0.2950740 + 8 0.1811000 0.0125870 +S 8 + 1 2940.0000000 -0.0001230 + 2 441.2000000 -0.0009660 + 3 100.5000000 -0.0048310 + 4 28.4300000 -0.0193140 + 5 9.1690000 -0.0532800 + 6 3.1960000 -0.1207230 + 7 1.1590000 -0.1334350 + 8 0.1811000 0.5307670 S 1 - 1 0.2976000 1.0000000 + 1 0.0589000 1.0000000 +P 3 + 1 3.6190000 0.0291110 + 2 0.7110000 0.1693650 + 3 0.1951000 0.5134580 P 1 - 1 1.2750000 1.0000000 + 1 0.0601800 1.0000000 +D 1 + 1 0.2380000 1.0000000 + diff --git a/src/eDFT/allocate_grid.f90 b/src/eDFT/allocate_grid.f90 index e305989..8dd7330 100644 --- a/src/eDFT/allocate_grid.f90 +++ b/src/eDFT/allocate_grid.f90 @@ -53,13 +53,9 @@ subroutine allocate_grid(nNuc,ZNuc,rNuc,nShell,TotAngMomShell,ExpShell,max_ang_m do iNuc=1,nNuc - context = numgrid_new_atom_grid(radial_precision, & - min_num_angular_points, & - max_num_angular_points, & - int(ZNuc(iNuc)), & - max_exponent(iNuc), & - max_ang_mom(iNuc), & - min_exponent(iNuc,:) ) + context = numgrid_new_atom_grid(radial_precision,min_num_angular_points,max_num_angular_points, & + int(ZNuc(iNuc)),max_exponent(iNuc),max_ang_mom(iNuc), & + min_exponent(iNuc,1:max_ang_mom(iNuc)+1)) nGrid = nGrid + numgrid_get_num_grid_points(context) diff --git a/src/eDFT/build_grid.f90 b/src/eDFT/build_grid.f90 index be6e833..046fb90 100644 --- a/src/eDFT/build_grid.f90 +++ b/src/eDFT/build_grid.f90 @@ -58,28 +58,16 @@ subroutine build_grid(nNuc,ZNuc,rNuc,nShell,TotAngMomShell,ExpShell,max_ang_mom, do iNuc=1,nNuc - context = numgrid_new_atom_grid(radial_precision, & - min_num_angular_points, & - max_num_angular_points, & - int(ZNuc(iNuc)), & - max_exponent(iNuc), & - max_ang_mom(iNuc), & - min_exponent(iNuc,:) ) + context = numgrid_new_atom_grid(radial_precision,min_num_angular_points,max_num_angular_points, & + int(ZNuc(iNuc)),max_exponent(iNuc),max_ang_mom(iNuc), & + min_exponent(iNuc,1:max_ang_mom(iNuc)+1)) center_index = iNuc - 1 num_points = numgrid_get_num_grid_points(context) - call numgrid_get_grid(context, & - nNuc, & - center_index, & - rNuc(:,1), & - rNuc(:,2), & - rNuc(:,3), & - int(ZNuc(:)), & - root(1,iG+1:num_points), & - root(2,iG+1:num_points), & - root(3,iG+1:num_points), & - weight(iG+1:num_points) ) + call numgrid_get_grid(context,nNuc,center_index,rNuc(:,1),rNuc(:,2),rNuc(:,3),int(ZNuc(:)), & + root(1,iG+1:num_points),root(2,iG+1:num_points),root(3,iG+1:num_points), & + weight(iG+1:num_points)) iG = iG + num_points diff --git a/src/eDFT/eDFT.f90 b/src/eDFT/eDFT.f90 index 8c52454..8c9a84d 100644 --- a/src/eDFT/eDFT.f90 +++ b/src/eDFT/eDFT.f90 @@ -133,18 +133,18 @@ program eDFT !------------------------------------------------------------------------ ! Construct quadrature grid !------------------------------------------------------------------------ - call read_grid(SGn,nRad,nAng,nGrid) - radial_precision = 1d-7 + call read_grid(SGn,radial_precision,nRad,nAng,nGrid) + nGrid = nRad*nAng - call allocate_grid(nNuc,ZNuc,rNuc,nShell,TotAngMomShell,ExpShell,max_ang_mom,min_exponent,max_exponent, & - radial_precision,nRad,nAng,nGrid) +! call allocate_grid(nNuc,ZNuc,rNuc,nShell,TotAngMomShell,ExpShell,max_ang_mom,min_exponent,max_exponent, & +! radial_precision,nRad,nAng,nGrid) allocate(root(ncart,nGrid),weight(nGrid)) - call build_grid(nNuc,ZNuc,rNuc,nShell,TotAngMomShell,ExpShell,max_ang_mom,min_exponent,max_exponent, & - radial_precision,nRad,nAng,nGrid,weight,root) + call quadrature_grid(nRad,nAng,nGrid,root,weight) -! call quadrature_grid(nRad,nAng,nGrid,root,weight) +! call build_grid(nNuc,ZNuc,rNuc,nShell,TotAngMomShell,ExpShell,max_ang_mom,min_exponent,max_exponent, & +! radial_precision,nRad,nAng,nGrid,weight,root) !------------------------------------------------------------------------ ! Calculate AO values at grid points diff --git a/src/eDFT/read_grid.f90 b/src/eDFT/read_grid.f90 index 5cf4391..615d837 100644 --- a/src/eDFT/read_grid.f90 +++ b/src/eDFT/read_grid.f90 @@ -1,4 +1,4 @@ -subroutine read_grid(SGn,nRad,nAng,nGrid) +subroutine read_grid(SGn,radial_precision,nRad,nAng) ! Read grid type @@ -10,9 +10,9 @@ subroutine read_grid(SGn,nRad,nAng,nGrid) ! Output variables + double precision,intent(out) :: radial_precision integer,intent(out) :: nRad integer,intent(out) :: nAng - integer,intent(out) :: nGrid write(*,*)'----------------------------------------------------------' write(*,'(A22,I1)')' Quadrature grid: SG-',SGn @@ -21,18 +21,22 @@ subroutine read_grid(SGn,nRad,nAng,nGrid) select case (SGn) case(0) - nRad = 23 - nAng = 170 + radial_precision = 1d-5 + nRad = 23 + nAng = 170 case(1) + radial_precision = 1d-7 nRad = 50 nAng = 194 case(2) + radial_precision = 1d-9 nRad = 75 nAng = 302 case(3) + radial_precision = 1d-11 nRad = 99 nAng = 590 @@ -42,6 +46,4 @@ subroutine read_grid(SGn,nRad,nAng,nGrid) end select - nGrid = nRad*nAng - end subroutine read_grid