From 04f1b38b5f7352b76977e98b7cb0ac3da180de85 Mon Sep 17 00:00:00 2001 From: Abdallah Ammar Date: Sat, 24 Aug 2024 14:52:35 +0200 Subject: [PATCH] added Torus param --- src/ao_basis/torus.irp.f | 33 +++++++++++++ src/ao_one_e_ints/aos_torus.irp.f | 82 +++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 src/ao_basis/torus.irp.f create mode 100644 src/ao_one_e_ints/aos_torus.irp.f diff --git a/src/ao_basis/torus.irp.f b/src/ao_basis/torus.irp.f new file mode 100644 index 00000000..ec244a94 --- /dev/null +++ b/src/ao_basis/torus.irp.f @@ -0,0 +1,33 @@ +BEGIN_PROVIDER [ logical, do_torus ] + implicit none + BEGIN_DOC +! If true, use Torus integrals for AO integrals + END_DOC + + logical :: has + PROVIDE ezfio_filename + do_torus = .False. + if (mpi_master) then + call ezfio_has_ao_basis_do_torus(has) + if (has) then + call ezfio_get_ao_basis_do_torus(do_torus) + else + call ezfio_set_ao_basis_do_torus(do_torus) + endif + endif + IRP_IF MPI_DEBUG + print *, irp_here, mpi_rank + call MPI_BARRIER(MPI_COMM_WORLD, ierr) + IRP_ENDIF + IRP_IF MPI + include 'mpif.h' + integer :: ierr + call MPI_BCAST( do_tors, 1, MPI_LOGICAL, 0, MPI_COMM_WORLD, ierr) + if (ierr /= MPI_SUCCESS) then + stop 'Unable to read do_torus with MPI' + endif + IRP_ENDIF + +! call write_time(6) + +END_PROVIDER diff --git a/src/ao_one_e_ints/aos_torus.irp.f b/src/ao_one_e_ints/aos_torus.irp.f new file mode 100644 index 00000000..96918154 --- /dev/null +++ b/src/ao_one_e_ints/aos_torus.irp.f @@ -0,0 +1,82 @@ + +! --- + + BEGIN_PROVIDER [ double precision, ao_overlap_torus , (ao_num, ao_num) ] +&BEGIN_PROVIDER [ double precision, ao_overlap_torus_x, (ao_num, ao_num) ] +&BEGIN_PROVIDER [ double precision, ao_overlap_torus_y, (ao_num, ao_num) ] +&BEGIN_PROVIDER [ double precision, ao_overlap_torus_z, (ao_num, ao_num) ] + + BEGIN_DOC + ! Overlap between atomic basis functions: + ! + ! TODO + ! + ! :math:`\int \chi_i(r) \chi_j(r) dr` + END_DOC + + implicit none + integer :: i, j, n, l, dim1, power_A(3), power_B(3) + double precision :: overlap, overlap_x, overlap_y, overlap_z + double precision :: alpha, beta, c + double precision :: A_center(3), B_center(3) + + PROVIDE torus_length + print*, ' torus Lx = ', torus_length(1) + print*, ' torus Ly = ', torus_length(2) + print*, ' torus Lz = ', torus_length(3) + + ao_overlap_torus = 0.d0 + ao_overlap_torus_x = 0.d0 + ao_overlap_torus_y = 0.d0 + ao_overlap_torus_z = 0.d0 + +! dim1=100 +! !$OMP PARALLEL DO SCHEDULE(GUIDED) & +! !$OMP DEFAULT(NONE) & +! !$OMP PRIVATE(A_center,B_center,power_A,power_B,& +! !$OMP overlap_x,overlap_y, overlap_z, overlap, & +! !$OMP alpha, beta,i,j,c) & +! !$OMP SHARED(nucl_coord,ao_power,ao_prim_num, & +! !$OMP ao_overlap_x,ao_overlap_y,ao_overlap_z,ao_overlap,ao_num,ao_coef_normalized_ordered_transp,ao_nucl, & +! !$OMP ao_expo_ordered_transp,dim1) +! do j=1,ao_num +! A_center(1) = nucl_coord( ao_nucl(j), 1 ) +! A_center(2) = nucl_coord( ao_nucl(j), 2 ) +! A_center(3) = nucl_coord( ao_nucl(j), 3 ) +! power_A(1) = ao_power( j, 1 ) +! power_A(2) = ao_power( j, 2 ) +! power_A(3) = ao_power( j, 3 ) +! do i= 1,ao_num +! B_center(1) = nucl_coord( ao_nucl(i), 1 ) +! B_center(2) = nucl_coord( ao_nucl(i), 2 ) +! B_center(3) = nucl_coord( ao_nucl(i), 3 ) +! power_B(1) = ao_power( i, 1 ) +! power_B(2) = ao_power( i, 2 ) +! power_B(3) = ao_power( i, 3 ) +! do n = 1,ao_prim_num(j) +! alpha = ao_expo_ordered_transp(n,j) +! do l = 1, ao_prim_num(i) +! beta = ao_expo_ordered_transp(l,i) +! call overlap_gaussian_xyz(A_center,B_center,alpha,beta,power_A,power_B,overlap_x,overlap_y,overlap_z,overlap,dim1) +! c = ao_coef_normalized_ordered_transp(n,j) * ao_coef_normalized_ordered_transp(l,i) +! ao_overlap(i,j) += c * overlap +! if(isnan(ao_overlap(i,j)))then +! print*,'i,j',i,j +! print*,'l,n',l,n +! print*,'c,overlap',c,overlap +! print*,overlap_x,overlap_y,overlap_z +! stop +! endif +! ao_overlap_x(i,j) += c * overlap_x +! ao_overlap_y(i,j) += c * overlap_y +! ao_overlap_z(i,j) += c * overlap_z +! enddo +! enddo +! enddo +! enddo +! !$OMP END PARALLEL DO + +END_PROVIDER + +! --- +