GCC Code Coverage Report


Directory: src/
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 0.0% 0 / 0 / 1
Functions: 0.0% 0 / 0 / 1
Branches: -% 0 / 0 / 0

coord_transform/m_coord_transform_cylinder.f90
Line Branch Exec Source
1 !> @brief Module for the cylinder coordinate transformations
2 module m_coord_transform_cylinder
3 use m_common, only: wp, pi
4 use m_coord_transform_abstract, only: CoordTransformAbstract
5
6 implicit none
7
8 private
9 public :: CylinderTransform
10 public :: cylinder_transform, cylinder_inverse_transform, cylinder_jacobian
11 public :: cylinder_jacobian_matrix, cylinder_jacobian_matrix_inv, cylinder_G_matrix, cylinder_G_matrix_inv
12
13 !> @brief Cylindrical coordinates given by
14 !> \f{eqnarray*}{
15 !> x &= R xp \cos(2 \pi yp)\\
16 !> y &= R xp \sin(2 \pi yp)\\
17 !> z &= zp
18 !> \f}
19 type, extends(CoordTransformAbstract) :: CylinderTransform
20 !> @brief The radius of the cylindrical coordinate system
21 real(wp) :: radius
22 end type CylinderTransform
23
24 interface CylinderTransform
25 module procedure init_CylinderTransform
26 end interface CylinderTransform
27
28 interface
29 !> @brief Create a new CylinderTransform object
30 !> @param[in] radius The radius of the cylindrical coordinate system
31 !> @return A new CylinderTransform object
32 module function init_CylinderTransform(radius) result(this)
33 real(wp), intent(in) :: radius
34 type(CylinderTransform) :: this
35 end function init_CylinderTransform
36
37 !> @brief The i-th component of the cylindrical transformation
38 !> @param[in] this The CylinderTransform object
39 !> @param[in] i The index of the component
40 !> @param[in] xp The radial coordinate
41 !> @param[in] yp The angular coordinate
42 !> @param[in] zp The height coordinate
43 !> @return The i-th component of the transformation
44 module pure real(wp) function cylinder_transform(this, i, xp, yp, zp) result(ans)
45 !$acc routine seq
46 type(CylinderTransform), intent(in) :: this
47 integer, intent(in) :: i
48 real(wp), intent(in) :: xp, yp, zp
49 end function cylinder_transform
50
51 !> @brief The i-th component of the inverse cylindrical transformation
52 !> @param[in] this The CylinderTransform object
53 !> @param[in] i The index of the component
54 !> @param[in] x The x coordinate
55 !> @param[in] y The y coordinate
56 !> @param[in] z The z coordinate
57 !> @return The i-th coordinate
58 module pure real(wp) function cylinder_inverse_transform(this, i, x, y, z) result(ans)
59 !$acc routine seq
60 type(CylinderTransform), intent(in) :: this
61 integer, intent(in) :: i
62 real(wp), intent(in) :: x, y, z
63 end function cylinder_inverse_transform
64
65 !> @brief The Jacobian determinant of the cylindrical transformation
66 !> @param[in] this The CylinderTransform object
67 !> @param[in] xp The radial coordinate
68 !> @param[in] yp The angular coordinate
69 !> @param[in] zp The height coordinate
70 !> @return The Jacobian determinant
71 module pure real(wp) function cylinder_jacobian(this, xp, yp, zp) result(ans)
72 !$acc routine seq
73 type(CylinderTransform), intent(in) :: this
74 real(wp), intent(in) :: xp, yp, zp
75 end function cylinder_jacobian
76
77 !> @brief The (i, j)-th component of the Jacobian matrix of the cylindrical transformation
78 !> @param[in] this The CylinderTransform object
79 !> @param[in] i The row index
80 !> @param[in] j The column index
81 !> @param[in] xp The radial coordinate
82 !> @param[in] yp The angular coordinate
83 !> @param[in] zp The height coordinate
84 !> @return The (i, j)-th component of the Jacobian matrix
85 module pure real(wp) function cylinder_jacobian_matrix(this, i, j, xp, yp, zp) result(ans)
86 !$acc routine seq
87 type(CylinderTransform), intent(in) :: this
88 integer, intent(in) :: i, j
89 real(wp), intent(in) :: xp, yp, zp
90 end function cylinder_jacobian_matrix
91
92 !> @brief The (i, j)-th component of the inverse of the Jacobian matrix of the cylindrical transformation
93 !> @param[in] this The CylinderTransform object
94 !> @param[in] i The row index
95 !> @param[in] j The column index
96 !> @param[in] xp The radial coordinate
97 !> @param[in] yp The angular coordinate
98 !> @param[in] zp The height coordinate
99 !> @return The (i, j)-th component of the inverse of the Jacobian matrix
100 module pure real(wp) function cylinder_jacobian_matrix_inv(this, i, j, xp, yp, zp) result(ans)
101 !$acc routine seq
102 type(CylinderTransform), intent(in) :: this
103 integer, intent(in) :: i, j
104 real(wp), intent(in) :: xp, yp, zp
105 end function cylinder_jacobian_matrix_inv
106
107 !> @brief The (i, j)-th component of the metric tensor of the cylindrical transformation
108 !> @param[in] this The CylinderTransform object
109 !> @param[in] i The row index
110 !> @param[in] j The column index
111 !> @param[in] xp The radial coordinate
112 !> @param[in] yp The angular coordinate
113 !> @param[in] zp The height coordinate
114 !> @return The (i, j)-th component of the metric tensor
115 module pure real(wp) function cylinder_G_matrix(this, i, j, xp, yp, zp) result(ans)
116 !$acc routine seq
117 type(CylinderTransform), intent(in) :: this
118 integer, intent(in) :: i, j
119 real(wp), intent(in) :: xp, yp, zp
120 end function cylinder_G_matrix
121
122 !> @brief The (i, j)-th component of the inverse metric tensor of the cylindrical transformation
123 !> @param[in] this The CylinderTransform object
124 !> @param[in] i The row index
125 !> @param[in] j The column index
126 !> @param[in] xp The radial coordinate
127 !> @param[in] yp The angular coordinate
128 !> @param[in] zp The height coordinate
129 !> @return The (i, j)-th component of the inverse metric tensor
130 module pure real(wp) function cylinder_G_matrix_inv(this, i, j, xp, yp, zp) result(ans)
131 !$acc routine seq
132 type(CylinderTransform), intent(in) :: this
133 integer, intent(in) :: i, j
134 real(wp), intent(in) :: xp, yp, zp
135 end function cylinder_G_matrix_inv
136
137 end interface
138
139 end module m_coord_transform_cylinder
140