9 #include "sll_assert.h"
31 real(
wp) :: x0(2) = [0.0_wp, 0.0_wp]
32 real(
wp) :: e = 1.0_wp
33 real(
wp) :: eps = 1.0_wp
38 procedure :: eval => f_singular_mapping_analytic_czarny__eval
39 procedure :: jmat => f_singular_mapping_analytic_czarny__jmat
40 procedure :: jmat_comp => f_singular_mapping_analytic_czarny__jmat_comp
50 real(wp),
optional,
intent(in) :: x0(2)
51 real(wp),
optional,
intent(in) :: e
52 real(wp),
optional,
intent(in) :: eps
55 if (
present(x0)) self%x0 = x0
56 if (
present(e)) self%e = e
57 if (
present(eps)) self%eps = eps
62 sll_pure
function f_singular_mapping_analytic_czarny__eval(self, eta)
result(x)
64 real(wp),
intent(in) :: eta(2)
67 associate(s => eta(1), t => eta(2), x0 => self%x0, e => self%e, eps => self%eps)
70 x(1) = (1.0_wp - sqrt(1.0_wp + eps*(eps + 2.0_wp*s*cos(t))))/eps
71 x(2) = x0(2) + e*s*sin(t)/((1.0_wp + eps*x(1))*sqrt(1.0_wp - eps**2*0.25_wp))
75 end function f_singular_mapping_analytic_czarny__eval
78 sll_pure
function f_singular_mapping_analytic_czarny__jmat(self, eta)
result(jmat)
80 real(wp),
intent(in) :: eta(2)
81 real(wp) :: jmat(2, 2)
83 real(wp) :: tmp1, tmp2
85 associate(s => eta(1), t => eta(2), e => self%e, eps => self%eps)
87 tmp1 = sqrt(1.0_wp + eps*(eps + 2.0_wp*s*cos(t)))
88 tmp2 = sqrt(1.0_wp - eps**2*0.25_wp)
94 jmat(1, 1) = -cos(t)/tmp1
95 jmat(1, 2) = s*sin(t)/tmp1
96 jmat(2, 1) = e*sin(t)/((2.0_wp - tmp1)*tmp2) + eps*e*s*sin(t)*cos(t)/(tmp1*tmp2*(2.0_wp - tmp1)**2)
97 jmat(2, 2) = e*s*cos(t)/((2.0_wp - tmp1)*tmp2) - eps*e*s**2*sin(t)**2/(tmp1*tmp2*(2.0_wp - tmp1)**2)
101 end function f_singular_mapping_analytic_czarny__jmat
104 sll_pure
function f_singular_mapping_analytic_czarny__jmat_comp(self, eta)
result(jmat_comp)
106 real(wp),
intent(in) :: eta(2)
107 real(wp) :: jmat_comp(2, 2)
109 real(wp) :: tmp1, tmp2
111 associate(s => eta(1), t => eta(2), e => self%e, eps => self%eps)
113 tmp1 = sqrt(1.0_wp + eps*(eps + 2.0_wp*s*cos(t)))
114 tmp2 = sqrt(1.0_wp - eps**2*0.25_wp)
116 jmat_comp(1, 1) = e/(tmp2*(2.0_wp - tmp1))
117 jmat_comp(1, 2) = 0.0_wp
118 jmat_comp(2, 1) = -e*eps*s*sin(t)/(tmp1*tmp2*(2.0_wp - tmp1)**2)
119 jmat_comp(2, 2) = -1.0_wp/tmp1
121 jmat_comp = jmat_comp/(-e/(tmp1*tmp2*(2.0_wp - tmp1)))
125 end function f_singular_mapping_analytic_czarny__jmat_comp
Fortran module where set some physical and mathematical constants.
real(kind=f64), parameter, public sll_p_twopi
subroutine s_singular_mapping_analytic_czarny__init(self, x0, e, eps)
integer, parameter wp
Working precision.
Module to select the kind parameter.
integer, parameter, public f64
f64 is the kind type for 64-bit reals (double precision)
Abstract type, analytical singular mapping.
Concrete type, analytical singular mapping.