Neko 1.99.2
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
spectral_error.f90
Go to the documentation of this file.
1! Copyright (c) 2022, 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!
35 use num_types, only : rp
36 use field, only : field_t
37 use coefs, only : coef_t
38 use field_list, only : field_list_t
39 use math, only : rzero, copy
40 use file, only : file_t, file_free
41 use time_state, only : time_state_t
42 use tensor, only : tnsr3d
43 use device_math, only : device_copy
46 use logger, only : neko_log
48 use comm, only : pe_rank
52 use json_module, only : json_file
54 use case, only : case_t
55 use registry, only : neko_registry
56
57 use, intrinsic :: iso_c_binding
58 implicit none
59 private
60
66 type, public, extends(simulation_component_t) :: spectral_error_t
68 type(field_t), pointer :: u => null()
69 type(field_t), pointer :: v => null()
70 type(field_t), pointer :: w => null()
72 type(field_t), pointer :: u_hat => null()
73 type(field_t), pointer :: v_hat => null()
74 type(field_t), pointer :: w_hat => null()
76 type(field_t) :: wk
78 real(kind=rp) :: seri_small = 1.e-14
80 real(kind=rp) :: seri_smallr = 1.e-10
82 real(kind=rp) :: seri_smallg = 1.e-5
84 real(kind=rp) :: seri_smalls = 0.2
86 integer :: seri_np = 4
87 integer :: seri_np_max = 4
89 integer :: seri_elr = 0
91 real(kind=rp), allocatable :: eind_u(:), eind_v(:), eind_w(:)
93 real(kind=rp), allocatable :: sig_u(:), sig_v(:), sig_w(:)
95 type(field_list_t) :: speri_l
97 type(file_t) :: mf_speri
99 type(field_writer_t) :: writer
100 contains
102 procedure, pass(this) :: init => spectral_error_init
104 procedure, pass(this) :: free => spectral_error_free
106 procedure, pass(this) :: compute_ => spectral_error_compute
108 procedure, pass(this) :: get_indicators => spectral_error_get_indicators
109
110 end type spectral_error_t
111
112contains
113
115 subroutine spectral_error_init(this, json, case)
116 class(spectral_error_t), intent(inout), target :: this
117 type(json_file), intent(inout) :: json
118 class(case_t), intent(inout), target :: case
119
120 character(len=:), allocatable :: name
121 character(len=20) :: fields(3)
122
123 call json_get_or_default(json, "name", name, "spectral_error")
124 this%name = name
126 ! picks it up. Will also add those fields to the registry.
127 fields(1) = "u_hat"
128 fields(2) = "v_hat"
129 fields(3) = "w_hat"
130 call json%add("fields", fields)
131
132 call this%init_base(json, case)
133 call this%writer%init(json, case)
134
135 call spectral_error_init_from_components(this, case%fluid%c_Xh)
136
137 end subroutine spectral_error_init
138
142 class(spectral_error_t), intent(inout) :: this
143 type(coef_t), intent(in) :: coef
144 integer :: il, jl, aa
145 character(len=NEKO_FNAME_LEN) :: fname_speri
146
147 this%u => neko_registry%get_field("u")
148 this%v => neko_registry%get_field("v")
149 this%w => neko_registry%get_field("w")
150 this%u_hat => neko_registry%get_field("u_hat")
151 this%v_hat => neko_registry%get_field("v_hat")
152 this%w_hat => neko_registry%get_field("w_hat")
153
155 this%wk = this%u
156
158 allocate(this%eind_u(coef%msh%nelv))
159 allocate(this%eind_v(coef%msh%nelv))
160 allocate(this%eind_w(coef%msh%nelv))
161 allocate(this%sig_u(coef%msh%nelv))
162 allocate(this%sig_v(coef%msh%nelv))
163 allocate(this%sig_w(coef%msh%nelv))
164
166 associate(lx1 => coef%Xh%lx, ly1 => coef%Xh%ly, &
167 lz1 => coef%Xh%lz, &
168 seri_small => this%SERI_SMALL, &
169 seri_smallr => this%SERI_SMALLR, &
170 seri_smallg => this%SERI_SMALLG, &
171 seri_smalls => this%SERI_SMALLS, &
172 seri_np => this%SERI_NP, &
173 seri_np_max => this%SERI_NP_MAX, &
174 seri_elr => this%SERI_ELR &
175 )
176 ! correctness check
177 if (seri_np .gt. seri_np_max) then
178 call neko_log%message('SETI_NP greater than SERI_NP_MAX')
179 end if
180 il = seri_np + seri_elr
181 jl = min(lx1, ly1)
182 jl = min(jl, lz1)
183 if (il .gt. jl) then
184 call neko_log%message('SERI_NP+SERI_ELR greater than L?1')
185 end if
186 end associate
187
189
191 subroutine spectral_error_free(this)
192 class(spectral_error_t), intent(inout) :: this
193
194 if (allocated(this%eind_u)) then
195 deallocate(this%eind_u)
196 end if
197
198 if (allocated(this%eind_v)) then
199 deallocate(this%eind_v)
200 end if
201
202 if (allocated(this%eind_w)) then
203 deallocate(this%eind_w)
204 end if
205
206 if (allocated(this%sig_u)) then
207 deallocate(this%sig_u)
208 end if
209
210 if (allocated(this%sig_v)) then
211 deallocate(this%sig_v)
212 end if
213
214 if (allocated(this%sig_w)) then
215 deallocate(this%sig_w)
216 end if
217
218 call this%wk%free()
219 call this%speri_l%free()
220
221 nullify(this%u)
222 nullify(this%v)
223 nullify(this%w)
224 nullify(this%u_hat)
225 nullify(this%v_hat)
226 nullify(this%w_hat)
227
228 call this%writer%free()
229 call this%free_base()
230
231 end subroutine spectral_error_free
232
234 subroutine spectral_error_compute(this, time)
235 class(spectral_error_t), intent(inout) :: this
236 type(time_state_t), intent(in) :: time
237
238 integer :: e, i, lx, ly, lz, nelv, n
239
240
241 call this%get_indicators(this%case%fluid%c_Xh)
242
243 lx = this%u_hat%Xh%lx
244 ly = this%u_hat%Xh%ly
245 lz = this%u_hat%Xh%lz
246 nelv = this%u_hat%msh%nelv
247
249 do e = 1, nelv
250 do i = 1, lx*ly*lx
251 this%u_hat%x(i, 1, 1, e) = this%eind_u(e)
252 this%v_hat%x(i, 1, 1, e) = this%eind_v(e)
253 this%w_hat%x(i, 1, 1, e) = this%eind_w(e)
254 end do
255 end do
256
257 ! We need this copy to GPU since the field writer does an internal copy
258 ! GPU -> CPU before writing the field files. This overwrites the *_hat
259 ! host arrays that contain the values.
260 if (neko_bcknd_device .eq. 1) then
261 call device_memcpy(this%u_hat%x, this%u_hat%x_d, lx*ly*lz*nelv, &
262 host_to_device, sync = .true.)
263 call device_memcpy(this%v_hat%x, this%v_hat%x_d, lx*ly*lz*nelv, &
264 host_to_device, sync = .true.)
265 call device_memcpy(this%w_hat%x, this%w_hat%x_d, lx*ly*lz*nelv, &
266 host_to_device, sync = .true.)
267 end if
268
269 end subroutine spectral_error_compute
270
279 subroutine transform_to_spec_or_phys(u_hat, u, wk, coef, space)
280 type(field_t), intent(inout) :: u_hat
281 type(field_t), intent(inout) :: u
282 type(field_t), intent(inout) :: wk
283 type(coef_t), intent(inout) :: coef
284 character(len=4), intent(in) :: space
285 integer :: i, j, k, e, nxyz, nelv, n
286
288 nxyz = coef%Xh%lx * coef%Xh%lx * coef%Xh%lx
289 nelv = coef%msh%nelv
290 n = nxyz*nelv
291
293 if ((neko_bcknd_hip .eq. 1) .or. (neko_bcknd_cuda .eq. 1) .or. &
294 (neko_bcknd_opencl .eq. 1)) then
295 call device_copy(wk%x_d, u%x_d, n)
296 else
297 call copy(wk%x, u%x, n)
298 end if
299
300 select case (space)
301 case ('spec')
302 call tnsr3d(u_hat%x, coef%Xh%lx, wk%x, &
303 coef%Xh%lx, coef%Xh%vinv, &
304 coef%Xh%vinvt, coef%Xh%vinvt, nelv)
305 case ('phys')
306 call tnsr3d(u_hat%x, coef%Xh%lx, wk%x, &
307 coef%Xh%lx, coef%Xh%v, &
308 coef%Xh%vt, coef%Xh%vt, nelv)
309 end select
310
311 ! Synchronize
312 if ((neko_bcknd_hip .eq. 1) .or. (neko_bcknd_cuda .eq. 1) .or. &
313 (neko_bcknd_opencl .eq. 1)) then
314
315 call device_memcpy(u_hat%x, u_hat%x_d, n, &
316 device_to_host, sync = .true.)
317 end if
318
319 end subroutine transform_to_spec_or_phys
320
323 subroutine spectral_error_get_indicators(this, coef)
324 class(spectral_error_t), intent(inout) :: this
325 type(coef_t), intent(inout) :: coef
326 integer :: i
327
328 ! Generate the uvwhat field (legendre coeff)
329 call transform_to_spec_or_phys(this%u_hat, this%u, this%wk, coef, 'spec')
330 call transform_to_spec_or_phys(this%v_hat, this%v, this%wk, coef, 'spec')
331 call transform_to_spec_or_phys(this%w_hat, this%w, this%wk, coef, 'spec')
332
333 ! Get the spectral error indicator
334 call calculate_indicators(this, coef, this%eind_u, this%sig_u, &
335 coef%msh%nelv, coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, &
336 this%u_hat%x)
337 call calculate_indicators(this, coef, this%eind_v, this%sig_v, &
338 coef%msh%nelv, coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, &
339 this%v_hat%x)
340 call calculate_indicators(this, coef, this%eind_w, this%sig_w, &
341 coef%msh%nelv, coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, &
342 this%w_hat%x)
343
344 end subroutine spectral_error_get_indicators
345
348 subroutine spectral_error_write(this, t)
349 class(spectral_error_t), intent(inout) :: this
350 real(kind=rp), intent(in) :: t
351
352 integer i, e
353 integer lx, ly, lz, nelv
354
358 call this%mf_speri%write(this%speri_l, t)
359
360 end subroutine spectral_error_write
361
371 subroutine calculate_indicators(this, coef, eind, sig, lnelt, LX1, LY1, LZ1, &
372 var)
373 type(spectral_error_t), intent(inout) :: this
374 type(coef_t), intent(in) :: coef
375 integer :: lnelt
376 integer :: LX1
377 integer :: LY1
378 integer :: LZ1
379 real(kind=rp) :: eind(lnelt)
380 real(kind=rp) :: sig(lnelt)
381 real(kind=rp) :: var(lx1, ly1, lz1, lnelt)
382
383 real(kind=rp) :: xa(coef%Xh%lx, coef%Xh%ly, coef%Xh%lz)
384 real(kind=rp) :: xb(coef%Xh%lx, coef%Xh%ly, coef%Xh%lz)
385 integer :: i, e
386
387 ! zero arrays
388 call rzero(eind, lnelt)
389 call rzero(sig, lnelt)
390
391 ! Get the indicator
392 call speri_var(this, eind, sig, var, lnelt, xa, xb, lx1, ly1, lz1)
393
394 end subroutine calculate_indicators
395
396
407 subroutine speri_var(this, est, sig, var, nell, xa, xb, LX1, LY1, LZ1)
408 type(spectral_error_t), intent(inout) :: this
409 integer :: nell
410 integer :: LX1
411 integer :: LY1
412 integer :: LZ1
413 real(kind=rp) :: est(nell)
414 real(kind=rp) :: sig(nell)
415 real(kind=rp) :: var(lx1, ly1, lz1, nell)
416 real(kind=rp) :: xa(lx1, ly1, lz1)
417 real(kind=rp) :: xb(lx1, ly1, lz1)
418
420 integer :: il, jl, kl, ll, j_st, j_en, ii
422 real(kind=rp) :: coeff(lx1, ly1, lz1)
424 real(kind=rp) :: coef11
426 real(kind=rp) :: coefx(this%SERI_NP_MAX, ly1, lz1), &
427 coefy(this%SERI_NP_MAX, lx1, lz1), &
428 coefz(this%SERI_NP_MAX, lx1, ly1)
430 real(kind=rp) :: estx, esty, estz
432 real(kind=rp) :: sigx, sigy, sigz
433 real(kind=rp) :: third
434 parameter(third = 1.0/3.0)
435
437 do il = 1, nell
440 do ii = 1, lx1*ly1*lz1
441 coeff(ii, 1, 1) = var(ii, 1, 1, il) * var(ii, 1, 1, il)
442 end do
443
445 coef11 = coeff(1, 1, 1)
446
448 if (coef11 .ge. this%SERI_SMALL) then
453 j_st = max(1, lx1 - this%SERI_NP + 1 - this%SERI_ELR)
454 j_en = max(1, lx1 - this%SERI_ELR)
455 do ll = 1, lz1
456 do kl = 1, ly1
457 do jl = j_st, j_en
458 coefx(j_en - jl + 1, kl, ll) = coeff(jl, kl, ll)
459 end do
460 end do
461 end do
463 call speri_extrap(this, estx, sigx, coef11, coefx, &
464 j_st, j_en, ly1, lz1)
465
469 j_st = max(1, ly1 - this%SERI_NP + 1 - this%SERI_ELR)
470 j_en = max(1, ly1 - this%SERI_ELR)
471 do ll = 1, lz1
472 do kl = j_st, j_en
473 do jl = 1, lx1
474 coefy(j_en - kl + 1, jl, ll) = coeff(jl, kl, ll)
475 end do
476 end do
477 end do
479 call speri_extrap(this, esty, sigy, coef11, coefy, &
480 j_st, j_en, lx1, lz1)
481
485 j_st = max(1, lz1 - this%SERI_NP + 1 - this%SERI_ELR)
486 j_en = max(1, lz1 - this%SERI_ELR)
487 do ll = j_st, j_en
488 do kl = 1, ly1
489 do jl = 1, lx1
490 coefz(j_en - ll + 1, jl, kl) = coeff(jl, kl, ll)
491 end do
492 end do
493 end do
495 call speri_extrap(this, estz, sigz, coef11, coefz, &
496 j_st, j_en, lx1, ly1)
497
499 est(il) = sqrt(estx + esty + estz)
500 sig(il) = third*(sigx + sigy + sigz)
501
502 else
504 estx = 0.0
505 esty = 0.0
506 estz = 0.0
507 sigx = -1.0
508 sigy = -1.0
509 sigz = -1.0
511
512 est(il) = 0.0
513 sig(il) = -1.0
514 end if
515
516 end do
517
518 end subroutine speri_var
519
529 subroutine speri_extrap(this, estx, sigx, coef11, coef, &
530 ix_st, ix_en, nyl, nzl)
531 implicit none
532 type(spectral_error_t), intent(inout) :: this
534 integer :: ix_st, ix_en, nyl, nzl
536 real(kind=rp) :: coef(this%SERI_NP_MAX, nyl, nzl)
538 real(kind=rp) :: coef11
540 real(kind=rp) :: estx, sigx
541
543 integer :: il, jl, kl, ll ! loop index
544 integer :: nsigt, pnr, nzlt
545 real(kind=rp) :: sigt, smallr, cmin, cmax, cnm, rtmp, rtmp2, rtmp3
546 real(kind=rp) :: sumtmp(4), cffl(this%SERI_NP_MAX)
547 real(kind=rp) :: stmp, estt, clog, ctmp, cave, erlog
548 logical :: cuse(this%seri_np_max)
549
550 associate(seri_small => this%SERI_SMALL, &
551 seri_smallr => this%SERI_SMALLR, &
552 seri_smallg => this%SERI_SMALLG, &
553 seri_smalls => this%SERI_SMALLS, &
554 seri_np => this%SERI_NP, &
555 seri_np_max => this%SERI_NP_MAX, &
556 seri_elr => this%SERI_ELR &
557 )
558 ! initial values
559 estx = 0.0
560 sigx = -1.0
561
562 ! relative cutoff
563 smallr = coef11*seri_smallr
564
565 ! number of points
566 pnr = ix_en - ix_st + 1
567
568 ! to few points to interpolate
569 !if ((ix_en - ix_st).le.1) return
570
571 ! for averaging, initial values
572 sigt = 0.0
573 nsigt = 0
574
575 ! loop over all face points
576 nzlt = max(1, nzl - seri_elr) ! for 2D runs
577 do il = 1, nzlt
578 ! weight
579 rtmp3 = 1.0/(2.0*(il - 1) + 1.0)
580 do jl = 1, nyl - seri_elr
581
582 ! find min and max coef along single row
583 cffl(1) = coef(1, jl, il)
584 cmin = cffl(1)
585 cmax = cmin
586 do kl = 2, pnr
587 cffl(kl) = coef(kl, jl, il)
588 cmin = min(cmin, cffl(kl))
589 cmax = max(cmax, cffl(kl))
590 end do
591
592 ! are coefficients sufficiently big
593 if ((cmin .gt. 0.0) .and. (cmax .gt. smallr)) then
594 ! mark array position we use in iterpolation
595 do kl = 1, pnr
596 cuse(kl) = .true.
597 end do
598 ! max n for polynomial order
599 cnm = real(ix_en)
600
601 ! check if all the points should be taken into account
602 ! in original code by Catherine Mavriplis this part is written
603 ! for 4 points, so I place if statement first
604 if (pnr .eq. 4) then
605 ! should we neglect last values
606 if ((cffl(1) .lt. smallr) .and. &
607 (cffl(2) .lt. smallr)) then
608 if (cffl(3) .lt. smallr) then
609 cuse(1) = .false.
610 cuse(2) = .false.
611 cnm = real(ix_en - 2)
612 else
613 cuse(1) = .false.
614 cnm = real(ix_en - 1)
615 end if
616 else
617 ! should we take stronger gradient
618 if ((cffl(1)/cffl(2) .lt. seri_smallg) .and. &
619 (cffl(3)/cffl(4) .lt. seri_smallg)) then
620 cuse(1) = .false.
621 cuse(3) = .false.
622 cnm = real(ix_en - 1)
623 elseif ((cffl(2)/cffl(1) .lt. seri_smallg) .and. &
624 (cffl(4)/cffl(3) .lt. seri_smallg)) then
625 cuse(2) = .false.
626 cuse(4) = .false.
627 end if
628 end if
629 end if
630
631 ! get sigma for given face point
632 do kl = 1, 4
633 sumtmp(kl) = 0.0
634 end do
635 ! find new min and count number of points
636 cmin = cmax
637 cmax = 0.0
638 do kl = 1, pnr
639 if (cuse(kl)) then
640 rtmp = real(ix_en - kl)
641 rtmp2 = log(cffl(kl))
642 sumtmp(1) = sumtmp(1) + rtmp2
643 sumtmp(2) = sumtmp(2) + rtmp
644 sumtmp(3) = sumtmp(3) + rtmp*rtmp
645 sumtmp(4) = sumtmp(4) + rtmp2*rtmp
646 ! find new min and count used points
647 cmin = min(cffl(kl), cmin)
648 cmax = cmax + 1.0
649 end if
650 end do
651 ! decay rate along single row
652 stmp = (sumtmp(1)*sumtmp(2) - sumtmp(4)*cmax)/ &
653 (sumtmp(3)*cmax - sumtmp(2)*sumtmp(2))
654 ! for averaging
655 sigt = sigt + stmp
656 nsigt = nsigt + 1
657
658 ! get error estimator depending on calculated decay rate
659 estt = 0.0
660 if (stmp .lt. seri_smalls) then
661 estt = cmin
662 else
663 ! get averaged constant in front of c*exp(-sig*n)
664 clog = (sumtmp(1)+stmp*sumtmp(2))/cmax
665 ctmp = exp(clog)
666 ! average exponent
667 cave = sumtmp(1)/cmax
668 ! check quality of approximation comparing is to the
669 ! constant cave
670 do kl = 1, 2
671 sumtmp(kl) = 0.0
672 end do
673 do kl = 1, pnr
674 if (cuse(kl)) then
675 erlog = clog - stmp*real(ix_en - kl)
676 sumtmp(1) = sumtmp(1) + &
677 (erlog - log(cffl(kl)))**2
678 sumtmp(2) = sumtmp(2) + &
679 (erlog - cave)**2
680 end if
681 end do
682 rtmp = 1.0 - sumtmp(1)/sumtmp(2)
683 if (rtmp .lt. seri_smalls) then
684 estt = cmin
685 else
686 ! last coefficient is not included in error estimator
687 estt = ctmp/stmp*exp(-stmp*cnm)
688 end if
689 end if
690 ! add contribution to error estimator; variable weight
691 estx = estx + estt/(2.0*(jl - 1) + 1.0)*rtmp3
692 end if ! if((cmin.gt.0.0).and.(cmax.gt.smallr))
693 end do
694 end do
695 ! constant weight
696 ! Multiplication by 4 in 2D / 8 in 3D
697 ! Normalization of the error by the volume of the reference element
698 ! which is equal to 4 in 2D / 8 in 3D
699 ! ==> Both operations cancel each other
700 estx = estx/(2.0*(ix_en - 1) + 1.0)
701
702 ! final everaging
703 ! sigt = 2*sigma so we divide by 2
704 if (nsigt .gt. 0) then
705 sigx = 0.5*sigt/nsigt
706 end if
707
708 end associate
709
710 end subroutine speri_extrap
711
712end module spectral_error
double real
Copy data between host and device (or device and device)
Definition device.F90:71
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Defines a simulation case.
Definition case.f90:34
Coefficients.
Definition coef.f90:34
Definition comm.F90:1
integer, public pe_rank
MPI rank.
Definition comm.F90:56
subroutine, public device_copy(a_d, b_d, n, strm)
Copy a vector .
Device abstraction, common interface for various accelerators.
Definition device.F90:34
integer, parameter, public host_to_device
Definition device.F90:47
integer, parameter, public device_to_host
Definition device.F90:47
Implements the field_writer_t type.
Defines a field.
Definition field.f90:34
Module for file I/O operations.
Definition file.f90:34
subroutine file_free(this)
File operation destructor.
Definition file.f90:156
Utilities for retrieving parameters from the case files.
Logging routines.
Definition log.f90:34
type(log_t), public neko_log
Global log stream.
Definition log.f90:77
Definition math.f90:60
subroutine, public copy(a, b, n)
Copy a vector .
Definition math.f90:249
subroutine, public rzero(a, n)
Zero a real vector.
Definition math.f90:205
Build configurations.
integer, parameter neko_bcknd_hip
integer, parameter neko_bcknd_device
integer, parameter neko_bcknd_opencl
integer, parameter neko_bcknd_cuda
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Defines a registry for storing solution fields.
Definition registry.f90:34
type(registry_t), target, public neko_registry
Global field registry.
Definition registry.f90:149
Simulation components are objects that encapsulate functionality that can be fit to a particular comp...
subroutine compute_(this, time)
Dummy compute function.
Defines a function space.
Definition space.f90:34
Implements type spectral_error_t.
subroutine speri_extrap(this, estx, sigx, coef11, coef, ix_st, ix_en, nyl, nzl)
Extrapolate the Legendre spectrum from the last points.
subroutine spectral_error_write(this, t)
Write error indicators in a field file.
subroutine spectral_error_free(this)
Destructor.
subroutine spectral_error_get_indicators(this, coef)
Transform and get the spectral error indicators.
subroutine spectral_error_init_from_components(this, coef)
Actual constructor.
subroutine spectral_error_init(this, json, case)
Constructor.
subroutine spectral_error_compute(this, time)
Compute the spectral error indicator.
subroutine speri_var(this, est, sig, var, nell, xa, xb, lx1, ly1, lz1)
Calculate the indicator in a specified variable.
subroutine calculate_indicators(this, coef, eind, sig, lnelt, lx1, ly1, lz1, var)
Wrapper for old fortran 77 subroutines.
subroutine transform_to_spec_or_phys(u_hat, u, wk, coef, space)
Transform a field u to u_hat into physical or spectral space the result of the transformation is in u...
Tensor operations.
Definition tensor.f90:61
subroutine, public tnsr3d(v, nv, u, nu, a, bt, ct, nelv)
Tensor product performed on nelv elements.
Definition tensor.f90:234
Module with things related to the simulation time.
Utilities.
Definition utils.f90:35
integer, parameter, public neko_fname_len
Definition utils.f90:40
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:56
field_list_t, To be able to group fields together
A simulation component that writes a 3d field to a file.
A wrapper around a polymorphic generic_file_t that handles its init. This is essentially a factory fo...
Definition file.f90:55
Base abstract class for simulation components.
Provides tools to calculate the spectral error indicator.
A struct that contains all info about the time, expand as needed.
#define max(a, b)
Definition tensor.cu:40