Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
overset_interface.f90
Go to the documentation of this file.
1! Copyright (c) 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!
35 use comm, only : neko_global_comm
37 use registry, only : neko_registry
38 use num_types, only : rp
39 use coefs, only : coef_t
42 use mask, only : mask_t
43 use bc, only : bc_t, bc_dirichlet
44 use field_list, only : field_list_t
45 use math, only : masked_copy_0, copy
47 use vector, only : vector_t
49 use vector_list, only : vector_list_t
53 use device, only : device_to_host
57 use stack, only : stack_i4_t
58 use json_module, only : json_file
60 use field, only : field_t
62 use logger, only : neko_log, log_size
64 use mpi_f08, only : mpi_allreduce, mpi_integer, mpi_sum
65 use, intrinsic :: iso_c_binding, only : c_ptr
67 use time_state, only : time_state_t
68 implicit none
69 private
70
72 type, public, extends(bc_t) :: overset_interface_t
74 type(field_dirichlet_t) :: bc_s
78 character(len=:), allocatable :: field_name
80 type(global_interpolation_t) :: interface_interpolator
82 type(mask_t) :: interface_dof_mask
83 type(mask_t) :: domain_element_mask
85 type(vector_t) :: x_dof, y_dof, z_dof
86 type(vector_t) :: x_interface_dof, y_interface_dof, z_interface_dof
88 type(vector_t) :: s_interface
89 type(vector_series_t) :: s_interface_lag
90 integer :: iextm_order = 1
92 real(kind=rp) :: relaxation = 1.0_rp
93 integer :: last_tstep = -1
94 type(vector_list_t) :: interface_dof, interface_field
96 type(global_interpolation_settings_t) :: interpolation_settings
97 integer :: n_int_tot = 0
98 logical :: find_interface = .false.
99 logical :: setup = .false.
100 logical :: log = .false.
102 logical :: restart_pending = .false.
103
106 procedure(morph_overset_interface), nopass, pointer :: &
107 morph_interface => null()
108
109 contains
111 procedure, pass(this) :: init => overset_interface_init
113 procedure, pass(this) :: init_from_components => &
116 procedure, pass(this) :: free => overset_interface_free
118 procedure, pass(this) :: finalize => overset_interface_finalize
120 procedure, pass(this) :: apply_scalar => overset_interface_apply_scalar
122 procedure, pass(this) :: apply_vector => overset_interface_apply_vector
124 procedure, pass(this) :: apply_vector_dev => &
127 procedure, pass(this) :: apply_scalar_dev => &
129 procedure, pass(this) :: update => overset_interface_update
131 procedure, pass(this) :: restart_scalar => overset_interface_restart
132
134 procedure, pass(this), private :: build_masks_ => build_masks_
136 procedure, pass(this), private :: gather_interface_dofs_ => &
139 procedure, pass(this), private :: setup_interpolator_ => &
142 procedure, pass(this), private :: log_interface_error_ => &
145 procedure, pass(this), private :: relax_interface_value_ => &
147 end type overset_interface_t
148
149 abstract interface
150
165 subroutine morph_overset_interface(interface_dof, interface_field, &
166 interface_mask, time, bc_name, &
167 find_interface)
169 type(vector_list_t), intent(inout) :: interface_dof
170 type(vector_list_t), intent(inout) :: interface_field
171 type(mask_t), intent(in) :: interface_mask
172 type(time_state_t), intent(in) :: time
173 character(len=*), intent(in) :: bc_name
174 logical, intent(inout) :: find_interface
175 end subroutine morph_overset_interface
176 end interface
177
179
180contains
181
185 subroutine overset_interface_init(this, coef, json)
186 class(overset_interface_t), intent(inout), target :: this
187 type(coef_t), target, intent(in) :: coef
188 type(json_file), intent(inout) :: json
189 character(len=:), allocatable :: field_name
190 real(kind=rp) :: tol, pad, relaxation
191 logical :: log
192
193 call json_get(json, "field_name", field_name)
194 call json_get_or_default(json, "interpolation.tolerance", tol, -1.0_rp)
195 call json_get_or_default(json, "interpolation.padding", pad, -1.0_rp)
196 call json_get_or_default(json, "order", this%iextm_order, 1)
197 if (this%iextm_order .lt. 1 .or. this%iextm_order .gt. 3) then
198 call neko_error("The order of the IEXTm time scheme must be 1 to 3.")
199 end if
200 call json_get_or_default(json, "relaxation", relaxation, 1.0_rp)
201 if (relaxation .le. 0.0_rp .or. relaxation .gt. 1.0_rp) then
202 call neko_error("The overset relaxation factor must be in (0, 1].")
203 end if
204 call json_get_or_default(json, "log", log, .false.)
205
206 call this%init_from_components(coef, field_name, tol, pad, log, relaxation)
207 if (allocated(field_name)) deallocate(field_name)
208
209 end subroutine overset_interface_init
210
214 subroutine overset_interface_init_from_components(this, coef, field_name, &
215 tol, pad, log, relaxation)
216 class(overset_interface_t), intent(inout), target :: this
217 type(coef_t), intent(in) :: coef
218 character(len=*), intent(in) :: field_name
219 real(kind=rp), intent(in), optional :: tol, pad, relaxation
220 logical, intent(in), optional :: log
221 character(len=256) :: log_buf
222
223 call this%init_base(coef)
224 this%bc_type = bc_dirichlet
225 this%relaxation = 1.0_rp
226 this%last_tstep = -1
227 this%restart_pending = .false.
228
229 if (present(tol)) then
230 if (tol .gt. 0.0_rp) then
231 this%interpolation_settings%tolerance = tol
232 end if
233 end if
234
235 if (present(pad)) then
236 if (pad .gt. 0.0_rp) then
237 this%interpolation_settings%padding = pad
238 end if
239 end if
240
241 if (present(log)) then
242 this%log = log
243 end if
244
245 if (present(relaxation)) then
246 if (relaxation .le. 0.0_rp .or. relaxation .gt. 1.0_rp) then
247 call neko_error("The overset relaxation factor must be in (0, 1].")
248 end if
249 this%relaxation = relaxation
250 end if
251
252 this%field_name = field_name
253 write (log_buf, '(A,A)') "Coupling overset interface for: ", &
254 trim(this%field_name)
255 call neko_log%message(log_buf)
256
257 call this%bc_s%init_from_components(coef, this%field_name)
258 call this%field_list%init(1)
259 call this%field_list%assign_to_field(1, this%bc_s%field_bc)
260
261 call this%x_dof%init(this%dof%size(), 'x')
262 call this%y_dof%init(this%dof%size(), 'y')
263 call this%z_dof%init(this%dof%size(), 'z')
264
265 if (neko_bcknd_device .eq. 1) then
266 call device_copy(this%x_dof%x_d, this%dof%x%x_d, this%dof%size())
267 call device_copy(this%y_dof%x_d, this%dof%y%x_d, this%dof%size())
268 call device_copy(this%z_dof%x_d, this%dof%z%x_d, this%dof%size())
269
270 call this%x_dof%copy_from(device_to_host, sync = .false.)
271 call this%y_dof%copy_from(device_to_host, sync = .false.)
272 call this%z_dof%copy_from(device_to_host, sync = .true.)
273 else
274 call copy(this%x_dof%x, this%dof%x%x, this%dof%size())
275 call copy(this%y_dof%x, this%dof%y%x, this%dof%size())
276 call copy(this%z_dof%x, this%dof%z%x, this%dof%size())
277 end if
278
280
282 subroutine overset_interface_free(this)
283 class(overset_interface_t), target, intent(inout) :: this
284
285 call this%bc_s%free()
286 call this%field_list%free()
287 call this%interface_dof%free()
288 call this%interface_field%free()
289
290 call this%x_dof%free()
291 call this%y_dof%free()
292 call this%z_dof%free()
293
294 call this%x_interface_dof%free()
295 call this%y_interface_dof%free()
296 call this%z_interface_dof%free()
297 call this%s_interface%free()
298 call this%s_interface_lag%free()
299
300 if (allocated(this%field_name)) then
301 deallocate(this%field_name)
302 end if
303
304 call this%interface_interpolator%free()
305
306 call this%interface_dof_mask%free()
307 call this%domain_element_mask%free()
308
309 call this%free_base()
310 this%restart_pending = .false.
311 end subroutine overset_interface_free
312
318 subroutine overset_interface_restart(this, s, slag)
319 class(overset_interface_t), intent(inout) :: this
320 type(field_t), intent(in) :: s
321 type(field_series_t), intent(in), optional :: slag
322 integer :: i, n_previous
323
324 call this%s_interface_lag%reset()
325
326 n_previous = 0
327 if (present(slag)) then
328 n_previous = min(this%iextm_order - 1, slag%size())
329 do i = n_previous, 1, -1
330 call vector_masked_gather_copy(this%s_interface, &
331 slag%lf(i)%x(:,1,1,1), this%interface_dof_mask, &
332 slag%lf(i)%dof%size())
333 call this%s_interface_lag%update()
334 end do
335 end if
336
337 call vector_masked_gather_copy(this%s_interface, &
338 s%x(:,1,1,1), this%interface_dof_mask, s%dof%size())
339
340 this%restart_pending = .true.
341 end subroutine overset_interface_restart
342
347 subroutine overset_interface_apply_scalar(this, x, n, time, strong)
348 class(overset_interface_t), intent(inout) :: this
349 integer, intent(in) :: n
350 real(kind=rp), intent(inout), dimension(n) :: x
351 type(time_state_t), intent(in), optional :: time
352 logical, intent(in), optional :: strong
353 logical :: strong_
354
355 if (present(strong)) then
356 strong_ = strong
357 else
358 strong_ = .true.
359 end if
360
361 if (strong_) then
362 call profiler_start_region('Overset scalar apply')
363 !$omp single
364 if (.not. this%updated) then
365 call this%update(time)
366 this%updated = .true.
367 end if
368 !$omp end single
369
370 call masked_copy_0(x, this%bc_s%field_bc%x, this%msk, n, this%msk(0))
371 call profiler_end_region('Overset scalar apply')
372 end if
373
374 end subroutine overset_interface_apply_scalar
375
380 subroutine overset_interface_apply_scalar_dev(this, x_d, time, strong, strm)
381 class(overset_interface_t), intent(inout), target :: this
382 type(c_ptr), intent(inout) :: x_d
383 type(time_state_t), intent(in), optional :: time
384 logical, intent(in), optional :: strong
385 type(c_ptr), intent(inout) :: strm
386 logical :: strong_
387
388 if (present(strong)) then
389 strong_ = strong
390 else
391 strong_ = .true.
392 end if
393
394 if (strong_) then
395 call profiler_start_region('Overset scalar apply')
396 !$omp single
397 if (.not. this%updated) then
398 call this%update(time)
399 this%updated = .true.
400 end if
401 !$omp end single
402
403 if (this%msk(0) .gt. 0) then
404 call device_masked_copy_0(x_d, this%bc_s%field_bc%x_d, &
405 this%bc_s%msk_d, this%bc_s%dof%size(), this%msk(0), strm)
406 end if
407 call profiler_end_region('Overset scalar apply')
408 end if
409
411
413 subroutine overset_interface_apply_vector(this, x, y, z, n, time, strong)
414 class(overset_interface_t), intent(inout) :: this
415 integer, intent(in) :: n
416 real(kind=rp), intent(inout), dimension(n) :: x
417 real(kind=rp), intent(inout), dimension(n) :: y
418 real(kind=rp), intent(inout), dimension(n) :: z
419 type(time_state_t), intent(in), optional :: time
420 logical, intent(in), optional :: strong
421
422 call neko_error("overset_interface cannot apply vector BCs.&
423 & Use overset_interface_vector instead!")
424
425 end subroutine overset_interface_apply_vector
426
428 subroutine overset_interface_apply_vector_dev(this, x_d, y_d, z_d, time, &
429 strong, strm)
430 class(overset_interface_t), intent(inout), target :: this
431 type(c_ptr), intent(inout) :: x_d
432 type(c_ptr), intent(inout) :: y_d
433 type(c_ptr), intent(inout) :: z_d
434 type(time_state_t), intent(in), optional :: time
435 logical, intent(in), optional :: strong
436 type(c_ptr), intent(inout) :: strm
437
438 call neko_error("overset_interface cannot apply vector BCs.&
439 & Use overset_interface_vector instead!")
440
442
445 class(overset_interface_t), target, intent(inout) :: this
446
447 call this%finalize_base()
448
449 call this%bc_s%mark_facets(this%marked_facet)
450 call this%bc_s%finalize()
451
452 call this%build_masks_()
453
454 call this%x_interface_dof%init(this%interface_dof_mask%size(), &
455 'x_interface')
456 call this%y_interface_dof%init(this%interface_dof_mask%size(), &
457 'y_interface')
458 call this%z_interface_dof%init(this%interface_dof_mask%size(), &
459 'z_interface')
460 call this%gather_interface_dofs_()
461
462 call this%setup_interpolator_()
463
464 call this%s_interface%init(this%interface_dof_mask%size(), 's_interface')
465
466 call this%interface_dof%init(3)
467 call this%interface_dof%assign_to_vector(1, this%x_interface_dof)
468 call this%interface_dof%assign_to_vector(2, this%y_interface_dof)
469 call this%interface_dof%assign_to_vector(3, this%z_interface_dof)
470
471 call this%interface_field%init(1)
472 call this%interface_field%assign_to_vector(1, this%s_interface)
473
474 call this%s_interface_lag%init(this%s_interface, this%iextm_order)
475
476 call mpi_allreduce(this%s_interface%size(), this%n_int_tot, 1, mpi_integer, &
477 mpi_sum, neko_global_comm)
478
479 end subroutine overset_interface_finalize
480
482 subroutine overset_interface_update(this, time)
483 class(overset_interface_t), intent(inout) :: this
484 type(time_state_t), intent(in) :: time
485 type(field_t), pointer :: s
486 type(iextm_time_scheme_t) :: time_scheme
487 integer :: nhist, ihist
488 real(kind=rp) :: iextm_coeffs(4)
489 logical :: new_tstep
490
491 call profiler_start_region('Overset scalar update')
492
494 call this%morph_interface(this%interface_dof, this%interface_field, &
495 this%interface_dof_mask, time, this%name, &
496 this%find_interface)
497
498 call profiler_start_region('Overset scalar interp')
499
501 if (this%find_interface) then
502
503 ! sync
504 call this%x_interface_dof%copy_from(device_to_host, sync = .false.)
505 call this%y_interface_dof%copy_from(device_to_host, sync = .false.)
506 call this%z_interface_dof%copy_from(device_to_host, sync = .true.)
507
508 call this%interface_interpolator%find_points(this%x_interface_dof%x, &
509 this%y_interface_dof%x, this%z_interface_dof%x, &
510 this%x_interface_dof%size())
511 this%find_interface = .false.
512
513 end if
514
515 s => neko_registry%get_field(trim(this%field_name))
516
517 ! The current accepted interface value is restored locally from the
518 ! solution field, so cross-domain interpolation is unnecessary once.
519 if (.not. this%restart_pending) then
520 call this%interface_interpolator%evaluate_masked(this%s_interface%x, &
521 s%x, this%domain_element_mask, .false.)
522 end if
523
524 call profiler_end_region('Overset scalar interp')
525
526 if (.not. this%restart_pending) then
527 if (this%log) then
528 call this%log_interface_error_(s)
529 end if
530 end if
531
532 new_tstep = time%tstep .ne. this%last_tstep
533
534 if (new_tstep) then
535 call profiler_start_region('Overset scalar extrap')
536 this%last_tstep = time%tstep
537
538 call this%s_interface_lag%update()
539
540 nhist = min(this%s_interface_lag%filled_size(), this%iextm_order)
541 call time_scheme%compute_coeffs(iextm_coeffs, &
542 real(time%dtlag, kind=rp), nhist)
543
544 call vector_cmult2(this%s_interface, this%s_interface_lag%lv(1), &
545 iextm_coeffs(1))
546 do ihist = 2, nhist
547 call vector_add2s2(this%s_interface, this%s_interface_lag%lv(ihist), &
548 iextm_coeffs(ihist))
549 end do
550
551 this%restart_pending = .false.
552 call profiler_end_region('Overset scalar extrap')
553 end if
554
555 ! Preserve the IEXT prediction on the first pass of every physical
556 ! timestep. Relax only subsequent Schwarz corrections at the same tstep.
557 if (.not. new_tstep) call this%relax_interface_value_()
558
559 call vector_masked_scatter_copy(this%bc_s%field_bc%x(:,1,1,1), &
560 this%s_interface, this%interface_dof_mask, this%bc_s%dof%size())
561
562 nullify(s)
563
564 call profiler_end_region('Overset scalar update')
565
566 end subroutine overset_interface_update
567
574 subroutine relax_interface_value_(this)
575 class(overset_interface_t), intent(inout) :: this
576 type(vector_t), pointer :: previous
577 integer :: ind(1)
578 logical :: clear_scratch = .false.
579
580 ! A factor of one recovers the original, unrelaxed Schwarz iteration.
581 if (this%relaxation .ge. 1.0_rp) return
582
583 ! Gather the preceding scalar iterate into reusable temporary storage.
584 call neko_scratch_registry%request_vector(previous, ind(1), &
585 this%s_interface%size(), clear_scratch)
586 call vector_masked_gather_copy(previous, this%bc_s%field_bc%x(:,1,1,1), &
587 this%interface_dof_mask, this%bc_s%dof%size())
588
589 ! Relax the new scalar donor data against the preceding iterate.
590 call vector_cmult(this%s_interface, this%relaxation)
591 call vector_add2s2(this%s_interface, previous, &
592 1.0_rp - this%relaxation)
593
594 ! Return the temporary storage to the scratch registry.
595 call neko_scratch_registry%relinquish(ind)
596
597 end subroutine relax_interface_value_
598
600 subroutine log_interface_error_(this, s)
601 class(overset_interface_t), intent(inout) :: this
602 type(field_t), pointer, intent(in) :: s
603 real(kind=rp) :: s_int_norm
604 type(vector_t), pointer :: error
605 integer :: ind(1)
606 logical :: clear_scratch = .false.
607 character(len=256) :: log_buf
608
609 call neko_scratch_registry%request_vector(error, ind(1), this%s_interface%size(), &
610 clear_scratch)
611 call vector_masked_gather_copy(error, s%x(:,1,1,1), this%interface_dof_mask, &
612 this%dof%size())
613 call vector_add2s2(error, this%s_interface, -1.0_rp)
614 s_int_norm = sqrt(vector_glsc2(error, error)) / sqrt(real(this%n_int_tot, kind=rp))
615 call neko_scratch_registry%relinquish(ind)
616
617 write(log_buf, '(A12,A3,A10,1x,E15.7)') 'Interface BC', ' | ', &
618 'L2 Error: ', s_int_norm
619 call neko_log%message(log_buf)
620
621 end subroutine log_interface_error_
622
623 !===================
624 ! Helper subroutines
625 !===================
626
628 subroutine build_masks_(this)
629 class(overset_interface_t), intent(inout) :: this
630 type(mask_t) :: temp_mask
631 logical, allocatable :: found(:)
632 integer :: i, j, k, e, nelems
633 integer :: lx, ly, lz
634 integer :: nonlinear_idx(4), linear_idx
635 type(stack_i4_t) :: idx_stack
636
637 call this%interface_dof_mask%init(this%msk(1:this%msk(0)), this%msk(0))
638
639 lx = this%Xh%lx
640 ly = this%Xh%ly
641 lz = this%Xh%lz
642
643 allocate(found(this%msh%nelv))
644 found = .false.
645
646 do i = 1, this%msk(0)
647 linear_idx = this%msk(i)
648 nonlinear_idx = nonlinear_index(linear_idx, lx, ly, lz)
649 found(nonlinear_idx(4)) = .true.
650 end do
651
652 nelems = 0
653 call idx_stack%init()
654 do e = 1, this%msh%nelv
655 if (found(e)) then
656 nelems = nelems + 1
657 do k = 1, this%Xh%lz
658 do j = 1, this%Xh%ly
659 do i = 1, this%Xh%lx
660 linear_idx = linear_index(i, j, k, e, lx, ly, lz)
661 call idx_stack%push(linear_idx)
662 end do
663 end do
664 end do
665 end if
666 end do
667
668 deallocate(found)
669
670 call temp_mask%init(idx_stack%array(), idx_stack%size())
671 call idx_stack%free()
672
673 call this%domain_element_mask%invert_mask(temp_mask, this%dof%size())
674 call temp_mask%free()
675
676 end subroutine build_masks_
677
679 subroutine gather_interface_dofs_(this)
680 class(overset_interface_t), intent(inout) :: this
681
682 call vector_masked_gather_copy(this%x_interface_dof, this%dof%x%x(:,1,1,1), &
683 this%interface_dof_mask, this%dof%size())
684 call vector_masked_gather_copy(this%y_interface_dof, this%dof%y%x(:,1,1,1), &
685 this%interface_dof_mask, this%dof%size())
686 call vector_masked_gather_copy(this%z_interface_dof, this%dof%z%x(:,1,1,1), &
687 this%interface_dof_mask, this%dof%size())
688
689 call this%x_interface_dof%copy_from(device_to_host, sync = .false.)
690 call this%y_interface_dof%copy_from(device_to_host, sync = .false.)
691 call this%z_interface_dof%copy_from(device_to_host, sync = .true.)
692
693 end subroutine gather_interface_dofs_
694
696 subroutine setup_interpolator_(this)
697 class(overset_interface_t), intent(inout) :: this
698
699 call this%interface_interpolator%init(this%dof, &
701 tol = this%interpolation_settings%tolerance, &
702 pad = this%interpolation_settings%padding, &
703 mask = this%domain_element_mask)
704
705 call this%interface_interpolator%find_points(this%x_interface_dof%x, &
706 this%y_interface_dof%x, this%z_interface_dof%x, &
707 this%x_interface_dof%size())
708
709 end subroutine setup_interpolator_
710
711end module overset_interface
__inline__ __device__ void nonlinear_index(const int idx, const int lx, int *index)
Definition bc_utils.h:44
double real
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.
User callback for overset-interface morphing and boundary-value updates.
Defines a boundary condition.
Definition bc.f90:34
integer, parameter, public bc_dirichlet
Supported boundary condition types. The values are set in order of precedence for global resolution....
Definition bc.f90:67
Coefficients.
Definition coef.f90:34
Definition comm.F90:1
type(mpi_comm), public neko_global_comm
Definition comm.F90:47
subroutine, public device_copy(a_d, b_d, n, strm)
Copy a vector .
subroutine, public device_masked_copy_0(a_d, b_d, mask_d, n, n_mask, strm)
Copy a masked vector .
Device abstraction, common interface for various accelerators.
Definition device.F90:34
integer, parameter, public device_to_host
Definition device.F90:48
Defines user dirichlet condition for a scalar field.
Contains the field_serties_t type.
Defines a field.
Definition field.f90:34
Implements global_interpolation given a dofmap.
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:92
integer, parameter, public log_size
Definition log.f90:46
Object for handling masks in Neko.
Definition mask.f90:34
Definition math.F90:60
subroutine, public copy(a, b, n)
Copy a vector .
Definition math.F90:305
subroutine, public masked_copy_0(a, b, mask, n, n_mask)
Copy a masked vector .
Definition math.F90:326
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Defines overset interface scalar boundary conditions.
subroutine overset_interface_finalize(this)
Finalize by building the mask arrays and preparing interpolation data.
subroutine overset_interface_update(this, time)
Update values at the overset interface.
subroutine overset_interface_apply_scalar(this, x, n, time, strong)
Apply scalar.
subroutine gather_interface_dofs_(this)
Gather interface dofs.
subroutine overset_interface_apply_vector(this, x, y, z, n, time, strong)
(No-op) Apply vector.
subroutine overset_interface_free(this)
Destructor.
subroutine overset_interface_apply_scalar_dev(this, x_d, time, strong, strm)
Apply scalar (device).
subroutine overset_interface_restart(this, s, slag)
Restore scalar interface history from an accepted solution field. The lag series is present for trans...
subroutine overset_interface_init_from_components(this, coef, field_name, tol, pad, log, relaxation)
Constructor from components.
subroutine log_interface_error_(this, s)
Log interface RMSE for the scalar field.
subroutine overset_interface_init(this, coef, json)
Constructor.
subroutine setup_interpolator_(this)
Set up the global interpolator.
subroutine relax_interface_value_(this)
Under-relax a Schwarz correction using the previously applied interface. Blend the new donor value g_...
subroutine build_masks_(this)
Build masks.
subroutine overset_interface_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
(No-op) Apply vector (device).
Profiling interface.
Definition profiler.F90:34
subroutine, public profiler_start_region(name, region_id)
Started a named (name) profiler region.
Definition profiler.F90:79
subroutine, public profiler_end_region(name, region_id)
End the most recently started profiler region.
Definition profiler.F90:116
Defines a registry for storing solution fields.
Definition registry.f90:34
type(registry_t), target, public neko_registry
Global field registry.
Definition registry.f90:158
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.
Implements a dynamic stack ADT.
Definition stack.f90:49
Base class for time integration schemes.
Module with things related to the simulation time.
Utilities.
Definition utils.f90:35
pure integer function, public linear_index(i, j, k, l, lx, ly, lz)
Compute the address of a (i,j,k,l) array with sizes (1:lx, 1:ly, 1:lz, :)
Definition utils.f90:328
subroutine, public vector_cmult(a, c, n)
Multiplication by constant c .
subroutine, public vector_masked_gather_copy(a, b, mask, n)
Gather a vector to reduced contigous array .
real(kind=rp) function, public vector_glsc2(a, b, n)
subroutine, public vector_add2s2(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on second argument)
subroutine, public vector_masked_scatter_copy(a, b, mask, n)
Scatter a contiguous vector into an array .
subroutine, public vector_cmult2(a, b, c, n)
Multiplication by constant c .
Contains the vector_series_t type.
Defines a vector.
Definition vector.f90:34
Base type for a boundary condition.
Definition bc.f90:73
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:136
User defined dirichlet condition, for which the user can work with an entire field....
field_list_t, To be able to group fields together
Stores a series (sequence) of fields, logically connected to a base field, and arranged according to ...
Implements the settings helper data container for global interpolation.
Implements global interpolation for arbitrary points in the domain.
Explicit interface extrapolation scheme for overset grids.
Type for consistently handling masks in Neko. This type encapsulates the mask array and its associate...
Definition mask.f90:51
Overset interface BC for a scalar field.
Integer based stack.
Definition stack.f90:77
A struct that contains all info about the time, expand as needed.
vector_list_t, To be able to group vectors together
Stores a series (sequence) of vectors, logically connected to a base vector, and arranged according t...