3 #include "sll_assert.h"
24 real(
wp) :: eps = 1.0e-12_wp
28 real(
wp) :: jmat_pole(2, 2)
34 procedure :: eval => s_jacobian_2d_pseudo_cartesian__eval
46 real(wp),
optional,
intent(in) :: eps
48 self%mapping => mapping
50 if (
present(eps)) self%eps = eps
59 real(wp),
intent(in) :: eta2_array(:)
63 real(wp) :: jmat_temp(2, 2)
65 self%jmat_pole(:, :) = 0.0_wp
69 do i2 = 1,
size(eta2_array)
71 theta = eta2_array(i2)
73 jmat_temp(2, 2) = self%mapping%spline_2d_x1%eval_deriv_x1(s, theta)*cos(theta) &
74 - self%mapping%spline_2d_x1%eval_deriv_x1x2(s, theta)*sin(theta)
76 jmat_temp(1, 2) = -self%mapping%spline_2d_x1%eval_deriv_x1(s, theta)*sin(theta) &
77 - self%mapping%spline_2d_x1%eval_deriv_x1x2(s, theta)*cos(theta)
79 jmat_temp(2, 1) = -self%mapping%spline_2d_x2%eval_deriv_x1(s, theta)*cos(theta) &
80 + self%mapping%spline_2d_x2%eval_deriv_x1x2(s, theta)*sin(theta)
82 jmat_temp(1, 1) = self%mapping%spline_2d_x2%eval_deriv_x1(s, theta)*sin(theta) &
83 + self%mapping%spline_2d_x2%eval_deriv_x1x2(s, theta)*cos(theta)
85 jmat_temp(:, :) = jmat_temp(:, :)/(jmat_temp(1, 1)*jmat_temp(2, 2) - jmat_temp(1, 2)*jmat_temp(2, 1))
87 self%jmat_pole(:, :) = self%jmat_pole(:, :) + jmat_temp(:, :)
92 self%jmat_pole(:, :) = self%jmat_pole(:, :)/
size(eta2_array)
99 sll_pure
function s_jacobian_2d_pseudo_cartesian__eval(self, eta)
result(jmat)
101 real(wp),
intent(in) :: eta(2)
102 real(wp) :: jmat(2, 2)
104 real(wp) :: eps, jmat_pole(2, 2), jmat_eps(2, 2)
109 if (eta(1) == 0.0_wp)
then
111 jmat(:, :) = self%jmat_pole(:, :)
114 else if (0.0_wp < eta(1) .and. eta(1) < eps)
then
116 jmat_pole(:, :) = self%jmat_pole(:, :)
118 jmat_eps(2, 2) = self%mapping%spline_2d_x1%eval_deriv_x1(eps, eta(2))*cos(eta(2)) &
119 - self%mapping%spline_2d_x1%eval_deriv_x2(eps, eta(2))*sin(eta(2))/eps
121 jmat_eps(1, 2) = -self%mapping%spline_2d_x1%eval_deriv_x1(eps, eta(2))*sin(eta(2)) &
122 - self%mapping%spline_2d_x1%eval_deriv_x2(eps, eta(2))*cos(eta(2))/eps
124 jmat_eps(2, 1) = -self%mapping%spline_2d_x2%eval_deriv_x1(eps, eta(2))*cos(eta(2)) &
125 + self%mapping%spline_2d_x2%eval_deriv_x2(eps, eta(2))*sin(eta(2))/eps
127 jmat_eps(1, 1) = self%mapping%spline_2d_x2%eval_deriv_x1(eps, eta(2))*sin(eta(2)) &
128 + self%mapping%spline_2d_x2%eval_deriv_x2(eps, eta(2))*cos(eta(2))/eps
130 jmat_eps(:, :) = jmat_eps(:, :)/(jmat_eps(1, 1)*jmat_eps(2, 2) - jmat_eps(1, 2)*jmat_eps(2, 1))
134 jmat(1, 1) = (1.0_wp - eta(1)/eps)*jmat_pole(1, 1) + eta(1)/eps*jmat_eps(1, 1)
135 jmat(1, 2) = (1.0_wp - eta(1)/eps)*jmat_pole(1, 2) + eta(1)/eps*jmat_eps(1, 2)
136 jmat(2, 1) = (1.0_wp - eta(1)/eps)*jmat_pole(2, 1) + eta(1)/eps*jmat_eps(2, 1)
137 jmat(2, 2) = (1.0_wp - eta(1)/eps)*jmat_pole(2, 2) + eta(1)/eps*jmat_eps(2, 2)
140 else if (eps <= eta(1))
then
142 jmat(2, 2) = self%mapping%spline_2d_x1%eval_deriv_x1(eta(1), eta(2))*cos(eta(2)) &
143 - self%mapping%spline_2d_x1%eval_deriv_x2(eta(1), eta(2))*sin(eta(2))/eta(1)
145 jmat(1, 2) = -self%mapping%spline_2d_x1%eval_deriv_x1(eta(1), eta(2))*sin(eta(2)) &
146 - self%mapping%spline_2d_x1%eval_deriv_x2(eta(1), eta(2))*cos(eta(2))/eta(1)
148 jmat(2, 1) = -self%mapping%spline_2d_x2%eval_deriv_x1(eta(1), eta(2))*cos(eta(2)) &
149 + self%mapping%spline_2d_x2%eval_deriv_x2(eta(1), eta(2))*sin(eta(2))/eta(1)
151 jmat(1, 1) = self%mapping%spline_2d_x2%eval_deriv_x1(eta(1), eta(2))*sin(eta(2)) &
152 + self%mapping%spline_2d_x2%eval_deriv_x2(eta(1), eta(2))*cos(eta(2))/eta(1)
154 jmat(:, :) = jmat(:, :)/(jmat(1, 1)*jmat(2, 2) - jmat(1, 2)*jmat(2, 1))
158 end function s_jacobian_2d_pseudo_cartesian__eval
164 nullify (self%mapping)
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_pi
subroutine s_jacobian_2d_pseudo_cartesian__pole(self, eta2_array)
subroutine s_jacobian_2d_pseudo_cartesian__init(self, mapping, eps)
subroutine s_jacobian_2d_pseudo_cartesian__free(self)
Module to select the kind parameter.
integer, parameter, public f64
f64 is the kind type for 64-bit reals (double precision)
Concrete type, discrete singular mapping.