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
45 use neko_config
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=20) :: fields(3)
121
123 ! picks it up. Will also add those fields to the registry.
124 fields(1) = "u_hat"
125 fields(2) = "v_hat"
126 fields(3) = "w_hat"
127 call json%add("fields", fields)
128
129 call this%init_base(json, case)
130 call this%writer%init(json, case)
131
132 call spectral_error_init_from_components(this, case%fluid%c_Xh)
133
134 end subroutine spectral_error_init
135
139 class(spectral_error_t), intent(inout) :: this
140 type(coef_t), intent(in) :: coef
141 integer :: il, jl, aa
142 character(len=NEKO_FNAME_LEN) :: fname_speri
143
144 this%u => neko_registry%get_field("u")
145 this%v => neko_registry%get_field("v")
146 this%w => neko_registry%get_field("w")
147 this%u_hat => neko_registry%get_field("u_hat")
148 this%v_hat => neko_registry%get_field("v_hat")
149 this%w_hat => neko_registry%get_field("w_hat")
150
152 this%wk = this%u
153
155 allocate(this%eind_u(coef%msh%nelv))
156 allocate(this%eind_v(coef%msh%nelv))
157 allocate(this%eind_w(coef%msh%nelv))
158 allocate(this%sig_u(coef%msh%nelv))
159 allocate(this%sig_v(coef%msh%nelv))
160 allocate(this%sig_w(coef%msh%nelv))
161
163 associate(lx1 => coef%Xh%lx, ly1 => coef%Xh%ly, &
164 lz1 => coef%Xh%lz, &
165 seri_small => this%SERI_SMALL, &
166 seri_smallr => this%SERI_SMALLR, &
167 seri_smallg => this%SERI_SMALLG, &
168 seri_smalls => this%SERI_SMALLS, &
169 seri_np => this%SERI_NP, &
170 seri_np_max => this%SERI_NP_MAX, &
171 seri_elr => this%SERI_ELR &
172 )
173 ! correctness check
174 if (seri_np.gt.seri_np_max) then
175 call neko_log%message('SETI_NP greater than SERI_NP_MAX')
176 endif
177 il = seri_np+seri_elr
178 jl = min(lx1,ly1)
179 jl = min(jl,lz1)
180 if (il.gt.jl) then
181 call neko_log%message('SERI_NP+SERI_ELR greater than L?1')
182 endif
183 end associate
184
186
188 subroutine spectral_error_free(this)
189 class(spectral_error_t), intent(inout) :: this
190
191 if(allocated(this%eind_u)) then
192 deallocate(this%eind_u)
193 end if
194
195 if(allocated(this%eind_v)) then
196 deallocate(this%eind_v)
197 end if
198
199 if(allocated(this%eind_w)) then
200 deallocate(this%eind_w)
201 end if
202
203 if(allocated(this%sig_u)) then
204 deallocate(this%sig_u)
205 end if
206
207 if(allocated(this%sig_v)) then
208 deallocate(this%sig_v)
209 end if
210
211 if(allocated(this%sig_w)) then
212 deallocate(this%sig_w)
213 end if
214
215 call this%wk%free()
216 call this%speri_l%free()
217
218 nullify(this%u)
219 nullify(this%v)
220 nullify(this%w)
221 nullify(this%u_hat)
222 nullify(this%v_hat)
223 nullify(this%w_hat)
224
225 call this%writer%free()
226 call this%free_base()
227
228 end subroutine spectral_error_free
229
231 subroutine spectral_error_compute(this, time)
232 class(spectral_error_t), intent(inout) :: this
233 type(time_state_t), intent(in) :: time
234
235 integer :: e, i, lx, ly, lz, nelv, n
236
237
238 call this%get_indicators(this%case%fluid%c_Xh)
239
240 lx = this%u_hat%Xh%lx
241 ly = this%u_hat%Xh%ly
242 lz = this%u_hat%Xh%lz
243 nelv = this%u_hat%msh%nelv
244
246 do e = 1,nelv
247 do i = 1,lx*ly*lx
248 this%u_hat%x(i,1,1,e) = this%eind_u(e)
249 this%v_hat%x(i,1,1,e) = this%eind_v(e)
250 this%w_hat%x(i,1,1,e) = this%eind_w(e)
251 end do
252 end do
253
254 ! We need this copy to GPU since the field writer does an internal copy
255 ! GPU -> CPU before writing the field files. This overwrites the *_hat
256 ! host arrays that contain the values.
257 if (neko_bcknd_device .eq. 1) then
258 call device_memcpy(this%u_hat%x, this%u_hat%x_d, lx*ly*lz*nelv, &
259 host_to_device, sync = .true.)
260 call device_memcpy(this%v_hat%x, this%v_hat%x_d, lx*ly*lz*nelv, &
261 host_to_device, sync = .true.)
262 call device_memcpy(this%w_hat%x, this%w_hat%x_d, lx*ly*lz*nelv, &
263 host_to_device, sync = .true.)
264 end if
265
266 end subroutine spectral_error_compute
267
275 subroutine transform_to_spec_or_phys(u_hat, u, wk, coef, space)
276 type(field_t), intent(inout) :: u_hat
277 type(field_t), intent(inout) :: u
278 type(field_t), intent(inout) :: wk
279 type(coef_t), intent(inout) :: coef
280 character(len=4), intent(in) :: space
281 integer :: i, j, k, e, nxyz, nelv, n
282
284 nxyz = coef%Xh%lx*coef%Xh%lx*coef%Xh%lx
285 nelv = coef%msh%nelv
286 n = nxyz*nelv
287
289 if ((neko_bcknd_hip .eq. 1) .or. (neko_bcknd_cuda .eq. 1) .or. &
290 (neko_bcknd_opencl .eq. 1)) then
291 call device_copy(wk%x_d, u%x_d, n)
292 else
293 call copy(wk%x,u%x,n)
294 end if
295
296 select case(space)
297 case('spec')
298 call tnsr3d(u_hat%x, coef%Xh%lx, wk%x, &
299 coef%Xh%lx,coef%Xh%vinv, &
300 coef%Xh%vinvt, coef%Xh%vinvt, nelv)
301 case('phys')
302 call tnsr3d(u_hat%x, coef%Xh%lx, wk%x, &
303 coef%Xh%lx,coef%Xh%v, &
304 coef%Xh%vt, coef%Xh%vt, nelv)
305 end select
306
307 ! Synchronize
308 if ((neko_bcknd_hip .eq. 1) .or. (neko_bcknd_cuda .eq. 1) .or. &
309 (neko_bcknd_opencl .eq. 1)) then
310
311 call device_memcpy(u_hat%x,u_hat%x_d, n, &
312 device_to_host, sync=.true.)
313 end if
314
315 end subroutine transform_to_spec_or_phys
316
319 subroutine spectral_error_get_indicators(this,coef)
320 class(spectral_error_t), intent(inout) :: this
321 type(coef_t), intent(inout) :: coef
322 integer :: i
323
324 ! Generate the uvwhat field (legendre coeff)
325 call transform_to_spec_or_phys(this%u_hat, this%u, this%wk, coef, 'spec')
326 call transform_to_spec_or_phys(this%v_hat, this%v, this%wk, coef, 'spec')
327 call transform_to_spec_or_phys(this%w_hat, this%w, this%wk, coef, 'spec')
328
329 ! Get the spectral error indicator
330 call calculate_indicators(this, coef, this%eind_u, this%sig_u, &
331 coef%msh%nelv, coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, &
332 this%u_hat%x)
333 call calculate_indicators(this, coef, this%eind_v, this%sig_v, &
334 coef%msh%nelv, coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, &
335 this%v_hat%x)
336 call calculate_indicators(this, coef, this%eind_w, this%sig_w, &
337 coef%msh%nelv, coef%Xh%lx, coef%Xh%ly, coef%Xh%lz, &
338 this%w_hat%x)
339
340 end subroutine spectral_error_get_indicators
341
344 subroutine spectral_error_write(this, t)
345 class(spectral_error_t), intent(inout) :: this
346 real(kind=rp), intent(in) :: t
347
348 integer i, e
349 integer lx, ly, lz, nelv
350
354 call this%mf_speri%write(this%speri_l,t)
355
356 end subroutine spectral_error_write
357
367 subroutine calculate_indicators(this, coef, eind, sig, lnelt, LX1, LY1, LZ1, var)
368 type(spectral_error_t), intent(inout) :: this
369 type(coef_t), intent(in) :: coef
370 integer :: lnelt
371 integer :: LX1
372 integer :: LY1
373 integer :: LZ1
374 real(kind=rp) :: eind(lnelt)
375 real(kind=rp) :: sig(lnelt)
376 real(kind=rp) :: var(lx1,ly1,lz1,lnelt)
377
378 real(kind=rp) :: xa(coef%Xh%lx,coef%Xh%ly,coef%Xh%lz)
379 real(kind=rp) :: xb(coef%Xh%lx,coef%Xh%ly,coef%Xh%lz)
380 integer :: i, e
381
382 ! zero arrays
383 call rzero(eind,lnelt)
384 call rzero(sig,lnelt)
385
386 ! Get the indicator
387 call speri_var(this, eind,sig,var,lnelt,xa,xb, lx1, ly1, lz1)
388
389 end subroutine calculate_indicators
390
391
402 subroutine speri_var(this, est,sig,var,nell,xa,xb,LX1,LY1,LZ1)
403 type(spectral_error_t), intent(inout) :: this
404 integer :: nell
405 integer :: LX1
406 integer :: LY1
407 integer :: LZ1
408 real(kind=rp) :: est(nell)
409 real(kind=rp) :: sig(nell)
410 real(kind=rp) :: var(lx1,ly1,lz1,nell)
411 real(kind=rp) :: xa(lx1,ly1,lz1)
412 real(kind=rp) :: xb(lx1,ly1,lz1)
413
415 integer :: il, jl, kl, ll, j_st, j_en, ii
417 real(kind=rp) :: coeff(lx1,ly1,lz1)
419 real(kind=rp) :: coef11
421 real(kind=rp) :: coefx(this%SERI_NP_MAX,ly1,lz1), &
422 coefy(this%SERI_NP_MAX,lx1,lz1), &
423 coefz(this%SERI_NP_MAX,lx1,ly1)
425 real(kind=rp) :: estx, esty, estz
427 real(kind=rp) :: sigx, sigy, sigz
428 real(kind=rp) :: third
429 parameter(third = 1.0/3.0)
430
432 do il = 1,nell
435 do ii = 1, lx1*ly1*lz1
436 coeff(ii,1,1) = var(ii,1,1,il) * var(ii,1,1,il)
437 end do
438
440 coef11 = coeff(1,1,1)
441
443 if (coef11.ge.this%SERI_SMALL) then
448 j_st = max(1,lx1-this%SERI_NP+1-this%SERI_ELR)
449 j_en = max(1,lx1-this%SERI_ELR)
450 do ll = 1,lz1
451 do kl = 1,ly1
452 do jl = j_st,j_en
453 coefx(j_en-jl+1,kl,ll) = coeff(jl,kl,ll)
454 enddo
455 enddo
456 enddo
458 call speri_extrap(this,estx,sigx,coef11,coefx, &
459 j_st,j_en,ly1,lz1)
460
464 j_st = max(1,ly1-this%SERI_NP+1-this%SERI_ELR)
465 j_en = max(1,ly1-this%SERI_ELR)
466 do ll = 1,lz1
467 do kl = j_st,j_en
468 do jl = 1,lx1
469 coefy(j_en-kl+1,jl,ll) = coeff(jl,kl,ll)
470 enddo
471 enddo
472 enddo
474 call speri_extrap(this, esty,sigy,coef11,coefy, &
475 j_st,j_en,lx1,lz1)
476
480 j_st = max(1,lz1-this%SERI_NP+1-this%SERI_ELR)
481 j_en = max(1,lz1-this%SERI_ELR)
482 do ll = j_st,j_en
483 do kl = 1,ly1
484 do jl = 1,lx1
485 coefz(j_en-ll+1,jl,kl) = coeff(jl,kl,ll)
486 enddo
487 enddo
488 enddo
490 call speri_extrap(this, estz,sigz,coef11,coefz, &
491 j_st,j_en,lx1,ly1)
492
494 est(il) = sqrt(estx + esty + estz)
495 sig(il) = third*(sigx + sigy + sigz)
496
497 else
499 estx = 0.0
500 esty = 0.0
501 estz = 0.0
502 sigx = -1.0
503 sigy = -1.0
504 sigz = -1.0
506
507 est(il) = 0.0
508 sig(il) = -1.0
509 endif
510
511 end do
512
513 end subroutine speri_var
514
524 subroutine speri_extrap(this,estx,sigx,coef11,coef, &
525 ix_st,ix_en,nyl,nzl)
526 implicit none
527 type(spectral_error_t), intent(inout) :: this
529 integer :: ix_st,ix_en,nyl,nzl
531 real(kind=rp) :: coef(this%SERI_NP_MAX,nyl,nzl)
533 real(kind=rp) :: coef11
535 real(kind=rp) :: estx, sigx
536
538 integer :: il, jl, kl, ll ! loop index
539 integer :: nsigt, pnr, nzlt
540 real(kind=rp) :: sigt, smallr, cmin, cmax, cnm, rtmp, rtmp2, rtmp3
541 real(kind=rp) :: sumtmp(4), cffl(this%SERI_NP_MAX)
542 real(kind=rp) :: stmp, estt, clog, ctmp, cave, erlog
543 logical :: cuse(this%seri_np_max)
544
545 associate(seri_small => this%SERI_SMALL, &
546 seri_smallr => this%SERI_SMALLR, &
547 seri_smallg => this%SERI_SMALLG, &
548 seri_smalls => this%SERI_SMALLS, &
549 seri_np => this%SERI_NP, &
550 seri_np_max => this%SERI_NP_MAX, &
551 seri_elr => this%SERI_ELR &
552 )
553 ! initial values
554 estx = 0.0
555 sigx = -1.0
556
557 ! relative cutoff
558 smallr = coef11*seri_smallr
559
560 ! number of points
561 pnr = ix_en - ix_st +1
562
563 ! to few points to interpolate
564 !if ((ix_en - ix_st).le.1) return
565
566 ! for averaging, initial values
567 sigt = 0.0
568 nsigt = 0
569
570 ! loop over all face points
571 nzlt = max(1,nzl - seri_elr) ! for 2D runs
572 do il=1,nzlt
573 ! weight
574 rtmp3 = 1.0/(2.0*(il-1)+1.0)
575 do jl=1,nyl - seri_elr
576
577 ! find min and max coef along single row
578 cffl(1) = coef(1,jl,il)
579 cmin = cffl(1)
580 cmax = cmin
581 do kl =2,pnr
582 cffl(kl) = coef(kl,jl,il)
583 cmin = min(cmin,cffl(kl))
584 cmax = max(cmax,cffl(kl))
585 enddo
586
587 ! are coefficients sufficiently big
588 if((cmin.gt.0.0).and.(cmax.gt.smallr)) then
589 ! mark array position we use in iterpolation
590 do kl =1,pnr
591 cuse(kl) = .true.
592 enddo
593 ! max n for polynomial order
594 cnm = real(ix_en)
595
596 ! check if all the points should be taken into account
597 ! in original code by Catherine Mavriplis this part is written
598 ! for 4 points, so I place if statement first
599 if (pnr.eq.4) then
600 ! should we neglect last values
601 if ((cffl(1).lt.smallr).and. &
602 (cffl(2).lt.smallr)) then
603 if (cffl(3).lt.smallr) then
604 cuse(1) = .false.
605 cuse(2) = .false.
606 cnm = real(ix_en-2)
607 else
608 cuse(1) = .false.
609 cnm = real(ix_en-1)
610 endif
611 else
612 ! should we take stronger gradient
613 if ((cffl(1)/cffl(2).lt.seri_smallg).and. &
614 (cffl(3)/cffl(4).lt.seri_smallg)) then
615 cuse(1) = .false.
616 cuse(3) = .false.
617 cnm = real(ix_en-1)
618 elseif ((cffl(2)/cffl(1).lt.seri_smallg).and. &
619 (cffl(4)/cffl(3).lt.seri_smallg)) then
620 cuse(2) = .false.
621 cuse(4) = .false.
622 endif
623 endif
624 endif
625
626 ! get sigma for given face point
627 do kl =1,4
628 sumtmp(kl) = 0.0
629 enddo
630 ! find new min and count number of points
631 cmin = cmax
632 cmax = 0.0
633 do kl =1,pnr
634 if(cuse(kl)) then
635 rtmp = real(ix_en-kl)
636 rtmp2 = log(cffl(kl))
637 sumtmp(1) = sumtmp(1) +rtmp2
638 sumtmp(2) = sumtmp(2) +rtmp
639 sumtmp(3) = sumtmp(3) +rtmp*rtmp
640 sumtmp(4) = sumtmp(4) +rtmp2*rtmp
641 ! find new min and count used points
642 cmin = min(cffl(kl),cmin)
643 cmax = cmax + 1.0
644 endif
645 enddo
646 ! decay rate along single row
647 stmp = (sumtmp(1)*sumtmp(2) - sumtmp(4)*cmax)/ &
648 (sumtmp(3)*cmax - sumtmp(2)*sumtmp(2))
649 ! for averaging
650 sigt = sigt + stmp
651 nsigt = nsigt + 1
652
653 ! get error estimator depending on calculated decay rate
654 estt = 0.0
655 if (stmp.lt.seri_smalls) then
656 estt = cmin
657 else
658 ! get averaged constant in front of c*exp(-sig*n)
659 clog = (sumtmp(1)+stmp*sumtmp(2))/cmax
660 ctmp = exp(clog)
661 ! average exponent
662 cave = sumtmp(1)/cmax
663 ! check quality of approximation comparing is to the constant cave
664 do kl =1,2
665 sumtmp(kl) = 0.0
666 enddo
667 do kl =1,pnr
668 if(cuse(kl)) then
669 erlog = clog - stmp*real(ix_en-kl)
670 sumtmp(1) = sumtmp(1)+ &
671 (erlog-log(cffl(kl)))**2
672 sumtmp(2) = sumtmp(2)+ &
673 (erlog-cave)**2
674 endif
675 enddo
676 rtmp = 1.0 - sumtmp(1)/sumtmp(2)
677 if (rtmp.lt.seri_smalls) then
678 estt = cmin
679 else
680 ! last coefficient is not included in error estimator
681 estt = ctmp/stmp*exp(-stmp*cnm)
682 endif
683 endif
684 ! add contribution to error estimator; variable weight
685 estx = estx + estt/(2.0*(jl-1)+1.0)*rtmp3
686 endif ! if((cmin.gt.0.0).and.(cmax.gt.smallr))
687 enddo
688 enddo
689 ! constant weight
690 ! Multiplication by 4 in 2D / 8 in 3D
691 ! Normalization of the error by the volume of the reference element
692 ! which is equal to 4 in 2D / 8 in 3D
693 ! ==> Both operations cancel each other
694 estx = estx/(2.0*(ix_en-1)+1.0)
695
696 ! final everaging
697 ! sigt = 2*sigma so we divide by 2
698 if (nsigt.gt.0) then
699 sigx = 0.5*sigt/nsigt
700 endif
701
702 end associate
703
704 end subroutine speri_extrap
705
706end 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
Gather-scatter.
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:76
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, 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:128
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