The Elk Code
Loading...
Searching...
No Matches
stheta_sq.f90
Go to the documentation of this file.
1
2
! Copyright (C) 2008 J. K. Dewhurst, S. Sharma and C. Ambrosch-Draxl.
3
! This file is distributed under the terms of the GNU Lesser General Public
4
! License. See the file COPYING for license details.
5
6
!BOP
7
! !ROUTINE: stheta_sq
8
! !INTERFACE:
9
elemental
real(8)
function
stheta_sq
(x)
10
! !INPUT/OUTPUT PARAMETERS:
11
! x : real argument (in,real)
12
! !DESCRIPTION:
13
! Returns the Heaviside step function corresponding to the square-wave pulse
14
! approximation to the Dirac delta function
15
! $$ \tilde\Theta(x)=\left\{\begin{array}{ll}
16
! 0 & \quad x \le -1/2 \\
17
! x+1/2 & \quad -1/2 < x < 1/2 \\
18
! 1 & \quad x\ge 1 \end{array}\right. $$
19
!
20
! !REVISION HISTORY:
21
! Created July 2008 (JKD)
22
!EOP
23
!BOC
24
implicit none
25
! arguments
26
real
(8),
intent(in)
:: x
27
if
(x <= -0.5d0)
then
28
stheta_sq
=0.d0
29
return
30
end if
31
if
(x < 0.5d0)
then
32
stheta_sq
=x+0.5d0
33
else
34
stheta_sq
=1.d0
35
end if
36
end function
37
!EOC
38
stheta_sq
elemental real(8) function stheta_sq(x)
Definition
stheta_sq.f90:10
stheta_sq.f90
Generated by
1.9.8