55 type(
coef_t),
intent(in),
target :: coef
56 real(kind=
rp),
dimension(coef%Xh%lx,coef%Xh%ly,coef%Xh%lz,coef%msh%nelv), &
58 real(kind=
rp),
dimension(coef%Xh%lx,coef%Xh%ly,coef%Xh%lz,coef%msh%nelv), &
59 intent(in) :: u, dr, ds, dt
61 associate(xh => coef%Xh, msh => coef%msh, dof => coef%dof)
62 select case(coef%Xh%lx)
65 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
68 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
71 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
74 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
77 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
80 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
83 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
86 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
89 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
92 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
95 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
98 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
101 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv)
104 xh%dx, xh%dy, xh%dz, coef%jacinv, msh%nelv, xh%lx)
112 type(coef_t),
intent(in) :: coef
113 integer,
intent(in) :: e_start, e_end
114 real(kind=rp),
dimension(coef%Xh%lxyz,e_end-e_start+1),
intent(inout) :: ux
115 real(kind=rp),
dimension(coef%Xh%lxyz,e_end-e_start+1),
intent(inout) :: uy
116 real(kind=rp),
dimension(coef%Xh%lxyz,e_end-e_start+1),
intent(inout) :: uz
117 real(kind=rp),
dimension(coef%Xh%lxyz,e_end-e_start+1),
intent(in) :: u
119 e_len = e_end-e_start+1
120 associate(xh => coef%Xh, msh => coef%msh, &
121 drdx => coef%drdx, drdy => coef%drdy, drdz => coef%drdz, &
122 dsdx => coef%dsdx, dsdy => coef%dsdy, dsdz => coef%dsdz, &
123 dtdx => coef%dtdx, dtdy => coef%dtdy, dtdz => coef%dtdz)
127 call cpu_opgrad_lx18(ux, uy, uz, u, &
128 xh%dx, xh%dy, xh%dz, &
129 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
130 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
131 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
134 call cpu_opgrad_lx17(ux, uy, uz, u, &
135 xh%dx, xh%dy, xh%dz, &
136 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
137 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
138 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
141 call cpu_opgrad_lx16(ux, uy, uz, u, &
142 xh%dx, xh%dy, xh%dz, &
143 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
144 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
145 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
148 call cpu_opgrad_lx15(ux, uy, uz, u, &
149 xh%dx, xh%dy, xh%dz, &
150 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
151 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
152 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
155 call cpu_opgrad_lx14(ux, uy, uz, u, &
156 xh%dx, xh%dy, xh%dz, &
157 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
158 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
159 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
162 call cpu_opgrad_lx13(ux, uy, uz, u, &
163 xh%dx, xh%dy, xh%dz, &
164 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
165 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
166 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
169 call cpu_opgrad_lx12(ux, uy, uz, u, &
170 xh%dx, xh%dy, xh%dz, &
171 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
172 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
173 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
176 call cpu_opgrad_lx11(ux, uy, uz, u, &
177 xh%dx, xh%dy, xh%dz, &
178 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
179 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
180 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
183 call cpu_opgrad_lx10(ux, uy, uz, u, &
184 xh%dx, xh%dy, xh%dz, &
185 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
186 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
187 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
191 call cpu_opgrad_lx9(ux, uy, uz, u, &
192 xh%dx, xh%dy, xh%dz, &
193 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
194 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
195 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
198 call cpu_opgrad_lx8(ux, uy, uz, u, &
199 xh%dx, xh%dy, xh%dz, &
200 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
201 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
202 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
205 call cpu_opgrad_lx7(ux, uy, uz, u, &
206 xh%dx, xh%dy, xh%dz, &
207 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
208 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
209 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
212 call cpu_opgrad_lx6(ux, uy, uz, u, &
213 xh%dx, xh%dy, xh%dz, &
214 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
215 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
216 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
219 call cpu_opgrad_lx5(ux, uy, uz, u, &
220 xh%dx, xh%dy, xh%dz, &
221 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
222 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
223 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
226 call cpu_opgrad_lx4(ux, uy, uz, u, &
227 xh%dx, xh%dy, xh%dz, &
228 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
229 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
230 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
233 call cpu_opgrad_lx3(ux, uy, uz, u, &
234 xh%dx, xh%dy, xh%dz, &
235 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
236 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
237 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
240 call cpu_opgrad_lx2(ux, uy, uz, u, &
241 xh%dx, xh%dy, xh%dz, &
242 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
243 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
244 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
247 call cpu_opgrad_lx(ux, uy, uz, u, &
248 xh%dx, xh%dy, xh%dz, &
249 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
250 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
251 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
259 type(coef_t),
intent(in) :: coef
260 real(kind=rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(inout) :: dtx
261 real(kind=rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(inout) :: x
262 real(kind=rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(in) :: dr
263 real(kind=rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(in) :: ds
264 real(kind=rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(in) :: dt
266 associate(xh => coef%Xh, msh => coef%msh, dof => coef%dof)
269 call cpu_cdtp_lx14(dtx, x, dr, ds, dt, &
270 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
272 call cpu_cdtp_lx13(dtx, x, dr, ds, dt, &
273 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
275 call cpu_cdtp_lx12(dtx, x, dr, ds, dt, &
276 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
278 call cpu_cdtp_lx11(dtx, x, dr, ds, dt, &
279 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
281 call cpu_cdtp_lx10(dtx, x, dr, ds, dt, &
282 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
284 call cpu_cdtp_lx9(dtx, x, dr, ds, dt, &
285 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
287 call cpu_cdtp_lx8(dtx, x, dr, ds, dt, &
288 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
290 call cpu_cdtp_lx7(dtx, x, dr, ds, dt, &
291 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
293 call cpu_cdtp_lx6(dtx, x, dr, ds, dt, &
294 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
296 call cpu_cdtp_lx5(dtx, x, dr, ds, dt, &
297 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
299 call cpu_cdtp_lx4(dtx, x, dr, ds, dt, &
300 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
302 call cpu_cdtp_lx3(dtx, x, dr, ds, dt, &
303 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
305 call cpu_cdtp_lx2(dtx, x, dr, ds, dt, &
306 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv)
308 call cpu_cdtp_lx(dtx, x, dr, ds, dt, &
309 xh%dxt, xh%dyt, xh%dzt, coef%B, coef%jac, msh%nelv, xh%lx)
316 type(space_t),
intent(in) :: xh
317 type(coef_t),
intent(in) :: coef
318 integer,
intent(in) :: e_start, e_end
319 real(kind=rp),
intent(inout) :: du(xh%lxyz,e_end-e_start+1)
320 real(kind=rp),
intent(inout),
dimension(Xh%lx,Xh%ly,Xh%lz,e_end-e_start+1) :: u
321 real(kind=rp),
intent(inout),
dimension(Xh%lx,Xh%ly,Xh%lz,e_end-e_start+1) :: vx
322 real(kind=rp),
intent(inout),
dimension(Xh%lx,Xh%ly,Xh%lz,e_end-e_start+1) :: vy
323 real(kind=rp),
intent(inout),
dimension(Xh%lx,Xh%ly,Xh%lz,e_end-e_start+1) :: vz
326 e_len = e_end-e_start+1
327 associate(drdx => coef%drdx, drdy => coef%drdy, drdz => coef%drdz, &
328 dsdx => coef%dsdx, dsdy => coef%dsdy, dsdz => coef%dsdz, &
329 dtdx => coef%dtdx, dtdy => coef%dtdy, dtdz => coef%dtdz, &
330 jacinv => coef%jacinv)
333 call cpu_conv1_lx14(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
334 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
335 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
336 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
337 jacinv(1,1,1,e_start), e_len)
339 call cpu_conv1_lx13(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
340 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
341 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
342 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
343 jacinv(1,1,1,e_start), e_len)
345 call cpu_conv1_lx12(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
346 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
347 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
348 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
349 jacinv(1,1,1,e_start), e_len)
351 call cpu_conv1_lx11(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
352 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
353 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
354 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
355 jacinv(1,1,1,e_start), e_len)
357 call cpu_conv1_lx10(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
358 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
359 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
360 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
361 jacinv(1,1,1,e_start), e_len)
363 call cpu_conv1_lx9(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
364 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
365 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
366 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
367 jacinv(1,1,1,e_start), e_len)
369 call cpu_conv1_lx8(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
370 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
371 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
372 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
373 jacinv(1,1,1,e_start), e_len)
375 call cpu_conv1_lx7(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
376 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
377 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
378 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
379 jacinv(1,1,1,e_start), e_len)
381 call cpu_conv1_lx6(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
382 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
383 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
384 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
385 jacinv(1,1,1,e_start), e_len)
387 call cpu_conv1_lx5(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
388 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
389 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
390 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
391 jacinv(1,1,1,e_start), e_len)
393 call cpu_conv1_lx4(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
394 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
395 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
396 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
397 jacinv(1,1,1,e_start), e_len)
399 call cpu_conv1_lx3(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
400 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
401 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
402 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
403 jacinv(1,1,1,e_start), e_len)
405 call cpu_conv1_lx2(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
406 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
407 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
408 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
409 jacinv(1,1,1,e_start), e_len)
411 call cpu_conv1_lx(du, u, vx, vy, vz, xh%dx, xh%dy, xh%dz, &
412 drdx(1,1,1,e_start), dsdx(1,1,1,e_start), dtdx(1,1,1,e_start), &
413 drdy(1,1,1,e_start), dsdy(1,1,1,e_start), dtdy(1,1,1,e_start), &
414 drdz(1,1,1,e_start), dsdz(1,1,1,e_start), dtdz(1,1,1,e_start), &
415 jacinv(1,1,1,e_start), e_len, xh%lx)
422 type(field_t),
intent(inout) :: w1
423 type(field_t),
intent(inout) :: w2
424 type(field_t),
intent(inout) :: w3
425 type(field_t),
intent(inout) :: u1
426 type(field_t),
intent(inout) :: u2
427 type(field_t),
intent(inout) :: u3
428 type(field_t),
intent(inout) :: work1
429 type(field_t),
intent(inout) :: work2
430 type(coef_t),
intent(in) :: c_xh
437 call opr_cpu_dudxyz(work1%x, u3%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
438 if (gdim .eq. 3)
then
439 call opr_cpu_dudxyz(work2%x, u2%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
440 call sub3(w1%x, work1%x, work2%x, n)
442 call copy(w1%x, work1%x, n)
445 if (gdim .eq. 3)
then
446 call opr_cpu_dudxyz(work1%x, u1%x, c_xh%drdz, c_xh%dsdz, c_xh%dtdz, c_xh)
447 call opr_cpu_dudxyz(work2%x, u3%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
448 call sub3(w2%x, work1%x, work2%x, n)
450 call rzero(work1%x, n)
451 call opr_cpu_dudxyz(work2%x, u3%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
452 call sub3(w2%x, work1%x, work2%x, n)
455 call opr_cpu_dudxyz(work1%x, u2%x, c_xh%drdx, c_xh%dsdx, c_xh%dtdx, c_xh)
456 call opr_cpu_dudxyz(work2%x, u1%x, c_xh%drdy, c_xh%dsdy, c_xh%dtdy, c_xh)
457 call sub3(w3%x, work1%x, work2%x, n)
460 call opcolv(w1%x, w2%x, w3%x, c_xh%B, gdim, n)
461 call c_xh%gs_h%op(w1, gs_op_add)
462 call c_xh%gs_h%op(w2, gs_op_add)
463 call c_xh%gs_h%op(w3, gs_op_add)
464 call opcolv(w1%x, w2%x, w3%x, c_xh%Binv, gdim, n)
468 function opr_cpu_cfl(dt, u, v, w, Xh, coef, nelv, gdim)
result(cfl)
471 integer :: nelv, gdim
473 real(kind=rp),
dimension(Xh%lx,Xh%ly,Xh%lz,nelv) :: u, v, w
474 real(kind=rp) :: cflr, cfls, cflt, cflm
475 real(kind=rp) :: ur, us, ut
477 integer :: i, j, k, e
479 if (gdim .eq. 3)
then
484 ur = ( u(i,j,k,e)*coef%drdx(i,j,k,e) &
485 + v(i,j,k,e)*coef%drdy(i,j,k,e) &
486 + w(i,j,k,e)*coef%drdz(i,j,k,e) ) * coef%jacinv(i,j,k,e)
487 us = ( u(i,j,k,e)*coef%dsdx(i,j,k,e) &
488 + v(i,j,k,e)*coef%dsdy(i,j,k,e) &
489 + w(i,j,k,e)*coef%dsdz(i,j,k,e) ) * coef%jacinv(i,j,k,e)
490 ut = ( u(i,j,k,e)*coef%dtdx(i,j,k,e) &
491 + v(i,j,k,e)*coef%dtdy(i,j,k,e) &
492 + w(i,j,k,e)*coef%dtdz(i,j,k,e) ) * coef%jacinv(i,j,k,e)
494 cflr = abs(dt*ur*xh%dr_inv(i))
495 cfls = abs(dt*us*xh%ds_inv(j))
496 cflt = abs(dt*ut*xh%dt_inv(k))
498 cflm = cflr + cfls + cflt
508 ur = ( u(i,j,1,e)*coef%drdx(i,j,1,e) &
509 + v(i,j,1,e)*coef%drdy(i,j,1,e) ) * coef%jacinv(i,j,1,e)
510 us = ( u(i,j,1,e)*coef%dsdx(i,j,1,e) &
511 + v(i,j,1,e)*coef%dsdy(i,j,1,e) ) * coef%jacinv(i,j,1,e)
513 cflr = abs(dt*ur*xh%dr_inv(i))
514 cfls = abs(dt*us*xh%ds_inv(j))
526 type(coef_t),
intent(in) :: coef
527 type(field_t),
intent(inout) ::
lambda2
528 type(field_t),
intent(in) :: u, v, w
529 real(kind=rp) :: grad(coef%Xh%lxyz,3,3)
530 integer :: temp_indices(9), e, i, ind_sort(3)
531 real(kind=rp) :: eigen(3), b, c, d, q, r, theta, l2
532 real(kind=rp) :: s11, s22, s33, s12, s13, s23, o12, o13, o23
533 real(kind=rp) :: a11, a22, a33, a12, a13, a23
534 real(kind=rp) :: msk1, msk2, msk3
536 do e = 1, coef%msh%nelv
538 u%x(1,1,1,e),coef,e,e)
540 v%x(1,1,1,e),coef,e,e)
542 w%x(1,1,1,e),coef,e,e)
544 do i = 1, coef%Xh%lxyz
550 s12 = 0.5*(grad(i,1,2) + grad(i,2,1))
551 s13 = 0.5*(grad(i,1,3) + grad(i,3,1))
552 s23 = 0.5*(grad(i,2,3) + grad(i,3,2))
554 o12 = 0.5*(grad(i,1,2) - grad(i,2,1))
555 o13 = 0.5*(grad(i,1,3) - grad(i,3,1))
556 o23 = 0.5*(grad(i,2,3) - grad(i,3,2))
558 a11 = s11*s11 + s12*s12 + s13*s13 - o12*o12 - o13*o13
559 a12 = s11 * s12 + s12 * s22 + s13 * s23 - o13 * o23
560 a13 = s11 * s13 + s12 * s23 + s13 * s33 + o12 * o23
562 a22 = s12*s12 + s22*s22 + s23*s23 - o12*o12 - o23*o23
563 a23 = s12 * s13 + s22 * s23 + s23 * s33 - o12 * o13
564 a33 = s13*s13 + s23*s23 + s33*s33 - o13*o13 - o23*o23
567 b = -(a11 + a22 + a33)
568 c = -(a12*a12 + a13*a13 + a23*a23 &
569 - a11 * a22 - a11 * a33 - a22 * a33)
570 d = -(2.0 * a12 * a13 * a23 - a11 * a23*a23 &
571 - a22 * a13*a13 - a33 * a12*a12 + a11 * a22 * a33)
574 q = (3.0 * c - b*b) / 9.0
575 r = (9.0 * c * b - 27.0 * d - 2.0 * b*b*b) / 54.0
576 theta = acos( r / sqrt(-q*q*q) )
578 eigen(1) = 2.0 * sqrt(-q) * cos(theta / 3.0) - b / 3.0
579 eigen(2) = 2.0 * sqrt(-q) * cos((theta + 2.0 * pi) / 3.0) - b / 3.0
580 eigen(3) = 2.0 * sqrt(-q) * cos((theta + 4.0 * pi) / 3.0) - b / 3.0
582 msk1 = merge(1.0_rp, 0.0_rp, eigen(2) .le. eigen(1) &
583 .and. eigen(1) .le. eigen(3) .or. eigen(3) &
584 .le. eigen(1) .and. eigen(1) .le. eigen(2) )
585 msk2 = merge(1.0_rp, 0.0_rp, eigen(1) .le. eigen(2) &
586 .and. eigen(2) .le. eigen(3) .or. eigen(3) &
587 .le. eigen(2) .and. eigen(2) .le. eigen(1))
588 msk3 = merge(1.0_rp, 0.0_rp, eigen(1) .le. eigen(3) &
589 .and. eigen(3) .le. eigen(2) .or. eigen(2) &
590 .le. eigen(3) .and. eigen(3) .le. eigen(1))
592 l2 = msk1 * eigen(1) + msk2 * eigen(2) + msk3 * eigen(3)
594 lambda2%x(i,1,1,e) = l2/(coef%B(i,1,1,e)**2)
subroutine cpu_dudxyz_lx4(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx12(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx13(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx10(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx11(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx14(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx7(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx2(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx9(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx3(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx6(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel, lx)
subroutine cpu_dudxyz_lx8(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
subroutine cpu_dudxyz_lx5(du, u, dr, ds, dt, dx, dy, dz, jacinv, nel)
A simulation component that computes lambda2 The values are stored in the field registry under the na...
Collection of vector field operations operating on and . Note that in general the indices and ....
integer, parameter, public rp
Global precision used in computations.
subroutine, public opr_cpu_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_Xh)
subroutine, public opr_cpu_dudxyz(du, u, dr, ds, dt, coef)
subroutine, public opr_cpu_conv1(du, u, vx, vy, vz, Xh, coef, e_start, e_end)
subroutine, public opr_cpu_cdtp(dtx, x, dr, ds, dt, coef)
subroutine, public opr_cpu_lambda2(lambda2, u, v, w, coef)
real(kind=rp) function, public opr_cpu_cfl(dt, u, v, w, Xh, coef, nelv, gdim)
subroutine, public opr_cpu_opgrad(ux, uy, uz, u, coef, e_start, e_end)
Defines a function space.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
The function space for the SEM solution fields.