GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 100.0% 54 / 0 / 54
Functions: 100.0% 8 / 0 / 8
Branches: 76.0% 38 / 0 / 50

coord_transform/s_coord_transform_cylinder.f90
Line Branch Exec Source
1 !> @file s_coord_transform_cylinder.f90
2 !> @brief Submodule implementing CylinderTransform methods
3 submodule(m_coord_transform_cylinder) s_coord_transform_cylinder
4 implicit none
5
6 contains
7
8 102 module procedure init_CylinderTransform
9 102 this%radius = radius
10 this%is_orthogonal = .true.
11 this%has_polar_xy_singularity = .true.
12 102 end procedure init_CylinderTransform
13
14 2100 module procedure cylinder_transform
15 !$acc routine seq
16 2800 select case (i)
17 case (1)
18 700 ans = this%radius * xp * cos(2 * pi * yp)
19 case (2)
20 700 ans = this%radius * xp * sin(2 * pi * yp)
21 case (3)
22
3/4
✓ Branch 2 → 3 taken 700 times.
✓ Branch 2 → 4 taken 700 times.
✓ Branch 2 → 5 taken 700 times.
✗ Branch 2 → 6 not taken.
2100 ans = zp
23 end select
24 2100 end procedure cylinder_transform
25
26 300 module procedure cylinder_inverse_transform
27 !$acc routine seq
28 400 select case (i)
29 case (1)
30 100 ans = sqrt(x**2 + y**2) / this%radius
31 case (2)
32
3/4
✓ Branch 4 → 5 taken 100 times.
✗ Branch 4 → 8 not taken.
✓ Branch 5 → 6 taken 54 times.
✓ Branch 5 → 8 taken 46 times.
100 ans = modulo(atan2(y, x) / (2 * pi), 1._wp)
33 case (3)
34
3/4
✓ Branch 2 → 3 taken 100 times.
✓ Branch 2 → 4 taken 100 times.
✓ Branch 2 → 7 taken 100 times.
✗ Branch 2 → 8 not taken.
300 ans = z
35 end select
36 300 end procedure cylinder_inverse_transform
37
38 93896520 module procedure cylinder_jacobian
39 !$acc routine seq
40 93896520 ans = 2 * pi * this%radius**2 * xp
41 93896520 end procedure cylinder_jacobian
42
43 4500 module procedure cylinder_jacobian_matrix
44 !$acc routine seq
45 6000 select case (i)
46 case (1)
47 3500 select case (j)
48 case (1)
49 500 ans = this%radius * cos(2 * pi * yp)
50 case (2)
51 500 ans = -2 * pi * this%radius * xp * sin(2 * pi * yp)
52 case (3)
53
3/4
✗ Branch 4 → 3 not taken.
✓ Branch 4 → 5 taken 500 times.
✓ Branch 4 → 6 taken 500 times.
✓ Branch 4 → 11 taken 500 times.
1500 ans = 0._wp
54 end select
55 case (2)
56 3500 select case (j)
57 case (1)
58 500 ans = this%radius * sin(2 * pi * yp)
59 case (2)
60 500 ans = 2 * pi * this%radius * xp * cos(2 * pi * yp)
61 case (3)
62
3/4
✗ Branch 7 → 3 not taken.
✓ Branch 7 → 8 taken 500 times.
✓ Branch 7 → 9 taken 500 times.
✓ Branch 7 → 11 taken 500 times.
1500 ans = 0._wp
63 end select
64 case (3)
65
3/4
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 1500 times.
✓ Branch 2 → 7 taken 1500 times.
✓ Branch 2 → 10 taken 1500 times.
4500 select case (j)
66 case (1)
67 ans = 0._wp
68 case (2)
69 ans = 0._wp
70 case (3)
71
2/3
✗ Branch 10 → 3 not taken.
✓ Branch 10 → 11 taken 1000 times.
✓ Branch 10 → 12 taken 500 times.
1500 ans = 1._wp
72 end select
73 end select
74 4500 end procedure cylinder_jacobian_matrix
75
76 900 module procedure cylinder_jacobian_matrix_inv
77 !$acc routine seq
78 1200 select case (i)
79 case (1)
80 700 select case (j)
81 case (1)
82 100 ans = cos(2 * pi * yp) / this%radius
83 case (2)
84 100 ans = sin(2 * pi * yp) / this%radius
85 case (3)
86
3/4
✗ Branch 4 → 3 not taken.
✓ Branch 4 → 5 taken 100 times.
✓ Branch 4 → 6 taken 100 times.
✓ Branch 4 → 11 taken 100 times.
300 ans = 0._wp
87 end select
88 case (2)
89 700 select case (j)
90 case (1)
91 100 ans = -sin(2 * pi * yp) / (2 * pi * this%radius * xp)
92 case (2)
93 100 ans = cos(2 * pi * yp) / (2 * pi * this%radius * xp)
94 case (3)
95
3/4
✗ Branch 7 → 3 not taken.
✓ Branch 7 → 8 taken 100 times.
✓ Branch 7 → 9 taken 100 times.
✓ Branch 7 → 11 taken 100 times.
300 ans = 0._wp
96 end select
97 case (3)
98
3/4
✗ Branch 2 → 3 not taken.
✓ Branch 2 → 4 taken 300 times.
✓ Branch 2 → 7 taken 300 times.
✓ Branch 2 → 10 taken 300 times.
900 select case (j)
99 case (1)
100 ans = 0._wp
101 case (2)
102 ans = 0._wp
103 case (3)
104
2/3
✗ Branch 10 → 3 not taken.
✓ Branch 10 → 11 taken 200 times.
✓ Branch 10 → 12 taken 100 times.
300 ans = 1._wp
105 end select
106 end select
107 900 end procedure cylinder_jacobian_matrix_inv
108
109 91408180 module procedure cylinder_G_matrix
110 !$acc routine seq
111
2/2
✓ Branch 2 → 3 taken 91406980 times.
✓ Branch 2 → 7 taken 1200 times.
91408180 if (i /= j) then
112 ans = 0._wp
113 return
114 end if
115 37873484 select case (i)
116 case (1)
117 37873484 ans = this%radius**2
118 case (2)
119 53533496 ans = (2 * pi * this%radius * xp)**2
120 case (3)
121
3/4
✓ Branch 3 → 4 taken 37873484 times.
✓ Branch 3 → 5 taken 37646156 times.
✓ Branch 3 → 6 taken 15887340 times.
✗ Branch 3 → 7 not taken.
91406980 ans = 1._wp
122 end select
123 end procedure cylinder_G_matrix
124
125 85099908 module procedure cylinder_G_matrix_inv
126 !$acc routine seq
127
2/2
✓ Branch 2 → 3 taken 85099308 times.
✓ Branch 2 → 4 taken 600 times.
85099908 if (i /= j) then
128 ans = 0._wp
129 return
130 end if
131 85099308 ans = 1._wp / cylinder_G_matrix(this, i, i, xp, yp, zp)
132 85099308 end procedure cylinder_G_matrix_inv
133
134 end submodule s_coord_transform_cylinder
135