Neko 1.1.2
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
overset_interface_vector.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
40 use dirichlet, only : dirichlet_t
43 use mask, only : mask_t
44 use dofmap, only : dofmap_t
45 use bc, only : bc_t
46 use bc_list, only : bc_list_t
47 use utils, only : split_string
48 use field, only : field_t
49 use field_list, only : field_list_t
50 use math, only : masked_copy_0
52 use dofmap, only : dofmap_t
53 use vector, only : vector_t
54 use vector_list, only : vector_list_t
59 use math, only : copy
61 use vector_math, only : vector_copy
65 use stack, only: stack_i4_t
66 use json_module, only : json_file
68 use field_list, only : field_list_t
70 use, intrinsic :: iso_c_binding, only : c_ptr, c_size_t
71 use time_state, only : time_state_t
72 use mpi_f08, only : mpi_allreduce, mpi_integer, mpi_sum
74 use logger, only : neko_log, log_size
75
76
77 implicit none
78 private
79
81 ! for the application on a vector field.
82 type, public, extends(bc_t) :: overset_interface_vector_t
83 ! The bc for the first compoent.
84 type(field_dirichlet_t) :: bc_u
85 ! The bc for the second compoent.
86 type(field_dirichlet_t) :: bc_v
87 ! The bc for the third compoent.
88 type(field_dirichlet_t) :: bc_w
92 type(global_interpolation_t) :: interface_interpolator
94 type(mask_t) :: interface_dof_mask
95 type(mask_t) :: domain_element_mask
97 type(vector_t) :: x_dof, y_dof, z_dof
98 type(vector_t) :: x_interface_dof, y_interface_dof, z_interface_dof
99 type(vector_t) :: u_interface, v_interface, w_interface
100 type(vector_series_t) :: u_interface_lag, v_interface_lag, w_interface_lag
101 integer :: iextm_order = 1
102 integer :: last_tstep = -1
103 type(vector_list_t) :: interface_dof, interface_field
105 type(global_interpolation_settings_t) :: interpolation_settings
106 integer :: n_int_tot = 0
107 logical :: find_interface = .false.
108 logical :: setup = .false.
109 logical :: log = .false.
110
113 procedure(morph_overset_interface), nopass, pointer :: &
114 morph_interface => null()
115
116 contains
118 procedure, pass(this) :: init => overset_interface_vector_init
120 procedure, pass(this) :: init_from_components => &
123 procedure, pass(this) :: free => overset_interface_vector_free
125 procedure, pass(this) :: finalize => overset_interface_vector_finalize
127 procedure, pass(this) :: apply_scalar => &
130 procedure, pass(this) :: apply_vector => &
133 procedure, pass(this) :: apply_vector_dev => &
136 procedure, pass(this) :: apply_scalar_dev => &
138 procedure, pass(this) :: update => overset_interface_update
139
141 procedure, pass(this), private :: build_masks_ => build_masks_
143 procedure, pass(this), private :: gather_interface_dofs_ => &
146 procedure, pass(this), private :: setup_interpolator_ => &
149 procedure, pass(this), private :: log_interface_error_ => &
152
153contains
154
158 subroutine overset_interface_vector_init(this, coef, json)
159 class(overset_interface_vector_t), intent(inout), target :: this
160 type(coef_t), target, intent(in) :: coef
161 type(json_file), intent(inout) ::json
162 real(kind=rp) :: tol, pad
163 logical :: log
164
166 call json_get_or_default(json, "interpolation.tolerance", &
167 tol, -1.0_rp)
168 call json_get_or_default(json, "interpolation.padding", &
169 pad, -1.0_rp)
170 call json_get_or_default(json, "order", this%iextm_order, 1)
171 if (this%iextm_order .lt. 1 .or. this%iextm_order .gt. 3) then
172 call neko_error("The order of the IEXTm time scheme must be 1 to 3.")
173 end if
174 call json_get_or_default(json, "log", log, .false.)
175
176 call this%init_from_components(coef, tol, pad, log)
177
178 end subroutine overset_interface_vector_init
179
185 subroutine overset_interface_vector_init_from_components(this, coef, tol, pad, log)
186 class(overset_interface_vector_t), intent(inout), target :: this
187 type(coef_t), intent(in) :: coef
188 real(kind=rp), intent(in), optional :: tol, pad
189 logical, intent(in), optional :: log
190
192 call this%init_base(coef)
193
195 if (present(tol)) then
196 if (tol .gt. 0.0_rp) this%interpolation_settings%tolerance = tol
197 end if
198 if (present(pad)) then
199 if (pad .gt. 0.0_rp) this%interpolation_settings%padding = pad
200 end if
201 if (present(log)) then
202 this%log = log
203 end if
204
205 call this%bc_u%init_from_components(coef, "u")
206 call this%bc_v%init_from_components(coef, "v")
207 call this%bc_w%init_from_components(coef, "w")
208
209 call this%field_list%init(3)
210 call this%field_list%assign_to_field(1, this%bc_u%field_bc)
211 call this%field_list%assign_to_field(2, this%bc_v%field_bc)
212 call this%field_list%assign_to_field(3, this%bc_w%field_bc)
213
215 call this%x_dof%init(this%dof%size(), 'x')
216 call this%y_dof%init(this%dof%size(), 'y')
217 call this%z_dof%init(this%dof%size(), 'z')
218
221 if (neko_bcknd_device .eq. 1) then
222 ! copy
223 call device_copy(this%x_dof%x_d, this%dof%x_d, this%dof%size())
224 call device_copy(this%y_dof%x_d, this%dof%y_d, this%dof%size())
225 call device_copy(this%z_dof%x_d, this%dof%z_d, this%dof%size())
226 ! synchronize
227 call this%x_dof%copy_from(device_to_host, sync = .false.)
228 call this%y_dof%copy_from(device_to_host, sync = .false.)
229 call this%z_dof%copy_from(device_to_host, sync = .true.)
230 else
231 call copy(this%x_dof%x, this%dof%x, this%dof%size())
232 call copy(this%y_dof%x, this%dof%y, this%dof%size())
233 call copy(this%z_dof%x, this%dof%z, this%dof%size())
234 end if
235
237
241 class(overset_interface_vector_t), target, intent(inout) :: this
242
243 call this%bc_u%free()
244 call this%bc_v%free()
245 call this%bc_w%free()
246
247 call this%field_list%free()
248 call this%interface_dof%free()
249 call this%interface_field%free()
250
251 call this%x_dof%free()
252 call this%y_dof%free()
253 call this%z_dof%free()
254
255 call this%x_interface_dof%free()
256 call this%y_interface_dof%free()
257 call this%z_interface_dof%free()
258 call this%u_interface%free()
259 call this%v_interface%free()
260 call this%w_interface%free()
261 call this%u_interface_lag%free()
262 call this%v_interface_lag%free()
263 call this%w_interface_lag%free()
264 call this%interface_interpolator%free()
265 call this%interface_dof_mask%free()
266 call this%domain_element_mask%free()
267 call this%free_base()
268
269 !if (associated(this%update_)) then
270 ! nullify(this%update_)
271 !end if
272 end subroutine overset_interface_vector_free
273
278 subroutine overset_interface_vector_apply_scalar(this, x, n, time, strong)
279 class(overset_interface_vector_t), intent(inout) :: this
280 integer, intent(in) :: n
281 real(kind=rp), intent(inout), dimension(n) :: x
282 type(time_state_t), intent(in), optional :: time
283 logical, intent(in), optional :: strong
284
285 call neko_error("overset_interface_vector cannot apply scalar BCs.&
286 & Use overset_interface_vector::apply_vector instead!")
287
289
293 subroutine overset_interface_vector_apply_scalar_dev(this, x_d, time, &
294 strong, strm)
295 class(overset_interface_vector_t), intent(inout), target :: this
296 type(c_ptr), intent(inout) :: x_d
297 type(time_state_t), intent(in), optional :: time
298 logical, intent(in), optional :: strong
299 type(c_ptr), intent(inout) :: strm
300
301 call neko_error("overset_interface_vector cannot apply scalar BCs.&
302 & Use overset_interface_vector::apply_vector instead!")
303
305
312 subroutine overset_interface_vector_apply_vector(this, x, y, z, n, time, &
313 strong)
314 class(overset_interface_vector_t), intent(inout) :: this
315 integer, intent(in) :: n
316 real(kind=rp), intent(inout), dimension(n) :: x
317 real(kind=rp), intent(inout), dimension(n) :: y
318 real(kind=rp), intent(inout), dimension(n) :: z
319 type(time_state_t), intent(in), optional :: time
320 logical, intent(in), optional :: strong
321 logical :: strong_
322
323 if (present(strong)) then
324 strong_ = strong
325 else
326 strong_ = .true.
327 end if
328
329 if (strong_) then
330
331 ! We can send any of the 3 bcs we have as argument, since they are all
332 ! the same boundary.
333 !$omp single
334 if (.not. this%updated) then
335 call this%update(time)
336 this%updated = .true.
337 end if
338 !$omp end single
339
341 call masked_copy_0(x, this%bc_u%field_bc%x, this%msk, n, this%msk(0))
342 call masked_copy_0(y, this%bc_v%field_bc%x, this%msk, n, this%msk(0))
343 call masked_copy_0(z, this%bc_w%field_bc%x, this%msk, n, this%msk(0))
344 end if
345
347
354 subroutine overset_interface_vector_apply_vector_dev(this, x_d, y_d, z_d, &
355 time, strong, strm)
356 class(overset_interface_vector_t), intent(inout), target :: this
357 type(c_ptr), intent(inout) :: x_d
358 type(c_ptr), intent(inout) :: y_d
359 type(c_ptr), intent(inout) :: z_d
360 type(time_state_t), intent(in), optional :: time
361 logical, intent(in), optional :: strong
362 type(c_ptr), intent(inout) :: strm
363 logical :: strong_
364
365 if (present(strong)) then
366 strong_ = strong
367 else
368 strong_ = .true.
369 end if
370
371 if (strong_) then
372 !$omp single
373 if (.not. this%updated) then
374 call this%update(time)
375 this%updated = .true.
376 end if
377 !$omp end single
378
379 if (this%msk(0) .gt. 0) then
380 call device_masked_copy_0(x_d, this%bc_u%field_bc%x_d, &
381 this%bc_u%msk_d, this%bc_u%dof%size(), this%msk(0), &
382 strm) ! adperez: change the masks used here
383 call device_masked_copy_0(y_d, this%bc_v%field_bc%x_d, &
384 this%bc_v%msk_d, this%bc_v%dof%size(), this%msk(0), strm)
385 call device_masked_copy_0(z_d, this%bc_w%field_bc%x_d, &
386 this%bc_w%msk_d, this%bc_w%dof%size(), this%msk(0), strm)
387 end if
388 end if
389
391
393 subroutine overset_interface_vector_finalize(this, only_facets)
394 class(overset_interface_vector_t), target, intent(inout) :: this
395 logical, optional, intent(in) :: only_facets
396 logical :: only_facets_
397
398 if (present(only_facets)) then
399 only_facets_ = only_facets
400 else
401 only_facets_ = .false.
402 end if
403
405 call this%finalize_base(only_facets_)
406
407 call this%bc_u%mark_facets(this%marked_facet)
408 call this%bc_v%mark_facets(this%marked_facet)
409 call this%bc_w%mark_facets(this%marked_facet)
410
411 call this%bc_u%finalize(only_facets_)
412 call this%bc_v%finalize(only_facets_)
413 call this%bc_w%finalize(only_facets_)
414
416 call this%build_masks_()
417
419 call this%x_interface_dof%init(this%interface_dof_mask%size(), &
420 'x_interface')
421 call this%y_interface_dof%init(this%interface_dof_mask%size(), &
422 'y_interface')
423 call this%z_interface_dof%init(this%interface_dof_mask%size(), &
424 'z_interface')
425 call this%gather_interface_dofs_()
426
428 call this%setup_interpolator_()
429
431 call this%u_interface%init(this%interface_dof_mask%size(), 'u_interface')
432 call this%v_interface%init(this%interface_dof_mask%size(), 'v_interface')
433 call this%w_interface%init(this%interface_dof_mask%size(), 'w_interface')
434
436 call this%interface_dof%init(3)
437 call this%interface_dof%assign_to_vector(1, this%x_interface_dof)
438 call this%interface_dof%assign_to_vector(2, this%y_interface_dof)
439 call this%interface_dof%assign_to_vector(3, this%z_interface_dof)
440
441 call this%interface_field%init(3)
442 call this%interface_field%assign_to_vector(1, this%u_interface)
443 call this%interface_field%assign_to_vector(2, this%v_interface)
444 call this%interface_field%assign_to_vector(3, this%w_interface)
445
447 call this%u_interface_lag%init(this%u_interface, this%iextm_order)
448 call this%v_interface_lag%init(this%v_interface, this%iextm_order)
449 call this%w_interface_lag%init(this%w_interface, this%iextm_order)
450
451 call mpi_allreduce(this%u_interface%size(), this%n_int_tot, 1, mpi_integer, &
452 mpi_sum, neko_global_comm)
453
454
456
458 subroutine overset_interface_update(this, time)
459 class(overset_interface_vector_t), intent(inout) :: this
460 type(time_state_t), intent(in) :: time
461 type(field_t), pointer :: u, v, w
462 type(iextm_time_scheme_t) :: time_scheme
463 integer :: nhist, ihist
464 real(kind=rp) :: iextm_coeffs(4)
465
466
468 call this%morph_interface(this%interface_dof, this%interface_field, &
469 this%interface_dof_mask, time, this%name, &
470 this%find_interface)
471
473 ! not implemented for now
474 ! if (substep .eq. 1) then
475 ! call this%extrapolate()
476 ! end if
477
479 if (this%find_interface) then
480
481 ! sync
482 call this%x_interface_dof%copy_from(device_to_host, sync = .false.)
483 call this%y_interface_dof%copy_from(device_to_host, sync = .false.)
484 call this%z_interface_dof%copy_from(device_to_host, sync = .true.)
485
486 call this%interface_interpolator%find_points(this%x_interface_dof%x, &
487 this%y_interface_dof%x, this%z_interface_dof%x, &
488 this%x_interface_dof%size())
489 this%find_interface = .false.
490
491 end if
492
494 u => neko_registry%get_field("u")
495 v => neko_registry%get_field("v")
496 w => neko_registry%get_field("w")
497
499 call this%interface_interpolator%evaluate_masked(this%u_interface%x, &
500 u%x, this%domain_element_mask, .false.)
501 call this%interface_interpolator%evaluate_masked(this%v_interface%x, &
502 v%x, this%domain_element_mask, .false.)
503 call this%interface_interpolator%evaluate_masked(this%w_interface%x, &
504 w%x, this%domain_element_mask, .false.)
505
506 if (this%log) then
507 call this%log_interface_error_(u, v, w)
508 end if
509
510
512 if (time%tstep .ne. this%last_tstep) then
513 ! Update the last steps
514 this%last_tstep = time%tstep
515
516 ! Update the lag arrays with the value just got from the last step
517 call this%u_interface_lag%update()
518 call this%v_interface_lag%update()
519 call this%w_interface_lag%update()
520
521 ! Get the coefficients for the extrapolation
522 nhist = min(time%tstep, this%iextm_order)
523 call time_scheme%compute_coeffs(iextm_coeffs, time%dtlag, nhist)
524
525 ! Perform the extrapolation using the lag arrays
526 call vector_cmult2(this%u_interface, this%u_interface_lag%lv(1), &
527 iextm_coeffs(1))
528 call vector_cmult2(this%v_interface, this%v_interface_lag%lv(1), &
529 iextm_coeffs(1))
530 call vector_cmult2(this%w_interface, this%w_interface_lag%lv(1), &
531 iextm_coeffs(1))
532 do ihist = 2, nhist
533 call vector_add2s2(this%u_interface, &
534 this%u_interface_lag%lv(ihist), iextm_coeffs(ihist))
535 call vector_add2s2(this%v_interface, &
536 this%v_interface_lag%lv(ihist), iextm_coeffs(ihist))
537 call vector_add2s2(this%w_interface, &
538 this%w_interface_lag%lv(ihist), iextm_coeffs(ihist))
539 end do
540
541 end if
542
543
545 call vector_masked_scatter_copy(this%bc_u%field_bc%x(:,1,1,1), &
546 this%u_interface, &
547 this%interface_dof_mask, this%bc_u%dof%size())
548 call vector_masked_scatter_copy(this%bc_v%field_bc%x(:,1,1,1), &
549 this%v_interface, &
550 this%interface_dof_mask, this%bc_v%dof%size())
551 call vector_masked_scatter_copy(this%bc_w%field_bc%x(:,1,1,1), &
552 this%w_interface, &
553 this%interface_dof_mask, this%bc_w%dof%size())
554
555
556 end subroutine overset_interface_update
557
559 subroutine log_interface_error_(this, u, v, w)
560 class(overset_interface_vector_t), intent(inout) :: this
561 type(field_t), pointer, intent(in) :: u, v, w
562 real(kind=rp) :: u_int_norm, v_int_norm, w_int_norm
563 type(vector_t), pointer :: error
564 integer :: ind(1)
565 logical :: clear_scratch = .false.
566 character(len=256) :: log_buf
567
568 call neko_scratch_registry%request_vector(error, ind(1), this%u_interface%size(), &
569 clear_scratch)
570
572 call vector_masked_gather_copy(error, u%x(:,1,1,1), this%interface_dof_mask, &
573 this%dof%size())
574 call vector_add2s2(error, this%u_interface, -1.0_rp)
575 u_int_norm = sqrt(vector_glsc2(error, error)) / sqrt(real(this%n_int_tot, kind=rp))
576
577 call vector_masked_gather_copy(error, v%x(:,1,1,1), this%interface_dof_mask, &
578 this%dof%size())
579 call vector_add2s2(error, this%v_interface, -1.0_rp)
580 v_int_norm = sqrt(vector_glsc2(error, error)) / sqrt(real(this%n_int_tot, kind=rp))
581
582 call vector_masked_gather_copy(error, w%x(:,1,1,1), this%interface_dof_mask, &
583 this%dof%size())
584 call vector_add2s2(error, this%w_interface, -1.0_rp)
585 w_int_norm = sqrt(vector_glsc2(error, error)) / sqrt(real(this%n_int_tot, kind=rp))
586
587 call neko_scratch_registry%relinquish(ind)
588
590 write(log_buf, '(A12,A3,A10,1x,A1,E15.7,A1,E15.7,A1,E15.7,A1)') &
591 'Interface BC', ' | ', 'L2 Error: ', '(', &
592 u_int_norm, ',', v_int_norm, ',', w_int_norm, ')'
593 call neko_log%message(log_buf)
594
595 end subroutine log_interface_error_
596
597 !===================
598 ! Helper subroutines
599 !===================
600
602 subroutine build_masks_(this)
603 class(overset_interface_vector_t), intent(inout) :: this
604 type(mask_t) :: temp_mask
605 logical, allocatable :: found(:)
606 integer :: i, j, k, e, new_size, nelems
607 integer :: lx, ly, lz
608 integer :: nonlinear_idx(4), linear_idx
609 type(stack_i4_t) :: stack
610
612 call this%interface_dof_mask%init(this%msk(1:this%msk(0)), this%msk(0))
613
616 lx = this%Xh%lx
617 ly = this%Xh%ly
618 lz = this%Xh%lz
619 allocate(found(this%msh%nelv))
620 found = .false.
621 !! Find sem elements that contain the boundary points
622 do i = 1, this%msk(0)
623 linear_idx = this%msk(i)
624 nonlinear_idx = nonlinear_index(linear_idx, lx, ly, lz)
625 found(nonlinear_idx(4)) = .true.
626 end do
627 !! fill the stack containing the gll indices
628 nelems = 0
629 call stack%init()
630 do e = 1, this%msh%nelv
631 if (found(e)) then
632 nelems = nelems + 1
633 do k = 1, this%Xh%lz
634 do j = 1, this%Xh%ly
635 do i = 1, this%Xh%lx
636 linear_idx = linear_index(i, j, k, e, lx, ly, lz)
637 call stack%push(linear_idx)
638 end do
639 end do
640 end do
641 end if
642 end do
643 deallocate(found)
644 call temp_mask%init(stack%array(), stack%size())
645 call stack%free()
646
648 call this%domain_element_mask%invert_mask(temp_mask, this%dof%size())
649
650 call temp_mask%free()
651
652 end subroutine build_masks_
653
655 subroutine gather_interface_dofs_(this)
656 class(overset_interface_vector_t), intent(inout) :: this
657
659 call vector_masked_gather_copy(this%x_interface_dof, &
660 this%dof%x(:,1,1,1), &
661 this%interface_dof_mask, &
662 this%dof%size())
663 call vector_masked_gather_copy(this%y_interface_dof, &
664 this%dof%y(:,1,1,1), &
665 this%interface_dof_mask, &
666 this%dof%size())
667 call vector_masked_gather_copy(this%z_interface_dof, &
668 this%dof%z(:,1,1,1), &
669 this%interface_dof_mask, &
670 this%dof%size())
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
678
680 subroutine setup_interpolator_(this)
681 class(overset_interface_vector_t), intent(inout) :: this
682
684 call this%interface_interpolator%init(this%dof, &
686 tol=this%interpolation_settings%tolerance, &
687 pad=this%interpolation_settings%padding, &
688 mask=this%domain_element_mask)
689
691 call this%interface_interpolator%find_points(this%x_interface_dof%x, &
692 this%y_interface_dof%x, &
693 this%z_interface_dof%x, &
694 this%x_interface_dof%size())
695
696 end subroutine setup_interpolator_
697
__inline__ __device__ void nonlinear_index(const int idx, const int lx, int *index)
Definition bc_utils.h:44
double real
Abstract interface defining a dirichlet condition on a list of fields.
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
User callback for overset-interface morphing and boundary-value updates.
Defines a list of bc_t.
Definition bc_list.f90:34
Defines a boundary condition.
Definition bc.f90:34
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 host_to_device
Definition device.F90:48
integer, parameter, public device_to_host
Definition device.F90:48
Defines a dirichlet boundary condition.
Definition dirichlet.f90:34
Defines a mapping of the degrees of freedom.
Definition dofmap.f90:35
Defines user dirichlet condition for a scalar field.
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:80
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:291
subroutine, public masked_copy_0(a, b, mask, n, n_mask)
Copy a masked vector .
Definition math.f90:312
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Defines overset interface vector boundary conditions.
subroutine overset_interface_vector_finalize(this, only_facets)
Finalize by building the mask arrays and propagating to underlying bcs.
subroutine overset_interface_vector_apply_scalar_dev(this, x_d, time, strong, strm)
No-op apply scalar (device).
subroutine overset_interface_vector_init_from_components(this, coef, tol, pad, log)
Constructor from components.
subroutine overset_interface_vector_free(this)
Destructor. Currently unused as is, all field_dirichlet attributes are freed in fluid_scheme_incompre...
subroutine overset_interface_vector_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
Apply the boundary condition to a vector field on the device.
subroutine overset_interface_vector_apply_scalar(this, x, n, time, strong)
No-op apply scalar.
subroutine overset_interface_vector_init(this, coef, json)
Constructor.
subroutine overset_interface_vector_apply_vector(this, x, y, z, n, time, strong)
Apply the boundary condition to a vector field.
Defines overset interface scalar boundary conditions.
subroutine overset_interface_update(this, time)
Update values at the overset interface.
subroutine gather_interface_dofs_(this)
Gather interface dofs.
subroutine log_interface_error_(this, s)
Log interface RMSE for the scalar field.
subroutine setup_interpolator_(this)
Set up the global interpolator.
subroutine build_masks_(this)
Build masks.
Defines a registry for storing solution fields.
Definition registry.f90:34
type(registry_t), target, public neko_registry
Global field registry.
Definition registry.f90:144
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
character(len=100) function, dimension(:), allocatable, public split_string(string, delimiter)
Split a string based on delimiter (tokenizer) OBS: very hacky, this should really be improved,...
Definition utils.f90:251
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:289
subroutine, public vector_copy(a, b, n)
Copy a vector .
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:62
A list of allocatable `bc_t`. Follows the standard interface of lists.
Definition bc_list.f90:49
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:63
Generic Dirichlet boundary condition on .
Definition dirichlet.f90:49
User defined dirichlet condition, for which the user can work with an entire field....
field_list_t, To be able to group fields together
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
Extension of the user defined dirichlet condition overset_interface
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...