-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtlinap.f90
58 lines (44 loc) · 1.38 KB
/
tlinap.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
! The code was developed at the Fritz Haber Institute, and
! the intellectual properties and copyright of this file
! are with the Max Planck Society. When you use it, please
! cite R. Gomez-Abal, X. Li, C. Ambrosch-Draxl, M. Scheffler,
! Extended linear tetrahedron method for the calculation of q-dependent
! dynamical response functions, to be published in Comp. Phys. Commun. (2010)
!BOP
!
! !ROUTINE: tlinap
! !INTERFACE:
real(8) function tlinap(x,f)
! !DESCRIPTION:
!
! This function evalueates a function $f(\vec{x})$ at a given point \verb"x"
! (in internal coordinates) inside the tetrahedron aproximating it linearly
! from the known values of the function at the corners of the tetrahedron
! (\verb"f") using the isoparametrization.
!
! \begin{equation}
! \bar{f}(\vec{x})=f_0+\sum\limits_{i=1}^3{(f_i-f_0)x_i}
! \end{equation}
! !INPUT PARAMETERS:
implicit none
real(8), intent(in) :: x(1:3) ! The coordinates of the point
real(8), intent(in) :: f(1:4) ! The values of the function at the
! corners of the tetrahedron
! !LOCAL VARIABLES:
integer(4) :: i
real(8) :: fx
real(8) :: df
! !REVISION HISTORY:
!
! Created 21st. April 2004 by RGA
!
!EOP
!BOC
fx=f(1)
do i=1,3
df=f(i+1)-f(1)
fx=fx+df*x(i)
enddo
tlinap=fx
end function tlinap
!EOC