mirror of
https://github.com/TREX-CoE/irpjast.git
synced 2024-08-25 06:31:46 +02:00
Jen gradient and laplacian working!
This commit is contained in:
parent
952c6696a5
commit
bcc68c6e81
31
nuclei.irp.f
31
nuclei.irp.f
@ -88,10 +88,12 @@ BEGIN_PROVIDER [double precision, factor_en_deriv_e, (4, nelec) ]
|
|||||||
! Dimension 4 : d2x + d2y + d2z
|
! Dimension 4 : d2x + d2y + d2z
|
||||||
END_DOC
|
END_DOC
|
||||||
integer :: i, ii, a, p, q
|
integer :: i, ii, a, p, q
|
||||||
double precision :: x, x_inv, y, den, invden, lap1, lap2
|
double precision :: x, x_inv, y, den, invden, lap1, lap2, lap3, third
|
||||||
double precision, dimension(4) :: dx, pow_ser_g
|
double precision, dimension(3) :: pow_ser_g
|
||||||
|
double precision, dimension(4) :: dx
|
||||||
|
|
||||||
factor_en_deriv_e = 0.0d0
|
factor_en_deriv_e = 0.0d0
|
||||||
|
third = 1.0d0 / 3.0d0
|
||||||
|
|
||||||
do a = 1 , nnuc
|
do a = 1 , nnuc
|
||||||
do i = 1, nelec
|
do i = 1, nelec
|
||||||
@ -105,29 +107,34 @@ BEGIN_PROVIDER [double precision, factor_en_deriv_e, (4, nelec) ]
|
|||||||
|
|
||||||
lap1 = 0.0d0
|
lap1 = 0.0d0
|
||||||
lap2 = 0.0d0
|
lap2 = 0.0d0
|
||||||
|
lap3 = 0.0d0
|
||||||
do ii = 1, 3
|
do ii = 1, 3
|
||||||
x = rescale_en(i, a)
|
x = rescale_en(i, a)
|
||||||
x_inv = 1.0d0 / x
|
x_inv = 1.0d0 / x
|
||||||
do p = 2, naord
|
do p = 2, naord
|
||||||
pow_ser_g(ii) += p * aord_vect(p + 1, typenuc_arr(a)) * x * dx(ii)
|
! p a_{p+1} r[i,a]^(p-1)
|
||||||
pow_ser_g(4) += p * (p - 1) * aord_vect(p + 1, typenuc_arr(a)) * x * x_inv * dx(ii) * dx(ii)
|
y = p * aord_vect(p + 1, typenuc_arr(a)) * x
|
||||||
lap2 += p * aord_vect(p + 1, typenuc_arr(a)) * x
|
pow_ser_g(ii) += y * dx(ii)
|
||||||
x = x * rescale_en(i, a)
|
! (p-1) p a_{p+1} r[i,a]^(p-2) r'[i,a]^2
|
||||||
|
lap1 += (p - 1) * y * x_inv * dx(ii) * dx(ii)
|
||||||
|
! p a_{p+1} r[i,a]^(p-1) r''[i,a]
|
||||||
|
lap2 += y
|
||||||
|
x = x * rescale_en(i, a)
|
||||||
end do
|
end do
|
||||||
|
|
||||||
! (a1 (-2 a2 r'[i,a]^2+(1+a2 r[i,a]) r''[i,a]))/(1+a2 r[i,a])^3
|
! (a1 (-2 a2 r'[i,a]^2+(1+a2 r[i,a]) r''[i,a]))/(1+a2 r[i,a])^3
|
||||||
lap1 += -2.0d0 * aord_vect(2, typenuc_arr(a)) * dx(ii) * dx(ii)
|
lap3 += -2.0d0 * aord_vect(2, typenuc_arr(a)) * dx(ii) * dx(ii)
|
||||||
|
|
||||||
! \frac{\text{a1} r'(i,a)}{(\text{a2} r(i,a)+1)^2}
|
! \frac{a1 * r'(i,a)}{(a2 * r(i,a)+1)^2}
|
||||||
factor_en_deriv_e(ii, i) += aord_vect(1, typenuc_arr(a)) &
|
factor_en_deriv_e(ii, i) += aord_vect(1, typenuc_arr(a)) &
|
||||||
* dx(ii) * invden * invden + pow_ser_g(ii)
|
* dx(ii) * invden * invden + pow_ser_g(ii)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
ii = 4
|
ii = 4
|
||||||
lap1 += den * dx(ii)
|
lap2 *= dx(ii) * third
|
||||||
lap1 = lap1 * aord_vect(1, typenuc_arr(a)) * invden * invden * invden
|
lap3 += den * dx(ii)
|
||||||
pow_ser_g(ii) += lap1 + lap2 * dx(ii)
|
lap3 = lap3 * aord_vect(1, typenuc_arr(a)) * invden * invden * invden
|
||||||
factor_en_deriv_e(ii, i) += pow_ser_g(ii)
|
factor_en_deriv_e(ii, i) += lap1 + lap2 + lap3
|
||||||
|
|
||||||
end do
|
end do
|
||||||
end do
|
end do
|
||||||
|
@ -28,6 +28,32 @@ BEGIN_PROVIDER [ double precision, rescale_ee, (nelec, nelec) ]
|
|||||||
enddo
|
enddo
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
|
BEGIN_PROVIDER [ double precision, rescale_ee_deriv_e, (4, nelec, nelec) ]
|
||||||
|
implicit none
|
||||||
|
BEGIN_DOC
|
||||||
|
! R = (1 - exp(-kappa r))/kappa derived wrt x
|
||||||
|
! Dimensions 1-3 : dx, dy, dz
|
||||||
|
! Dimension 4 : d2x + d2y + d2z
|
||||||
|
END_DOC
|
||||||
|
integer :: i, j, ii
|
||||||
|
|
||||||
|
do j = 1, nelec
|
||||||
|
do i = 1, nelec
|
||||||
|
do ii = 1, 4
|
||||||
|
rescale_ee_deriv_e(ii, i, j) = elec_dist_deriv_e(ii, i, j)
|
||||||
|
end do
|
||||||
|
rescale_ee_deriv_e(4, i, j) = rescale_ee_deriv_e(4, i, j) + &
|
||||||
|
(-kappa * rescale_ee_deriv_e(1, i, j) * rescale_ee_deriv_e(1, i, j)) + &
|
||||||
|
(-kappa * rescale_ee_deriv_e(2, i, j) * rescale_ee_deriv_e(2, i, j)) + &
|
||||||
|
(-kappa * rescale_ee_deriv_e(3, i, j) * rescale_ee_deriv_e(3, i, j))
|
||||||
|
do ii = 1, 4
|
||||||
|
rescale_ee_deriv_e(ii, i, j) = rescale_ee_deriv_e(ii, i, j) &
|
||||||
|
* dexp(-kappa * elec_dist(i, j))
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [ double precision, rescale_en, (nelec, nnuc) ]
|
BEGIN_PROVIDER [ double precision, rescale_en, (nelec, nnuc) ]
|
||||||
implicit none
|
implicit none
|
||||||
BEGIN_DOC
|
BEGIN_DOC
|
||||||
@ -66,7 +92,6 @@ BEGIN_PROVIDER [ double precision, rescale_en_deriv_e, (4, nelec, nnuc) ]
|
|||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
END_PROVIDER
|
END_PROVIDER
|
||||||
|
|
||||||
BEGIN_PROVIDER [double precision, rescale_een_e, (nelec, nelec, 0:ncord)]
|
BEGIN_PROVIDER [double precision, rescale_een_e, (nelec, nelec, 0:ncord)]
|
||||||
|
Loading…
Reference in New Issue
Block a user