Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
scalar_stats.f90
Go to the documentation of this file.
1! Copyright (c) 2025-2026, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
37 use mean_field, only : mean_field_t
39 use num_types, only : rp
40 use operators, only : opgrad
41 use coefs, only : coef_t
42 use field, only : field_t
43 use field_list, only : field_list_t
44 use field_math, only : field_col3
45 use stats_quant, only : stats_quant_t
48 implicit none
49 private
50
51 type, public, extends(stats_quant_t) :: scalar_stats_t
53 type(field_t), pointer :: s
54 type(field_t), pointer :: u
55 type(field_t), pointer :: v
56 type(field_t), pointer :: w
57 type(field_t), pointer :: p
58
59 type(mean_field_t) :: s_mean
60
61 type(mean_field_t) :: us
62 type(mean_field_t) :: vs
63 type(mean_field_t) :: ws
64
65 type(mean_field_t) :: ss
66 type(mean_field_t) :: sss
67 type(mean_field_t) :: ssss
68
69 type(mean_field_t) :: uss
70 type(mean_field_t) :: vss
71 type(mean_field_t) :: wss
72
73 type(mean_field_t) :: uus
74 type(mean_field_t) :: vvs
75 type(mean_field_t) :: wws
76 type(mean_field_t) :: uvs
77 type(mean_field_t) :: uws
78 type(mean_field_t) :: vws
79
80 type(mean_field_t) :: ps
81
82 type(mean_field_t) :: pdsdx
83 type(mean_field_t) :: pdsdy
84 type(mean_field_t) :: pdsdz
85
86 type(mean_field_t) :: udsdx
87 type(mean_field_t) :: udsdy
88 type(mean_field_t) :: udsdz
89 type(mean_field_t) :: vdsdx
90 type(mean_field_t) :: vdsdy
91 type(mean_field_t) :: vdsdz
92 type(mean_field_t) :: wdsdx
93 type(mean_field_t) :: wdsdy
94 type(mean_field_t) :: wdsdz
95
96 type(mean_field_t) :: sdudx
97 type(mean_field_t) :: sdudy
98 type(mean_field_t) :: sdudz
99 type(mean_field_t) :: sdvdx
100 type(mean_field_t) :: sdvdy
101 type(mean_field_t) :: sdvdz
102 type(mean_field_t) :: sdwdx
103 type(mean_field_t) :: sdwdy
104 type(mean_field_t) :: sdwdz
105
106 type(mean_field_t) :: ess
107 type(mean_field_t) :: eus
108 type(mean_field_t) :: evs
109 type(mean_field_t) :: ews
110
112 type(coef_t), pointer :: coef
114 integer :: n_stats = 42
117 character(5) :: stat_set
120 type(field_list_t) :: stat_fields
121 contains
123 procedure, pass(this) :: init => scalar_stats_init
125 procedure, pass(this) :: free => scalar_stats_free
127 procedure, pass(this) :: update => scalar_stats_update
129 procedure, pass(this) :: reset => scalar_stats_reset
130 ! Convert computed weak gradients to strong.
131 procedure, pass(this) :: make_strong_grad => scalar_stats_make_strong_grad
132 end type scalar_stats_t
133
134contains
135
145 subroutine scalar_stats_init(this, coef, s, u, v, w, p, set, name)
146 class(scalar_stats_t), intent(inout), target:: this
147 type(coef_t), target, optional :: coef
148 type(field_t), target, intent(in) :: s, u, v, w, p
149 character(*), intent(in), optional :: set
150 character(*), intent(in), optional :: name
151
152 character(len=1024) :: unique_name
153 unique_name = ""
154
155 call this%free()
156 this%coef => coef
157
158 this%s => s
159 this%u => u
160 this%v => v
161 this%w => w
162 this%p => p
163
164 if (present(set)) then
165 this%stat_set = trim(set)
166 if (this%stat_set .eq. 'basic') then
167 this%n_stats = 5
168 end if
169 else
170 this%stat_set = 'full'
171 this%n_stats = 42
172 end if
173
174 if (present(name)) then
175 unique_name = name // "/"
176 else
177 unique_name = "scalar_stats/"
178 end if
179
180 ! Initialize mean fields. Apart from <s>, these are means of products of
181 ! the instantaneous fields, updated with update_col3/update_dot3. The field
182 ! passed to init only provides the dofmap.
183 call this%s_mean%init(this%s, trim(unique_name) // "mean_s")
184
185 call this%us%init(this%s, trim(unique_name) // 'us')
186 call this%vs%init(this%s, trim(unique_name) // 'vs')
187 call this%ws%init(this%s, trim(unique_name) // 'ws')
188
189 call this%ss%init(this%s, trim(unique_name) // 'ss')
190
191 if (this%n_stats .eq. 42) then
192 ! Initialize req. mean fields
193 call this%sss%init(this%s, trim(unique_name) // 'sss')
194 call this%ssss%init(this%s, trim(unique_name) // 'ssss')
195
196 call this%uss%init(this%s, trim(unique_name) // 'uss')
197 call this%vss%init(this%s, trim(unique_name) // 'vss')
198 call this%wss%init(this%s, trim(unique_name) // 'wss')
199 call this%uus%init(this%s, trim(unique_name) // 'uus')
200 call this%vvs%init(this%s, trim(unique_name) // 'vvs')
201 call this%wws%init(this%s, trim(unique_name) // 'wws')
202 call this%uvs%init(this%s, trim(unique_name) // 'uvs')
203 call this%uws%init(this%s, trim(unique_name) // 'uws')
204 call this%vws%init(this%s, trim(unique_name) // 'vws')
205
206 call this%ps%init(this%s, trim(unique_name) // 'ps')
207
208 call this%pdsdx%init(this%s, trim(unique_name) // 'pdsdx')
209 call this%pdsdy%init(this%s, trim(unique_name) // 'pdsdy')
210 call this%pdsdz%init(this%s, trim(unique_name) // 'pdsdz')
211
212 call this%udsdx%init(this%s, trim(unique_name) // 'udsdx')
213 call this%udsdy%init(this%s, trim(unique_name) // 'udsdy')
214 call this%udsdz%init(this%s, trim(unique_name) // 'udsdz')
215 call this%vdsdx%init(this%s, trim(unique_name) // 'vdsdx')
216 call this%vdsdy%init(this%s, trim(unique_name) // 'vdsdy')
217 call this%vdsdz%init(this%s, trim(unique_name) // 'vdsdz')
218 call this%wdsdx%init(this%s, trim(unique_name) // 'wdsdx')
219 call this%wdsdy%init(this%s, trim(unique_name) // 'wdsdy')
220 call this%wdsdz%init(this%s, trim(unique_name) // 'wdsdz')
221 call this%sdudx%init(this%s, trim(unique_name) // 'sdudx')
222 call this%sdudy%init(this%s, trim(unique_name) // 'sdudy')
223 call this%sdudz%init(this%s, trim(unique_name) // 'sdudz')
224 call this%sdvdx%init(this%s, trim(unique_name) // 'sdvdx')
225 call this%sdvdy%init(this%s, trim(unique_name) // 'sdvdy')
226 call this%sdvdz%init(this%s, trim(unique_name) // 'sdvdz')
227 call this%sdwdx%init(this%s, trim(unique_name) // 'sdwdx')
228 call this%sdwdy%init(this%s, trim(unique_name) // 'sdwdy')
229 call this%sdwdz%init(this%s, trim(unique_name) // 'sdwdz')
230
231 call this%ess%init(this%s, trim(unique_name) // 'ess')
232 call this%eus%init(this%s, trim(unique_name) // 'eus')
233 call this%evs%init(this%s, trim(unique_name) // 'evs')
234 call this%ews%init(this%s, trim(unique_name) // 'ews')
235 end if
236
237 call this%stat_fields%init(this%n_stats)
238
239 call this%stat_fields%assign_to_field(1, this%s_mean%mf)
240
241 call this%stat_fields%assign_to_field(2, this%us%mf)
242 call this%stat_fields%assign_to_field(3, this%vs%mf)
243 call this%stat_fields%assign_to_field(4, this%ws%mf)
244
245 call this%stat_fields%assign_to_field(5, this%ss%mf)
246
247 if (this%n_stats .eq. 42) then
248 call this%stat_fields%assign_to_field(6, this%sss%mf)
249 call this%stat_fields%assign_to_field(7, this%ssss%mf)
250
251 call this%stat_fields%assign_to_field(8, this%uss%mf)
252 call this%stat_fields%assign_to_field(9, this%vss%mf)
253 call this%stat_fields%assign_to_field(10, this%wss%mf)
254 call this%stat_fields%assign_to_field(11, this%uus%mf)
255 call this%stat_fields%assign_to_field(12, this%vvs%mf)
256 call this%stat_fields%assign_to_field(13, this%wws%mf)
257 call this%stat_fields%assign_to_field(14, this%uvs%mf)
258 call this%stat_fields%assign_to_field(15, this%uws%mf)
259 call this%stat_fields%assign_to_field(16, this%vws%mf)
260
261 call this%stat_fields%assign_to_field(17, this%ps%mf)
262
263 call this%stat_fields%assign_to_field(18, this%pdsdx%mf)
264 call this%stat_fields%assign_to_field(19, this%pdsdy%mf)
265 call this%stat_fields%assign_to_field(20, this%pdsdz%mf)
266
267 call this%stat_fields%assign_to_field(21, this%udsdx%mf)
268 call this%stat_fields%assign_to_field(22, this%udsdy%mf)
269 call this%stat_fields%assign_to_field(23, this%udsdz%mf)
270 call this%stat_fields%assign_to_field(24, this%vdsdx%mf)
271 call this%stat_fields%assign_to_field(25, this%vdsdy%mf)
272 call this%stat_fields%assign_to_field(26, this%vdsdz%mf)
273 call this%stat_fields%assign_to_field(27, this%wdsdx%mf)
274 call this%stat_fields%assign_to_field(28, this%wdsdy%mf)
275 call this%stat_fields%assign_to_field(29, this%wdsdz%mf)
276
277 call this%stat_fields%assign_to_field(30, this%sdudx%mf)
278 call this%stat_fields%assign_to_field(31, this%sdudy%mf)
279 call this%stat_fields%assign_to_field(32, this%sdudz%mf)
280 call this%stat_fields%assign_to_field(33, this%sdvdx%mf)
281 call this%stat_fields%assign_to_field(34, this%sdvdy%mf)
282 call this%stat_fields%assign_to_field(35, this%sdvdz%mf)
283 call this%stat_fields%assign_to_field(36, this%sdwdx%mf)
284 call this%stat_fields%assign_to_field(37, this%sdwdy%mf)
285 call this%stat_fields%assign_to_field(38, this%sdwdz%mf)
286
287 call this%stat_fields%assign_to_field(39, this%ess%mf)
288 call this%stat_fields%assign_to_field(40, this%eus%mf)
289 call this%stat_fields%assign_to_field(41, this%evs%mf)
290 call this%stat_fields%assign_to_field(42, this%ews%mf)
291 end if
292
293 end subroutine scalar_stats_init
294
297 subroutine scalar_stats_update(this, k)
298 class(scalar_stats_t), intent(inout) :: this
299 real(kind=rp), intent(in) :: k
300 type(field_t), pointer :: work
301 type(field_t), pointer :: dsdx, dsdy, dsdz
303 type(field_t), pointer :: dx, dy, dz
304 integer :: idx(7)
305
306 associate(s => this%s, u => this%u, v => this%v, w => this%w, &
307 p => this%p)
308
309 call this%s_mean%update(k)
310
311 call this%us%update_col3(k, u, s)
312 call this%vs%update_col3(k, v, s)
313 call this%ws%update_col3(k, w, s)
314
315 call this%ss%update_col3(k, s, s)
316
317 if (this%n_stats .eq. 5) return
318
319 call neko_scratch_registry%request_field(work, idx(1), &
320 this%u%dof, .false.)
321
322 call field_col3(work, s, s)
323 call this%sss%update_col3(k, work, s)
324 call this%ssss%update_col3(k, work, work)
325 call this%uss%update_col3(k, u, work)
326 call this%vss%update_col3(k, v, work)
327 call this%wss%update_col3(k, w, work)
328
329 call field_col3(work, u, u)
330 call this%uus%update_col3(k, work, s)
331 call field_col3(work, v, v)
332 call this%vvs%update_col3(k, work, s)
333 call field_col3(work, w, w)
334 call this%wws%update_col3(k, work, s)
335 call field_col3(work, u, v)
336 call this%uvs%update_col3(k, work, s)
337 call field_col3(work, u, w)
338 call this%uws%update_col3(k, work, s)
339 call field_col3(work, v, w)
340 call this%vws%update_col3(k, work, s)
341
342 call neko_scratch_registry%relinquish_field(idx(1))
343
344 call this%ps%update_col3(k, p, s)
345
346 call neko_scratch_registry%request_field(dsdx, idx(2), &
347 this%u%dof, .false.)
348 call neko_scratch_registry%request_field(dsdy, idx(3), &
349 this%u%dof, .false.)
350 call neko_scratch_registry%request_field(dsdz, idx(4), &
351 this%u%dof, .false.)
352 call neko_scratch_registry%request_field(dx, idx(5), &
353 this%u%dof, .false.)
354 call neko_scratch_registry%request_field(dy, idx(6), &
355 this%u%dof, .false.)
356 call neko_scratch_registry%request_field(dz, idx(7), &
357 this%u%dof, .false.)
358
359 call opgrad(dsdx%x, dsdy%x, dsdz%x, s%x, this%coef)
360
361 call this%pdsdx%update_col3(k, dsdx, p)
362 call this%pdsdy%update_col3(k, dsdy, p)
363 call this%pdsdz%update_col3(k, dsdz, p)
364
365 call this%udsdx%update_col3(k, dsdx, u)
366 call this%udsdy%update_col3(k, dsdy, u)
367 call this%udsdz%update_col3(k, dsdz, u)
368 call this%vdsdx%update_col3(k, dsdx, v)
369 call this%vdsdy%update_col3(k, dsdy, v)
370 call this%vdsdz%update_col3(k, dsdz, v)
371 call this%wdsdx%update_col3(k, dsdx, w)
372 call this%wdsdy%update_col3(k, dsdy, w)
373 call this%wdsdz%update_col3(k, dsdz, w)
374
375 call this%ess%update_dot3(k, dsdx, dsdy, dsdz, dsdx, dsdy, dsdz)
376
377 ! The velocity gradients are only ever combined with the scalar
378 ! gradient, so one velocity component at a time is enough.
379 call opgrad(dx%x, dy%x, dz%x, u%x, this%coef)
380 call this%sdudx%update_col3(k, dx, s)
381 call this%sdudy%update_col3(k, dy, s)
382 call this%sdudz%update_col3(k, dz, s)
383 call this%eus%update_dot3(k, dx, dy, dz, dsdx, dsdy, dsdz)
384
385 call opgrad(dx%x, dy%x, dz%x, v%x, this%coef)
386 call this%sdvdx%update_col3(k, dx, s)
387 call this%sdvdy%update_col3(k, dy, s)
388 call this%sdvdz%update_col3(k, dz, s)
389 call this%evs%update_dot3(k, dx, dy, dz, dsdx, dsdy, dsdz)
390
391 call opgrad(dx%x, dy%x, dz%x, w%x, this%coef)
392 call this%sdwdx%update_col3(k, dx, s)
393 call this%sdwdy%update_col3(k, dy, s)
394 call this%sdwdz%update_col3(k, dz, s)
395 call this%ews%update_dot3(k, dx, dy, dz, dsdx, dsdy, dsdz)
396
397 call neko_scratch_registry%relinquish_field(idx(2:7))
398 end associate
399
400 end subroutine scalar_stats_update
401
402
404 subroutine scalar_stats_free(this)
405 class(scalar_stats_t), intent(inout) :: this
406
407 call this%s_mean%free()
408
409 call this%us%free()
410 call this%vs%free()
411 call this%ws%free()
412
413 call this%ss%free()
414
415 if (this%n_stats .eq. 42) then
416 call this%sss%free()
417 call this%ssss%free()
418
419 call this%uss%free()
420 call this%vss%free()
421 call this%wss%free()
422
423 call this%uus%free()
424 call this%vvs%free()
425 call this%wws%free()
426 call this%uvs%free()
427 call this%uws%free()
428 call this%vws%free()
429
430 call this%ps%free()
431
432 call this%pdsdx%free()
433 call this%pdsdy%free()
434 call this%pdsdz%free()
435
436 call this%udsdx%free()
437 call this%udsdy%free()
438 call this%udsdz%free()
439 call this%vdsdx%free()
440 call this%vdsdy%free()
441 call this%vdsdz%free()
442 call this%wdsdx%free()
443 call this%wdsdy%free()
444 call this%wdsdz%free()
445
446 call this%sdudx%free()
447 call this%sdudy%free()
448 call this%sdudz%free()
449 call this%sdvdx%free()
450 call this%sdvdy%free()
451 call this%sdvdz%free()
452 call this%sdwdx%free()
453 call this%sdwdy%free()
454 call this%sdwdz%free()
455
456 call this%ess%free()
457 call this%eus%free()
458 call this%evs%free()
459 call this%ews%free()
460 end if
461
462 call this%stat_fields%free()
463
464 nullify(this%coef)
465 nullify(this%s)
466 nullify(this%u)
467 nullify(this%v)
468 nullify(this%w)
469 nullify(this%p)
470
471 end subroutine scalar_stats_free
472
474 subroutine scalar_stats_reset(this)
475 class(scalar_stats_t), intent(inout), target:: this
476
477 call this%s_mean%reset()
478
479 call this%us%reset()
480 call this%vs%reset()
481 call this%ws%reset()
482
483 call this%ss%reset()
484
485 if (this%n_stats .eq. 42) then
486 call this%sss%reset()
487 call this%ssss%reset()
488
489 call this%uss%reset()
490 call this%vss%reset()
491 call this%wss%reset()
492
493 call this%uus%reset()
494 call this%vvs%reset()
495 call this%wws%reset()
496 call this%uvs%reset()
497 call this%uws%reset()
498 call this%vws%reset()
499
500 call this%ps%reset()
501
502 call this%pdsdx%reset()
503 call this%pdsdy%reset()
504 call this%pdsdz%reset()
505
506 call this%udsdx%reset()
507 call this%udsdy%reset()
508 call this%udsdz%reset()
509 call this%vdsdx%reset()
510 call this%vdsdy%reset()
511 call this%vdsdz%reset()
512 call this%wdsdx%reset()
513 call this%wdsdy%reset()
514 call this%wdsdz%reset()
515
516 call this%sdudx%reset()
517 call this%sdudy%reset()
518 call this%sdudz%reset()
519 call this%sdvdx%reset()
520 call this%sdvdy%reset()
521 call this%sdvdz%reset()
522 call this%sdwdx%reset()
523 call this%sdwdy%reset()
524 call this%sdwdz%reset()
525
526 call this%ess%reset()
527 call this%eus%reset()
528 call this%evs%reset()
529 call this%ews%reset()
530 end if
531
532 end subroutine scalar_stats_reset
533
534 ! Convert computed weak gradients to strong.
536 class(scalar_stats_t) :: this
537 integer :: n, i
538 real(kind=rp) :: wrk, wrk_sqr
539 type(field_t), pointer :: work
540 integer :: idx
541
542 if (this%n_stats .eq. 5) return
543
544 n = size(this%coef%B)
545
546 if (neko_bcknd_device .eq. 1) then
547 call neko_scratch_registry%request_field(work, idx, &
548 this%u%dof, .false.)
549 call device_cfill(work%x_d, 1.0_rp, n)
550 call device_invcol2(work%x_d, this%coef%B_d, n)
551
552 call device_col2(this%pdsdx%mf%x_d, work%x_d, n)
553 call device_col2(this%pdsdy%mf%x_d, work%x_d, n)
554 call device_col2(this%pdsdz%mf%x_d, work%x_d, n)
555
556 call device_col2(this%udsdx%mf%x_d, work%x_d, n)
557 call device_col2(this%udsdy%mf%x_d, work%x_d, n)
558 call device_col2(this%udsdz%mf%x_d, work%x_d, n)
559 call device_col2(this%vdsdx%mf%x_d, work%x_d, n)
560 call device_col2(this%vdsdy%mf%x_d, work%x_d, n)
561 call device_col2(this%vdsdz%mf%x_d, work%x_d, n)
562 call device_col2(this%wdsdx%mf%x_d, work%x_d, n)
563 call device_col2(this%wdsdy%mf%x_d, work%x_d, n)
564 call device_col2(this%wdsdz%mf%x_d, work%x_d, n)
565
566 call device_col2(this%sdudx%mf%x_d, work%x_d, n)
567 call device_col2(this%sdudy%mf%x_d, work%x_d, n)
568 call device_col2(this%sdudz%mf%x_d, work%x_d, n)
569 call device_col2(this%sdvdx%mf%x_d, work%x_d, n)
570 call device_col2(this%sdvdy%mf%x_d, work%x_d, n)
571 call device_col2(this%sdvdz%mf%x_d, work%x_d, n)
572 call device_col2(this%sdwdx%mf%x_d, work%x_d, n)
573 call device_col2(this%sdwdy%mf%x_d, work%x_d, n)
574 call device_col2(this%sdwdz%mf%x_d, work%x_d, n)
575
576 call device_col2(work%x_d, work%x_d, n)
577
578 call device_col2(this%ess%mf%x_d, work%x_d, n)
579 call device_col2(this%eus%mf%x_d, work%x_d, n)
580 call device_col2(this%evs%mf%x_d, work%x_d, n)
581 call device_col2(this%ews%mf%x_d, work%x_d, n)
582 call neko_scratch_registry%relinquish_field(idx)
583
584 else
585 !$omp parallel do private(i, wrk, wrk_sqr)
586 do i = 1, n
587 wrk = 1.0_rp / this%coef%B(i,1,1,1)
588 this%pdsdx%mf%x(i,1,1,1) = this%pdsdx%mf%x(i,1,1,1) * wrk
589 this%pdsdy%mf%x(i,1,1,1) = this%pdsdy%mf%x(i,1,1,1) * wrk
590 this%pdsdz%mf%x(i,1,1,1) = this%pdsdz%mf%x(i,1,1,1) * wrk
591
592 this%udsdx%mf%x(i,1,1,1) = this%udsdx%mf%x(i,1,1,1) * wrk
593 this%udsdy%mf%x(i,1,1,1) = this%udsdy%mf%x(i,1,1,1) * wrk
594 this%udsdz%mf%x(i,1,1,1) = this%udsdz%mf%x(i,1,1,1) * wrk
595
596 this%vdsdx%mf%x(i,1,1,1) = this%vdsdx%mf%x(i,1,1,1) * wrk
597 this%vdsdy%mf%x(i,1,1,1) = this%vdsdy%mf%x(i,1,1,1) * wrk
598 this%vdsdz%mf%x(i,1,1,1) = this%vdsdz%mf%x(i,1,1,1) * wrk
599
600 this%wdsdx%mf%x(i,1,1,1) = this%wdsdx%mf%x(i,1,1,1) * wrk
601 this%wdsdy%mf%x(i,1,1,1) = this%wdsdy%mf%x(i,1,1,1) * wrk
602 this%wdsdz%mf%x(i,1,1,1) = this%wdsdz%mf%x(i,1,1,1) * wrk
603
604 this%sdudx%mf%x(i,1,1,1) = this%sdudx%mf%x(i,1,1,1) * wrk
605 this%sdudy%mf%x(i,1,1,1) = this%sdudy%mf%x(i,1,1,1) * wrk
606 this%sdudz%mf%x(i,1,1,1) = this%sdudz%mf%x(i,1,1,1) * wrk
607
608 this%sdvdx%mf%x(i,1,1,1) = this%sdvdx%mf%x(i,1,1,1) * wrk
609 this%sdvdy%mf%x(i,1,1,1) = this%sdvdy%mf%x(i,1,1,1) * wrk
610 this%sdvdz%mf%x(i,1,1,1) = this%sdvdz%mf%x(i,1,1,1) * wrk
611
612 this%sdwdx%mf%x(i,1,1,1) = this%sdwdx%mf%x(i,1,1,1) * wrk
613 this%sdwdy%mf%x(i,1,1,1) = this%sdwdy%mf%x(i,1,1,1) * wrk
614 this%sdwdz%mf%x(i,1,1,1) = this%sdwdz%mf%x(i,1,1,1) * wrk
615
616 wrk_sqr = wrk * wrk
617
618 this%ess%mf%x(i,1,1,1) = this%ess%mf%x(i,1,1,1) * wrk_sqr
619 this%eus%mf%x(i,1,1,1) = this%eus%mf%x(i,1,1,1) * wrk_sqr
620 this%evs%mf%x(i,1,1,1) = this%evs%mf%x(i,1,1,1) * wrk_sqr
621 this%ews%mf%x(i,1,1,1) = this%ews%mf%x(i,1,1,1) * wrk_sqr
622 end do
623 !$omp end parallel do
624
625 end if
626
627 end subroutine scalar_stats_make_strong_grad
628
629end module scalar_stats
Coefficients.
Definition coef.f90:34
subroutine, public device_col2(a_d, b_d, n, strm)
Vector multiplication .
subroutine, public device_invcol2(a_d, b_d, n, strm)
Vector division .
subroutine, public device_cfill(a_d, c, n, strm)
Set all elements to a constant c .
subroutine, public field_col3(a, b, c, n)
Vector multiplication with 3 vectors .
Defines a field.
Definition field.f90:34
Implements mean_field_t.
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Operators.
Definition operators.f90:34
subroutine, public opgrad(ux, uy, uz, u, coef, es, ee)
Compute the weak gradient of a scalar field, i.e. the gradient multiplied by the mass matrix.
Computes various statistics for the scalar fields. We use the Reynolds decomposition for a field u = ...
subroutine scalar_stats_init(this, coef, s, u, v, w, p, set, name)
Constructor. Initialize the fields associated with scalar_stats.
subroutine scalar_stats_free(this)
Destructor.
subroutine scalar_stats_make_strong_grad(this)
subroutine scalar_stats_update(this, k)
Updates all fields with a new sample.
subroutine scalar_stats_reset(this)
Resets all the computed means values and sampling times to zero.
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
Defines a statistical quantity.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:136
field_list_t, To be able to group fields together
Computes the temporal mean of a field.
Abstract type defining a statistical quantity.