eplf/src/gradients.irp.f

36 lines
667 B
FortranFixed
Raw Permalink Normal View History

2009-12-09 23:28:19 +01:00
BEGIN_TEMPLATE
2009-11-06 00:27:24 +01:00
BEGIN_PROVIDER [ real, $X_grad_p, (3) ]
&BEGIN_PROVIDER [ real, $X_lapl_p ]
implicit none
BEGIN_DOC
! Gradient and Laplacian of the EPLF at the current point.
END_DOC
real, parameter :: Delta=0.001
integer :: l
$X_lapl_p = -6.*$X_value_p
do l=1,3
point(l) = point(l)+Delta
TOUCH point
$X_grad_p(l) = $X_value_p
$X_lapl_p = $X_lapl_p + $X_value_p
point(l) = point(l)-Delta-Delta
TOUCH point
$X_grad_p(l) = 0.5*($X_grad_p(l) - $X_value_p)/Delta
$X_lapl_p = $X_lapl_p + $X_value_p
point(l) = point(l) + Delta
enddo
$X_lapl_p = $X_lapl_p/Delta**2
TOUCH point
END_PROVIDER
2009-12-09 23:28:19 +01:00
SUBST [ X ]
eplf;;
elf;;
2009-11-06 00:27:24 +01:00
2009-12-09 23:28:19 +01:00
END_TEMPLATE