Neko 1.99.3
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
opr_sx.f90
Go to the documentation of this file.
1
2module opr_sx
3 use gather_scatter, only : gs_t, gs_op_add
5 use num_types, only : rp
6 use space, only : space_t
7 use coefs, only : coef_t
8 use math, only : sub3, copy, rzero
9 use mathops, only : opcolv
10 implicit none
11 private
12
13 public :: opr_sx_dudxyz, opr_sx_opgrad, opr_sx_cdtp, opr_sx_conv1, &
14 opr_sx_curl, opr_sx_cfl, opr_sx_lambda2, opr_sx_convect_scalar, &
15 opr_sx_set_convect_rst
16
17
18 interface
19 module subroutine opr_sx_dudxyz(du, u, dr, ds, dt, coef)
20 type(coef_t), intent(in), target :: coef
21 real(kind=rp), intent(inout), &
22 dimension(coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, coef%msh%nelv) :: du
23 real(kind=rp), intent(in), &
24 dimension(coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, coef%msh%nelv) :: &
25 u, dr, ds, dt
26 end subroutine opr_sx_dudxyz
27
28 module subroutine opr_sx_opgrad(ux, uy, uz, u, coef)
29 type(coef_t), intent(in) :: coef
30 real(kind=rp), intent(inout) :: ux(coef%Xh%lxyz, coef%msh%nelv)
31 real(kind=rp), intent(inout) :: uy(coef%Xh%lxyz, coef%msh%nelv)
32 real(kind=rp), intent(inout) :: uz(coef%Xh%lxyz, coef%msh%nelv)
33 real(kind=rp), intent(in) :: u(coef%Xh%lxyz, coef%msh%nelv)
34 end subroutine opr_sx_opgrad
35
36 module subroutine opr_sx_cdtp(dtx, x, dr, ds, dt, coef)
37 type(coef_t), intent(in) :: coef
38 real(kind=rp), intent(inout) :: dtx(coef%Xh%lxyz, coef%msh%nelv)
39 real(kind=rp), intent(inout) :: x(coef%Xh%lxyz, coef%msh%nelv)
40 real(kind=rp), intent(in) :: dr(coef%Xh%lxyz, coef%msh%nelv)
41 real(kind=rp), intent(in) :: ds(coef%Xh%lxyz, coef%msh%nelv)
42 real(kind=rp), intent(in) :: dt(coef%Xh%lxyz, coef%msh%nelv)
43 end subroutine opr_sx_cdtp
44
45 module subroutine opr_sx_conv1(du, u, vx, vy, vz, xh, coef, nelv)
46 type(space_t), intent(in) :: Xh
47 type(coef_t), intent(in) :: coef
48 integer, intent(in) :: nelv
49 real(kind=rp), intent(inout) :: du(xh%lxyz, nelv)
50 real(kind=rp), intent(in) :: u(xh%lx, xh%ly, xh%lz, nelv)
51 real(kind=rp), intent(in) :: vx(xh%lx, xh%ly, xh%lz, nelv)
52 real(kind=rp), intent(in) :: vy(xh%lx, xh%ly, xh%lz, nelv)
53 real(kind=rp), intent(in) :: vz(xh%lx, xh%ly, xh%lz, nelv)
54 end subroutine opr_sx_conv1
55
56 module subroutine opr_sx_convect_scalar(du, u, cr, cs, ct, xh_gll, xh_gl, &
57 coef_gll, coef_gl, gll_to_gl)
58 type(space_t), intent(in) :: Xh_GL
59 type(space_t), intent(in) :: Xh_GLL
60 type(coef_t), intent(in) :: coef_GLL
61 type(coef_t), intent(in) :: coef_GL
62 type(interpolator_t), intent(inout) :: GLL_to_GL
63 real(kind=rp), intent(inout) :: &
64 du(xh_gll%lx, xh_gll%ly, xh_gll%lz, coef_gl%msh%nelv)
65 real(kind=rp), intent(inout) :: &
66 u(xh_gl%lx, xh_gl%lx, xh_gl%lx, coef_gl%msh%nelv)
67 real(kind=rp), intent(inout) :: cr(xh_gl%lxyz, coef_gl%msh%nelv)
68 real(kind=rp), intent(inout) :: cs(xh_gl%lxyz, coef_gl%msh%nelv)
69 real(kind=rp), intent(inout) :: ct(xh_gl%lxyz, coef_gl%msh%nelv)
70
71 end subroutine opr_sx_convect_scalar
72
73 module function opr_sx_cfl(dt, u, v, w, xh, coef, nelv) result(cfl)
74 type(space_t), intent(in) :: Xh
75 type(coef_t), intent(in) :: coef
76 integer, intent(in) :: nelv
77 real(kind=rp), intent(in) :: dt
78 real(kind=rp), dimension(Xh%lx, Xh%ly, Xh%lz, nelv) :: u, v, w
79 real(kind=rp) :: cfl
80 end function opr_sx_cfl
81
82 module subroutine opr_sx_lambda2(lambda2, u, v, w, coef)
83 type(coef_t), intent(in) :: coef
84 real(kind=rp), intent(inout), &
85 dimension(coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, coef%msh%nelv) :: lambda2
86 real(kind=rp), intent(in), &
87 dimension(coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, coef%msh%nelv) :: u, v, w
88 end subroutine opr_sx_lambda2
89
90 module subroutine opr_sx_set_convect_rst(cr, cs, ct, cx, cy, cz, xh, coef)
91 type(space_t), intent(inout) :: Xh
92 type(coef_t), intent(inout) :: coef
93 real(kind=rp), dimension(Xh%lxyz, coef%msh%nelv), &
94 intent(inout) :: cr, cs, ct
95 real(kind=rp), dimension(Xh%lxyz, coef%msh%nelv), &
96 intent(in) :: cx, cy, cz
97 end subroutine opr_sx_set_convect_rst
98 end interface
99
100contains
101
102 subroutine opr_sx_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_Xh)
103 type(coef_t), intent(in) :: c_xh
104 real(kind=rp), intent(inout), &
105 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: w1
106 real(kind=rp), intent(inout), &
107 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: w2
108 real(kind=rp), intent(inout), &
109 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: w3
110 real(kind=rp), intent(in), &
111 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: u1
112 real(kind=rp), intent(in), &
113 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: u2
114 real(kind=rp), intent(in), &
115 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: u3
116 real(kind=rp), intent(inout), &
117 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: work1
118 real(kind=rp), intent(inout), &
119 dimension(c_Xh%Xh%lx, c_Xh%Xh%ly, c_Xh%Xh%lz, c_Xh%msh%nelv) :: work2
120 integer :: gdim, n
121
122 n = c_xh%dof%size()
123 gdim = c_xh%msh%gdim
124
125 ! this%work1=dw/dy ; this%work2=dv/dz
126 call opr_sx_dudxyz(work1, u3, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
127 if (gdim .eq. 3) then
128 call opr_sx_dudxyz(work2, u2, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
129 call sub3(w1, work1, work2, n)
130 else
131 call copy(w1, work1, n)
132 end if
133 ! this%work1=du/dz ; this%work2=dw/dx
134 if (gdim .eq. 3) then
135 call opr_sx_dudxyz(work1, u1, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
136 call opr_sx_dudxyz(work2, u3, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
137 call sub3(w2, work1, work2, n)
138 else
139 call rzero (work1, n)
140 call opr_sx_dudxyz(work2, u3, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
141 call sub3(w2, work1, work2, n)
142 end if
143 ! this%work1=dv/dx ; this%work2=du/dy
144 call opr_sx_dudxyz(work1, u2, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
145 call opr_sx_dudxyz(work2, u1, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
146 call sub3(w3, work1, work2, n)
147 !! BC dependent, Needs to change if cyclic
148
149 call opcolv(w1, w2, w3, c_xh%B, gdim, n)
150 call c_xh%gs_h%op(w1, n, gs_op_add)
151 call c_xh%gs_h%op(w2, n, gs_op_add)
152 call c_xh%gs_h%op(w3, n, gs_op_add)
153 call opcolv(w1, w2, w3, c_xh%Binv, gdim, n)
154
155 end subroutine opr_sx_curl
156
157
158
159
160
161end module opr_sx
Coefficients.
Definition coef.f90:34
Gather-scatter.
Routines to interpolate between different spaces.
A simulation component that computes lambda2 The values are stored in the field registry under the na...
Definition lambda2.f90:37
Definition math.f90:60
subroutine, public sub3(a, b, c, n)
Vector subtraction .
Definition math.f90:961
subroutine, public copy(a, b, n)
Copy a vector .
Definition math.f90:289
subroutine, public rzero(a, n)
Zero a real vector.
Definition math.f90:233
Collection of vector field operations operating on and . Note that in general the indices and ....
Definition mathops.f90:65
subroutine, public opcolv(a1, a2, a3, c, gdim, n)
Definition mathops.f90:101
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Operators SX-Aurora backend.
Definition opr_sx.f90:2
subroutine, public opr_sx_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_xh)
Definition opr_sx.f90:103
Defines a function space.
Definition space.f90:34
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:63
Interpolation between two space::space_t.
The function space for the SEM solution fields.
Definition space.f90:63