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
66 use time_state, only : time_state_t
67 implicit none
68 private
69
71 type, public, extends(bc_t) :: overset_interface_t
73 type(field_dirichlet_t) :: bc_s
77 character(len=:), allocatable :: field_name
79 type(global_interpolation_t) :: interface_interpolator
81 type(mask_t) :: interface_dof_mask
82 type(mask_t) :: domain_element_mask
84 type(vector_t) :: x_dof, y_dof, z_dof
85 type(vector_t) :: x_interface_dof, y_interface_dof, z_interface_dof
87 type(vector_t) :: s_interface
88 type(vector_series_t) :: s_interface_lag
89 integer :: iextm_order = 1
91 real(kind=rp) :: relaxation = 1.0_rp
92 integer :: last_tstep = -1
93 type(vector_list_t) :: interface_dof, interface_field
95 type(global_interpolation_settings_t) :: interpolation_settings
96 integer :: n_int_tot = 0
97 logical :: find_interface = .false.
98 logical :: setup = .false.
99 logical :: log = .false.
101 logical :: restart_pending = .false.
102
105 procedure(morph_overset_interface), nopass, pointer :: &
106 morph_interface => null()
107
108 contains
110 procedure, pass(this) :: init => overset_interface_init
112 procedure, pass(this) :: init_from_components => &
115 procedure, pass(this) :: free => overset_interface_free
117 procedure, pass(this) :: finalize => overset_interface_finalize
119 procedure, pass(this) :: apply_scalar => overset_interface_apply_scalar
121 procedure, pass(this) :: apply_vector => overset_interface_apply_vector
123 procedure, pass(this) :: apply_vector_dev => &
126 procedure, pass(this) :: apply_scalar_dev => &
128 procedure, pass(this) :: update => overset_interface_update
130 procedure, pass(this) :: restart_scalar => overset_interface_restart
131
133 procedure, pass(this), private :: build_masks_ => build_masks_
135 procedure, pass(this), private :: gather_interface_dofs_ => &
138 procedure, pass(this), private :: setup_interpolator_ => &
141 procedure, pass(this), private :: log_interface_error_ => &
144 procedure, pass(this), private :: relax_interface_value_ => &
146 end type overset_interface_t
147
148 abstract interface
149
164 subroutine morph_overset_interface(interface_dof, interface_field, &
165 interface_mask, time, bc_name, &
166 find_interface)
168 type(vector_list_t), intent(inout) :: interface_dof
169 type(vector_list_t), intent(inout) :: interface_field
170 type(mask_t), intent(in) :: interface_mask
171 type(time_state_t), intent(in) :: time
172 character(len=*), intent(in) :: bc_name
173 logical, intent(inout) :: find_interface
174 end subroutine morph_overset_interface
175 end interface
176
178
179contains
180
184 subroutine overset_interface_init(this, coef, json)
185 class(overset_interface_t), intent(inout), target :: this
186 type(coef_t), target, intent(in) :: coef
187 type(json_file), intent(inout) :: json
188 character(len=:), allocatable :: field_name
189 real(kind=rp) :: tol, pad, relaxation
190 logical :: log
191
192 call json_get(json, "field_name", field_name)
193 call json_get_or_default(json, "interpolation.tolerance", tol, -1.0_rp)
194 call json_get_or_default(json, "interpolation.padding", pad, -1.0_rp)
195 call json_get_or_default(json, "order", this%iextm_order, 1)
196 if (this%iextm_order .lt. 1 .or. this%iextm_order .gt. 3) then
197 call neko_error("The order of the IEXTm time scheme must be 1 to 3.")
198 end if
199 call json_get_or_default(json, "relaxation", relaxation, 1.0_rp)
200 if (relaxation .le. 0.0_rp .or. relaxation .gt. 1.0_rp) then
201 call neko_error("The overset relaxation factor must be in (0, 1].")
202 end if
203 call json_get_or_default(json, "log", log, .false.)
204
205 call this%init_from_components(coef, field_name, tol, pad, log, relaxation)
206 if (allocated(field_name)) deallocate(field_name)
207
208 end subroutine overset_interface_init
209
213 subroutine overset_interface_init_from_components(this, coef, field_name, &
214 tol, pad, log, relaxation)
215 class(overset_interface_t), intent(inout), target :: this
216 type(coef_t), intent(in) :: coef
217 character(len=*), intent(in) :: field_name
218 real(kind=rp), intent(in), optional :: tol, pad, relaxation
219 logical, intent(in), optional :: log
220 character(len=256) :: log_buf
221
222 call this%init_base(coef)
223 this%bc_type = bc_dirichlet
224 this%relaxation = 1.0_rp
225 this%last_tstep = -1
226 this%restart_pending = .false.
227
228 if (present(tol)) then
229 if (tol .gt. 0.0_rp) then
230 this%interpolation_settings%tolerance = tol
231 end if
232 end if
233
234 if (present(pad)) then
235 if (pad .gt. 0.0_rp) then
236 this%interpolation_settings%padding = pad
237 end if
238 end if
239
240 if (present(log)) then
241 this%log = log
242 end if
243
244 if (present(relaxation)) then
245 if (relaxation .le. 0.0_rp .or. relaxation .gt. 1.0_rp) then
246 call neko_error("The overset relaxation factor must be in (0, 1].")
247 end if
248 this%relaxation = relaxation
249 end if
250
251 this%field_name = field_name
252 write (log_buf, '(A,A)') "Coupling overset interface for: ", &
253 trim(this%field_name)
254 call neko_log%message(log_buf)
255
256 call this%bc_s%init_from_components(coef, this%field_name)
257 call this%field_list%init(1)
258 call this%field_list%assign_to_field(1, this%bc_s%field_bc)
259
260 call this%x_dof%init(this%dof%size(), 'x')
261 call this%y_dof%init(this%dof%size(), 'y')
262 call this%z_dof%init(this%dof%size(), 'z')
263
264 if (neko_bcknd_device .eq. 1) then
265 call device_copy(this%x_dof%x_d, this%dof%x%x_d, this%dof%size())
266 call device_copy(this%y_dof%x_d, this%dof%y%x_d, this%dof%size())
267 call device_copy(this%z_dof%x_d, this%dof%z%x_d, this%dof%size())
268
269 call this%x_dof%copy_from(device_to_host, sync = .false.)
270 call this%y_dof%copy_from(device_to_host, sync = .false.)
271 call this%z_dof%copy_from(device_to_host, sync = .true.)
272 else
273 call copy(this%x_dof%x, this%dof%x%x, this%dof%size())
274 call copy(this%y_dof%x, this%dof%y%x, this%dof%size())
275 call copy(this%z_dof%x, this%dof%z%x, this%dof%size())
276 end if
277
279
281 subroutine overset_interface_free(this)
282 class(overset_interface_t), target, intent(inout) :: this
283
284 call this%bc_s%free()
285 call this%field_list%free()
286 call this%interface_dof%free()
287 call this%interface_field%free()
288
289 call this%x_dof%free()
290 call this%y_dof%free()
291 call this%z_dof%free()
292
293 call this%x_interface_dof%free()
294 call this%y_interface_dof%free()
295 call this%z_interface_dof%free()
296 call this%s_interface%free()
297 call this%s_interface_lag%free()
298
299 if (allocated(this%field_name)) then
300 deallocate(this%field_name)
301 end if
302
303 call this%interface_interpolator%free()
304
305 call this%interface_dof_mask%free()
306 call this%domain_element_mask%free()
307
308 call this%free_base()
309 this%restart_pending = .false.
310 end subroutine overset_interface_free
311
317 subroutine overset_interface_restart(this, s, slag)
318 class(overset_interface_t), intent(inout) :: this
319 type(field_t), intent(in) :: s
320 type(field_series_t), intent(in), optional :: slag
321 integer :: i, n_previous
322
323 call this%s_interface_lag%reset()
324
325 n_previous = 0
326 if (present(slag)) then
327 n_previous = min(this%iextm_order - 1, slag%size())
328 do i = n_previous, 1, -1
329 call vector_masked_gather_copy(this%s_interface, &
330 slag%lf(i)%x(:,1,1,1), this%interface_dof_mask, &
331 slag%lf(i)%dof%size())
332 call this%s_interface_lag%update()
333 end do
334 end if
335
336 call vector_masked_gather_copy(this%s_interface, &
337 s%x(:,1,1,1), this%interface_dof_mask, s%dof%size())
338
339 this%restart_pending = .true.
340 end subroutine overset_interface_restart
341
346 subroutine overset_interface_apply_scalar(this, x, n, time, strong)
347 class(overset_interface_t), intent(inout) :: this
348 integer, intent(in) :: n
349 real(kind=rp), intent(inout), dimension(n) :: x
350 type(time_state_t), intent(in), optional :: time
351 logical, intent(in), optional :: strong
352 logical :: strong_
353
354 if (present(strong)) then
355 strong_ = strong
356 else
357 strong_ = .true.
358 end if
359
360 if (strong_) then
361 !$omp single
362 if (.not. this%updated) then
363 call this%update(time)
364 this%updated = .true.
365 end if
366 !$omp end single
367
368 call masked_copy_0(x, this%bc_s%field_bc%x, this%msk, n, this%msk(0))
369 end if
370
371 end subroutine overset_interface_apply_scalar
372
377 subroutine overset_interface_apply_scalar_dev(this, x_d, time, strong, strm)
378 class(overset_interface_t), intent(inout), target :: this
379 type(c_ptr), intent(inout) :: x_d
380 type(time_state_t), intent(in), optional :: time
381 logical, intent(in), optional :: strong
382 type(c_ptr), intent(inout) :: strm
383 logical :: strong_
384
385 if (present(strong)) then
386 strong_ = strong
387 else
388 strong_ = .true.
389 end if
390
391 if (strong_) then
392 !$omp single
393 if (.not. this%updated) then
394 call this%update(time)
395 this%updated = .true.
396 end if
397 !$omp end single
398
399 if (this%msk(0) .gt. 0) then
400 call device_masked_copy_0(x_d, this%bc_s%field_bc%x_d, &
401 this%bc_s%msk_d, this%bc_s%dof%size(), this%msk(0), strm)
402 end if
403 end if
404
406
408 subroutine overset_interface_apply_vector(this, x, y, z, n, time, strong)
409 class(overset_interface_t), intent(inout) :: this
410 integer, intent(in) :: n
411 real(kind=rp), intent(inout), dimension(n) :: x
412 real(kind=rp), intent(inout), dimension(n) :: y
413 real(kind=rp), intent(inout), dimension(n) :: z
414 type(time_state_t), intent(in), optional :: time
415 logical, intent(in), optional :: strong
416
417 call neko_error("overset_interface cannot apply vector BCs.&
418 & Use overset_interface_vector instead!")
419
420 end subroutine overset_interface_apply_vector
421
423 subroutine overset_interface_apply_vector_dev(this, x_d, y_d, z_d, time, &
424 strong, strm)
425 class(overset_interface_t), intent(inout), target :: this
426 type(c_ptr), intent(inout) :: x_d
427 type(c_ptr), intent(inout) :: y_d
428 type(c_ptr), intent(inout) :: z_d
429 type(time_state_t), intent(in), optional :: time
430 logical, intent(in), optional :: strong
431 type(c_ptr), intent(inout) :: strm
432
433 call neko_error("overset_interface cannot apply vector BCs.&
434 & Use overset_interface_vector instead!")
435
437
440 class(overset_interface_t), target, intent(inout) :: this
441
442 call this%finalize_base()
443
444 call this%bc_s%mark_facets(this%marked_facet)
445 call this%bc_s%finalize()
446
447 call this%build_masks_()
448
449 call this%x_interface_dof%init(this%interface_dof_mask%size(), &
450 'x_interface')
451 call this%y_interface_dof%init(this%interface_dof_mask%size(), &
452 'y_interface')
453 call this%z_interface_dof%init(this%interface_dof_mask%size(), &
454 'z_interface')
455 call this%gather_interface_dofs_()
456
457 call this%setup_interpolator_()
458
459 call this%s_interface%init(this%interface_dof_mask%size(), 's_interface')
460
461 call this%interface_dof%init(3)
462 call this%interface_dof%assign_to_vector(1, this%x_interface_dof)
463 call this%interface_dof%assign_to_vector(2, this%y_interface_dof)
464 call this%interface_dof%assign_to_vector(3, this%z_interface_dof)
465
466 call this%interface_field%init(1)
467 call this%interface_field%assign_to_vector(1, this%s_interface)
468
469 call this%s_interface_lag%init(this%s_interface, this%iextm_order)
470
471 call mpi_allreduce(this%s_interface%size(), this%n_int_tot, 1, mpi_integer, &
472 mpi_sum, neko_global_comm)
473
474 end subroutine overset_interface_finalize
475
477 subroutine overset_interface_update(this, time)
478 class(overset_interface_t), intent(inout) :: this
479 type(time_state_t), intent(in) :: time
480 type(field_t), pointer :: s
481 type(iextm_time_scheme_t) :: time_scheme
482 integer :: nhist, ihist
483 real(kind=rp) :: iextm_coeffs(4)
484 logical :: new_tstep
485
487 call this%morph_interface(this%interface_dof, this%interface_field, &
488 this%interface_dof_mask, time, this%name, &
489 this%find_interface)
490
492 if (this%find_interface) then
493
494 ! sync
495 call this%x_interface_dof%copy_from(device_to_host, sync = .false.)
496 call this%y_interface_dof%copy_from(device_to_host, sync = .false.)
497 call this%z_interface_dof%copy_from(device_to_host, sync = .true.)
498
499 call this%interface_interpolator%find_points(this%x_interface_dof%x, &
500 this%y_interface_dof%x, this%z_interface_dof%x, &
501 this%x_interface_dof%size())
502 this%find_interface = .false.
503
504 end if
505
506 s => neko_registry%get_field(trim(this%field_name))
507
508 ! The current accepted interface value is restored locally from the
509 ! solution field, so cross-domain interpolation is unnecessary once.
510 if (.not. this%restart_pending) then
511 call this%interface_interpolator%evaluate_masked(this%s_interface%x, &
512 s%x, this%domain_element_mask, .false.)
513
514 if (this%log) then
515 call this%log_interface_error_(s)
516 end if
517 end if
518
519 new_tstep = time%tstep .ne. this%last_tstep
520
521 if (new_tstep) then
522 this%last_tstep = time%tstep
523
524 call this%s_interface_lag%update()
525
526 nhist = min(this%s_interface_lag%filled_size(), this%iextm_order)
527 call time_scheme%compute_coeffs(iextm_coeffs, &
528 real(time%dtlag, kind=rp), nhist)
529
530 call vector_cmult2(this%s_interface, this%s_interface_lag%lv(1), &
531 iextm_coeffs(1))
532 do ihist = 2, nhist
533 call vector_add2s2(this%s_interface, this%s_interface_lag%lv(ihist), &
534 iextm_coeffs(ihist))
535 end do
536
537 this%restart_pending = .false.
538 end if
539
540 ! Preserve the IEXT prediction on the first pass of every physical
541 ! timestep. Relax only subsequent Schwarz corrections at the same tstep.
542 if (.not. new_tstep) call this%relax_interface_value_()
543
544 call vector_masked_scatter_copy(this%bc_s%field_bc%x(:,1,1,1), &
545 this%s_interface, this%interface_dof_mask, this%bc_s%dof%size())
546
547 nullify(s)
548
549 end subroutine overset_interface_update
550
557 subroutine relax_interface_value_(this)
558 class(overset_interface_t), intent(inout) :: this
559 type(vector_t), pointer :: previous
560 integer :: ind(1)
561 logical :: clear_scratch = .false.
562
563 ! A factor of one recovers the original, unrelaxed Schwarz iteration.
564 if (this%relaxation .ge. 1.0_rp) return
565
566 ! Gather the preceding scalar iterate into reusable temporary storage.
567 call neko_scratch_registry%request_vector(previous, ind(1), &
568 this%s_interface%size(), clear_scratch)
569 call vector_masked_gather_copy(previous, this%bc_s%field_bc%x(:,1,1,1), &
570 this%interface_dof_mask, this%bc_s%dof%size())
571
572 ! Relax the new scalar donor data against the preceding iterate.
573 call vector_cmult(this%s_interface, this%relaxation)
574 call vector_add2s2(this%s_interface, previous, &
575 1.0_rp - this%relaxation)
576
577 ! Return the temporary storage to the scratch registry.
578 call neko_scratch_registry%relinquish(ind)
579
580 end subroutine relax_interface_value_
581
583 subroutine log_interface_error_(this, s)
584 class(overset_interface_t), intent(inout) :: this
585 type(field_t), pointer, intent(in) :: s
586 real(kind=rp) :: s_int_norm
587 type(vector_t), pointer :: error
588 integer :: ind(1)
589 logical :: clear_scratch = .false.
590 character(len=256) :: log_buf
591
592 call neko_scratch_registry%request_vector(error, ind(1), this%s_interface%size(), &
593 clear_scratch)
594 call vector_masked_gather_copy(error, s%x(:,1,1,1), this%interface_dof_mask, &
595 this%dof%size())
596 call vector_add2s2(error, this%s_interface, -1.0_rp)
597 s_int_norm = sqrt(vector_glsc2(error, error)) / sqrt(real(this%n_int_tot, kind=rp))
598 call neko_scratch_registry%relinquish(ind)
599
600 write(log_buf, '(A12,A3,A10,1x,E15.7)') 'Interface BC', ' | ', &
601 'L2 Error: ', s_int_norm
602 call neko_log%message(log_buf)
603
604 end subroutine log_interface_error_
605
606 !===================
607 ! Helper subroutines
608 !===================
609
611 subroutine build_masks_(this)
612 class(overset_interface_t), intent(inout) :: this
613 type(mask_t) :: temp_mask
614 logical, allocatable :: found(:)
615 integer :: i, j, k, e, nelems
616 integer :: lx, ly, lz
617 integer :: nonlinear_idx(4), linear_idx
618 type(stack_i4_t) :: idx_stack
619
620 call this%interface_dof_mask%init(this%msk(1:this%msk(0)), this%msk(0))
621
622 lx = this%Xh%lx
623 ly = this%Xh%ly
624 lz = this%Xh%lz
625
626 allocate(found(this%msh%nelv))
627 found = .false.
628
629 do i = 1, this%msk(0)
630 linear_idx = this%msk(i)
631 nonlinear_idx = nonlinear_index(linear_idx, lx, ly, lz)
632 found(nonlinear_idx(4)) = .true.
633 end do
634
635 nelems = 0
636 call idx_stack%init()
637 do e = 1, this%msh%nelv
638 if (found(e)) then
639 nelems = nelems + 1
640 do k = 1, this%Xh%lz
641 do j = 1, this%Xh%ly
642 do i = 1, this%Xh%lx
643 linear_idx = linear_index(i, j, k, e, lx, ly, lz)
644 call idx_stack%push(linear_idx)
645 end do
646 end do
647 end do
648 end if
649 end do
650
651 deallocate(found)
652
653 call temp_mask%init(idx_stack%array(), idx_stack%size())
654 call idx_stack%free()
655
656 call this%domain_element_mask%invert_mask(temp_mask, this%dof%size())
657 call temp_mask%free()
658
659 end subroutine build_masks_
660
662 subroutine gather_interface_dofs_(this)
663 class(overset_interface_t), intent(inout) :: this
664
665 call vector_masked_gather_copy(this%x_interface_dof, this%dof%x%x(:,1,1,1), &
666 this%interface_dof_mask, this%dof%size())
667 call vector_masked_gather_copy(this%y_interface_dof, this%dof%y%x(:,1,1,1), &
668 this%interface_dof_mask, this%dof%size())
669 call vector_masked_gather_copy(this%z_interface_dof, this%dof%z%x(:,1,1,1), &
670 this%interface_dof_mask, this%dof%size())
671
672 call this%x_interface_dof%copy_from(device_to_host, sync = .false.)
673 call this%y_interface_dof%copy_from(device_to_host, sync = .false.)
674 call this%z_interface_dof%copy_from(device_to_host, sync = .true.)
675
676 end subroutine gather_interface_dofs_
677
679 subroutine setup_interpolator_(this)
680 class(overset_interface_t), intent(inout) :: this
681
682 call this%interface_interpolator%init(this%dof, &
684 tol = this%interpolation_settings%tolerance, &
685 pad = this%interpolation_settings%padding, &
686 mask = this%domain_element_mask)
687
688 call this%interface_interpolator%find_points(this%x_interface_dof%x, &
689 this%y_interface_dof%x, this%z_interface_dof%x, &
690 this%x_interface_dof%size())
691
692 end subroutine setup_interpolator_
693
694end 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:91
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:295
subroutine, public masked_copy_0(a, b, mask, n, n_mask)
Copy a masked vector .
Definition math.f90:316
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).
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:326
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:135
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...