aboutsummaryrefslogtreecommitdiff
path: root/src/EHFinder_Init.F90
diff options
context:
space:
mode:
Diffstat (limited to 'src/EHFinder_Init.F90')
-rw-r--r--src/EHFinder_Init.F9053
1 files changed, 41 insertions, 12 deletions
diff --git a/src/EHFinder_Init.F90 b/src/EHFinder_Init.F90
index c9dd60c..d9aa13e 100644
--- a/src/EHFinder_Init.F90
+++ b/src/EHFinder_Init.F90
@@ -23,6 +23,7 @@ subroutine EHFinder_Init_F(CCTK_ARGUMENTS)
CCTK_REAL :: last_time
CCTK_REAL :: theta, dtheta, thetamin, thetamax, r_el
CCTK_REAL :: phi, dphi, phimin, phimax
+ CCTK_REAL :: costh, sinth, cosph, sinph
CCTK_INT, dimension(1) :: lsh, lbnd
CCTK_INT, dimension(2) :: lsh2, lbnd2
@@ -115,13 +116,13 @@ subroutine EHFinder_Init_F(CCTK_ARGUMENTS)
if ( number_of_generators_theta .eq. 1 ) then
theta = half * ( thetamax - thetamin ) + thetamin
else
- dtheta = ( thetamax - thetamin ) / ( number_of_generators_theta - 1 )
+ dtheta = ( thetamax - thetamin ) / ( number_of_generators_theta )
end if
if ( number_of_generators_phi .eq. 1 ) then
phi = half * ( phimax - phimin ) + phimin
else
- dphi = ( phimax - phimin ) / ( number_of_generators_phi - 1 )
+ dphi = ( phimax - phimin ) / ( number_of_generators_phi )
end if
end if
@@ -140,20 +141,21 @@ subroutine EHFinder_Init_F(CCTK_ARGUMENTS)
if ( evolve_generators .gt. 0 ) then
if ( CCTK_EQUALS( generator_distribution, 'line' ) ) then
do i = 1, lsh(1)
- theta = thetamin + dtheta * ( i + lbnd(1) - 1 )
+ theta = thetamin + dtheta * ( i + lbnd(1) - 1 ) + half * dtheta
xg(i,l) = initial_rad(l) * sin(theta) + translate_x(l)
yg(i,l) = translate_y(l)
zg(i,l) = initial_rad(l) * cos(theta) + translate_z(l)
end do
else if ( CCTK_EQUALS( generator_distribution, '2D array' ) ) then
do j = 1, lsh2(2)
- phi = phimin + dphi * ( j + lbnd2(2) - 1 )
+ phi = phimin + dphi * ( j + lbnd2(2) - 1 ) + half * dphi
+ cosph = cos(phi); sinph = sin(phi)
do i = 1, lsh2(1)
theta = thetamin + dtheta * ( i + lbnd2(1) - 1 )
- xg2(i,j,l) = initial_rad(l) * sin(theta) * cos(phi) + translate_x(l)
- yg2(i,j,l) = initial_rad(l) * sin(theta) * sin(phi) + translate_x(l)
- zg2(i,j,l) = initial_rad(l) * cos(theta) + translate_z(l)
- print*,xg2(i,j,l),yg2(i,j,l),zg2(i,j,l)
+ costh = cos(theta); sinth = sin(theta)
+ xg2(i,j,l) = initial_rad(l) * sinth * cosph + translate_x(l)
+ yg2(i,j,l) = initial_rad(l) * sinth * sinph + translate_x(l)
+ zg2(i,j,l) = initial_rad(l) * costh + translate_z(l)
end do
end do
end if
@@ -204,16 +206,43 @@ subroutine EHFinder_Init_F(CCTK_ARGUMENTS)
if ( CCTK_EQUALS( generator_distribution, 'line' ) ) then
do i = 1, lsh(1)
theta = thetamin + dtheta * ( i + lbnd(1) - 1 )
- r_el = sqrt ( one / ( sin(theta)**2 / initial_a(l)**2 + &
- cos(theta)**2 / initial_c(l)**2 ) )
- xp(1) = r_el * sin(theta) + translate_x(l)
+ costh = cos(theta); sinth = sin(theta)
+ r_el = sqrt ( one / ( sinth**2 / initial_a(l)**2 + &
+ costh**2 / initial_c(l)**2 ) )
+ xp(1) = r_el * sinth + translate_x(l)
xp(2) = translate_y(l)
- xp(3) = r_el * cos(theta) + translate_z(l)
+ xp(3) = r_el * costh + translate_z(l)
xpt = matmul ( txyz, xp )
xg(i,l) = xpt(1)
yg(i,l) = xpt(2)
zg(i,l) = xpt(3)
end do
+ else if ( CCTK_EQUALS( generator_distribution, '2D array' ) ) then
+ do j = 1, lsh2(2)
+ phi = phimin + dphi * ( j + lbnd2(2) - 1 ) + half * dphi
+ cosph = cos(phi); sinph = sin(phi)
+ do i = 1, lsh2(1)
+ theta = thetamin + dtheta * ( i + lbnd2(1) - 1 ) + half * dtheta
+ costh = cos(theta); sinth = sin(theta)
+ r_el = sqrt ( one / &
+ ( sinth**2*cosph**2 / initial_a(l)**2 + &
+ sinth**2*sinph**2 / initial_b(l)**2 + &
+ costh**2 / initial_c(l)**2 ) )
+ xp(1) = r_el * sinth * cosph + translate_x(l)
+ xp(2) = r_el * sinth * sinph + translate_y(l)
+ xp(3) = r_el * costh + translate_z(l)
+ xpt = matmul ( txyz, xp )
+ xg2(i,j,l) = xpt(1)
+ yg2(i,j,l) = xpt(2)
+ zg2(i,j,l) = xpt(3)
+ end do
+ end do
+! print*,xg2
+! print*
+! print*,yg2
+! print*
+! print*,zg2
+! stop
end if
end if
end if