-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_bs.f90
71 lines (50 loc) · 1.27 KB
/
test_bs.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
59
60
61
62
63
64
65
66
67
68
69
70
71
program test_bs
use coil_module
implicit none
real, dimension(3) :: b
integer :: i
call allocate_main(6,14)
call allocate_aux('aux_c.dat')
call read_coil_files(-10000)
! set current
do i = 1,main_count
main_current(i) = -150105./14
enddo
do i = 1,6
aux_current(i) = 0.1 * (-150105)
end do
do i = 7,aux_count
aux_current(i) = 0.
end do
! This is for testing purposes! It works, I think
! call make_simple_coil()
call compute_full_bs((/0.777817,0.777817,.3/), b)
print *,b
call deallocate_coils()
end program test_bs
! make a circular coil in the x-z plane centered at (1,0,0) with radius
! of 0.5
subroutine make_simple_coil()
use coil_module
implicit none
integer :: i, coil_points
real :: theta, pi, center, radius, mu0
mu0 = 1.25663706E-6
pi = 3.14159
coil_points = 51
radius = 0.5
center = 1.0
do i=0,coil_points-1
theta = 2*pi*i/(coil_points-1)
coil_main(1,i+1,1) = 0.0
coil_main(1,i+1,2) = center + radius*cos(theta)
coil_main(1,i+1,3) = radius*sin(theta)
! print *,theta, cos(theta), main(1,i,1)
enddo
main_points(1) = coil_points
main_current(1) = 1.0/mu0
do i=2,main_count
main_points(i) = 0
main_current(i) = 0.0
enddo
end subroutine make_simple_coil