Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
bc.f90
Go to the documentation of this file.
1! Copyright (c) 2020-2025, 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!
34module bc
36 use num_types, only : rp
37 use device, only : host_to_device, device_memcpy, &
39 use iso_c_binding, only : c_associated
40 use dofmap, only : dofmap_t
41 use coefs, only : coef_t
42 use space, only : space_t
44 use facet_zone, only : facet_zone_t
45 use mask, only : mask_t
46 use stack, only : stack_i4t2_t
47 use tuple, only : tuple_i4_t
48 use field, only : field_t
50 use gs_ops, only : gs_op_add
51 use math, only : relcmp, rzero
52 use device_math, only : device_cfill
54 use logger, only : neko_log, log_size
55 use, intrinsic :: iso_c_binding, only : c_ptr, c_null_ptr
56 use json_module, only : json_file
57 use time_state, only : time_state_t
58 use field, only : field_t
59 use file, only : file_t
60
61 implicit none
62 private
63
67 integer, parameter, public :: bc_dirichlet = 0
68 integer, parameter, public :: bc_mixed_constrains_normal = 2
69 integer, parameter, public :: bc_mixed_constrains_tangent = 3
70 integer, parameter, public :: bc_neumann = 5
71
73 type, public, abstract :: bc_t
75 integer, allocatable :: msk(:)
77 integer, allocatable :: facet_node_msk(:)
79 integer, allocatable :: facet(:)
81 type(dofmap_t), pointer :: dof => null()
83 type(coef_t), pointer :: coef => null()
85 type(mesh_t), pointer :: msh => null()
87 type(space_t), pointer :: xh => null()
89 type(stack_i4t2_t) :: marked_facet
91 type(c_ptr) :: msk_d = c_null_ptr
93 type(c_ptr) :: facet_node_msk_d = c_null_ptr
95 type(c_ptr) :: facet_d = c_null_ptr
97 integer :: bc_type = -1
100 logical :: updated = .false.
101 !!> Name of the bc
102 character(len=:), allocatable :: name
103 !!> Zone indices where the bc is applied
104 integer, allocatable :: zone_indices(:)
105 contains
107 procedure, pass(this) :: init_base => bc_init_base
109 procedure, pass(this) :: free_base => bc_free_base
111 procedure, pass(this) :: mark_facet => bc_mark_facet
113 procedure, pass(this) :: mark_facets => bc_mark_facets
115 procedure, pass(this) :: mark_zone => bc_mark_zone
117 procedure, pass(this) :: mark_labeled_zone => bc_mark_labeled_zone
119 procedure, pass(this) :: mark_labeled_zones => bc_mark_labeled_zones
122 procedure, pass(this) :: finalize_base => bc_finalize_base
123
126 procedure, pass(this) :: apply_scalar_generic => bc_apply_scalar_generic
129 procedure, pass(this) :: apply_vector_generic => bc_apply_vector_generic
131 procedure, pass(this) :: debug_mask_ => bc_debug_mask
133 procedure, pass(this) :: restart_scalar => bc_restart_scalar
135 procedure, pass(this) :: restart_vector => bc_restart_vector
137 generic :: restart => restart_scalar, restart_vector
139 procedure(bc_apply_scalar), pass(this), deferred :: apply_scalar
141 procedure(bc_apply_vector), pass(this), deferred :: apply_vector
143 procedure(bc_apply_scalar_dev), pass(this), deferred :: apply_scalar_dev
145 procedure(bc_apply_vector_dev), pass(this), deferred :: apply_vector_dev
147 procedure(bc_destructor), pass(this), deferred :: free
149 procedure(bc_constructor), pass(this), deferred :: init
151 procedure(bc_finalize), pass(this), deferred :: finalize
152 end type bc_t
153
155 type, public :: bc_ptr_t
156 class(bc_t), pointer :: ptr => null()
157 end type bc_ptr_t
158
159 ! Helper type to have an array of polymorphic bc_t objects.
160 type, public :: bc_alloc_t
161 class(bc_t), allocatable :: obj
162 end type bc_alloc_t
163
164
165 abstract interface
166
167 subroutine bc_constructor(this, coef, json)
168 import :: bc_t, coef_t, json_file
169 class(bc_t), intent(inout), target :: this
170 type(coef_t), target, intent(in) :: coef
171 type(json_file), intent(inout) :: json
172 end subroutine bc_constructor
173 end interface
174
175 abstract interface
176
177 subroutine bc_destructor(this)
178 import :: bc_t
179 class(bc_t), intent(inout), target :: this
180 end subroutine bc_destructor
181 end interface
182
183 abstract interface
184
185 subroutine bc_finalize(this)
186 import :: bc_t
187 class(bc_t), intent(inout), target :: this
188 end subroutine bc_finalize
189 end interface
190
191 abstract interface
192
197 subroutine bc_apply_scalar(this, x, n, time, strong)
198 import :: bc_t, time_state_t
199 import :: rp
200 class(bc_t), intent(inout) :: this
201 integer, intent(in) :: n
202 real(kind=rp), intent(inout), dimension(n) :: x
203 type(time_state_t), intent(in), optional :: time
204 logical, intent(in), optional :: strong
205 end subroutine bc_apply_scalar
206 end interface
207
208 abstract interface
209
217 subroutine bc_apply_vector(this, x, y, z, n, time, strong)
218 import :: bc_t, time_state_t
219 import :: rp
220 class(bc_t), intent(inout) :: this
221 integer, intent(in) :: n
222 real(kind=rp), intent(inout), dimension(n) :: x
223 real(kind=rp), intent(inout), dimension(n) :: y
224 real(kind=rp), intent(inout), dimension(n) :: z
225 type(time_state_t), intent(in), optional :: time
226 logical, intent(in), optional :: strong
227 end subroutine bc_apply_vector
228 end interface
229
230 abstract interface
231
236 subroutine bc_apply_scalar_dev(this, x_d, time, strong, strm)
237 import :: c_ptr
238 import :: bc_t, time_state_t
239 import :: rp
240 class(bc_t), intent(inout), target :: this
241 type(c_ptr), intent(inout) :: x_d
242 type(time_state_t), intent(in), optional :: time
243 logical, intent(in), optional :: strong
244 type(c_ptr), intent(inout) :: strm
245 end subroutine bc_apply_scalar_dev
246 end interface
247
248 abstract interface
249
256 subroutine bc_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
257 import :: c_ptr, bc_t, time_state_t
258 import :: rp
259 class(bc_t), intent(inout), target :: this
260 type(c_ptr), intent(inout) :: x_d
261 type(c_ptr), intent(inout) :: y_d
262 type(c_ptr), intent(inout) :: z_d
263 type(time_state_t), intent(in), optional :: time
264 logical, intent(in), optional :: strong
265 type(c_ptr), intent(inout) :: strm
266 end subroutine bc_apply_vector_dev
267 end interface
268
269contains
270
274 subroutine bc_restart_scalar(this, s, slag)
275 class(bc_t), intent(inout) :: this
276 type(field_t), intent(in) :: s
277 type(field_series_t), intent(in), optional :: slag
278 end subroutine bc_restart_scalar
279
281 subroutine bc_restart_vector(this, u, v, w, ulag, vlag, wlag)
282 class(bc_t), intent(inout) :: this
283 type(field_t), intent(in) :: u, v, w
284 type(field_series_t), intent(in) :: ulag, vlag, wlag
285 end subroutine bc_restart_vector
286
289 subroutine bc_init_base(this, coef)
290 class(bc_t), intent(inout) :: this
291 type(coef_t), target, intent(in) :: coef
292
293 call this%free_base
294
295 this%dof => coef%dof
296 this%coef => coef
297 this%Xh => this%dof%Xh
298 this%msh => this%dof%msh
299
300 call this%marked_facet%init()
301
302 end subroutine bc_init_base
303
305 subroutine bc_free_base(this)
306 class(bc_t), intent(inout) :: this
307
308 call this%marked_facet%free()
309
310 nullify(this%Xh)
311 nullify(this%msh)
312 nullify(this%dof)
313 nullify(this%coef)
314
315 if (allocated(this%msk)) then
316 if (neko_bcknd_device .eq. 1) then
317 call device_unmap(this%msk, this%msk_d)
318 end if
319 deallocate(this%msk)
320 end if
321
322 if (allocated(this%facet_node_msk)) then
323 if (neko_bcknd_device .eq. 1) then
324 call device_unmap(this%facet_node_msk, this%facet_node_msk_d)
325 end if
326 deallocate(this%facet_node_msk)
327 end if
328
329 if (allocated(this%facet)) then
330 if (neko_bcknd_device .eq. 1) then
331 call device_unmap(this%facet, this%facet_d)
332 end if
333 deallocate(this%facet)
334 end if
335
336 if (allocated(this%name)) then
337 deallocate(this%name)
338 end if
339
340 if (allocated(this%zone_indices)) then
341 deallocate(this%zone_indices)
342 end if
343
344 ! Back to the state of a freshly declared bc, so that a condition which is
345 ! reinitialised does not inherit an `updated` from its previous life and
346 ! skip its first update.
347 this%updated = .false.
348
349 end subroutine bc_free_base
350
359 subroutine bc_apply_vector_generic(this, x, y, z, time, strong, strm)
360 class(bc_t), intent(inout) :: this
361 type(field_t), intent(inout) :: x
362 type(field_t), intent(inout) :: y
363 type(field_t), intent(inout) :: z
364 type(time_state_t), intent(in), optional :: time
365 logical, intent(in), optional :: strong
366 type(c_ptr), intent(inout), optional :: strm
367 type(c_ptr) :: strm_
368 integer :: n
369 character(len=256) :: msg
370
371 ! Get the size of the fields
372 n = x%size()
373
374 ! Ensure all fields are the same size
375 if (y%size() .ne. n .or. z%size() .ne. n) then
376 msg = "Fields x, y, z must have the same size in " // &
377 "bc_list_apply_vector_field"
378 call neko_error(trim(msg))
379 end if
380
381 if (neko_bcknd_device .eq. 1) then
382
383 if (present(strm)) then
384 strm_ = strm
385 else
386 strm_ = glb_cmd_queue
387 end if
388
389 call this%apply_vector_dev(x%x_d, y%x_d, z%x_d, time = time, &
390 strong = strong, strm = strm_)
391 else
392 call this%apply_vector(x%x, y%x, z%x, n, time = time, strong = strong)
393 end if
394
395 end subroutine bc_apply_vector_generic
396
403 subroutine bc_apply_scalar_generic(this, x, time, strong, strm)
404 class(bc_t), intent(inout) :: this
405 type(field_t), intent(inout) :: x
406 type(time_state_t), intent(in), optional :: time
407 logical, intent(in), optional :: strong
408 type(c_ptr), intent(inout), optional :: strm
409 type(c_ptr) :: strm_
410 integer :: n
411
412 ! Get the size of the field
413 n = x%size()
414
415 if (neko_bcknd_device .eq. 1) then
416
417 if (present(strm)) then
418 strm_ = strm
419 else
420 strm_ = glb_cmd_queue
421 end if
422
423 call this%apply_scalar_dev(x%x_d, time = time, strong = strong, &
424 strm = strm_)
425 else
426 call this%apply_scalar(x%x, n, time = time)
427 end if
428
429 end subroutine bc_apply_scalar_generic
430
434 subroutine bc_mark_facet(this, facet, el)
435 class(bc_t), intent(inout) :: this
436 integer, intent(in) :: facet
437 integer, intent(in) :: el
438 type(tuple_i4_t) :: t
439
440 t%x = [facet, el]
441 call this%marked_facet%push(t)
442
443 end subroutine bc_mark_facet
444
447 subroutine bc_mark_facets(this, facet_list)
448 class(bc_t), intent(inout) :: this
449 type(stack_i4t2_t), intent(inout) :: facet_list
450 type(tuple_i4_t), pointer :: fp(:)
451 integer :: i
452
453 fp => facet_list%array()
454 do i = 1, facet_list%size()
455 call this%marked_facet%push(fp(i))
456 end do
457
458 end subroutine bc_mark_facets
459
462 subroutine bc_mark_zone(this, bc_zone)
463 class(bc_t), intent(inout) :: this
464 class(facet_zone_t), intent(in) :: bc_zone
465 integer :: i
466 do i = 1, bc_zone%size
467 call this%marked_facet%push(bc_zone%facet_el(i))
468 end do
469 end subroutine bc_mark_zone
470
473 subroutine bc_mark_labeled_zone(this, zone_index)
474 class(bc_t), intent(inout) :: this
475 integer, intent(in) :: zone_index
476 integer, allocatable :: tmp(:)
477 integer :: i
478 character(len=LOG_SIZE) :: log_buf
479
480 if (allocated(this%zone_indices)) then
481 do i = 1, size(this%zone_indices)
482 if (this%zone_indices(i) .eq. zone_index) then
483 write(log_buf, '(A,I0,A)') 'Zone index ', zone_index, &
484 ' already marked for this boundary condition'
485 call neko_warning(log_buf)
486 return
487 end if
488 end do
489
490 allocate(tmp(size(this%zone_indices) + 1))
491 tmp(1:size(this%zone_indices)) = this%zone_indices
492 tmp(size(tmp)) = zone_index
493 call move_alloc(tmp, this%zone_indices)
494 else
495 allocate(this%zone_indices(1))
496 this%zone_indices(1) = zone_index
497 end if
498
499 call this%mark_zone(this%msh%labeled_zones(zone_index))
500 end subroutine bc_mark_labeled_zone
501
504 subroutine bc_mark_labeled_zones(this, zone_indices)
505 class(bc_t), intent(inout) :: this
506 integer, intent(in) :: zone_indices(:)
507 integer :: i
508
509 do i = 1, size(zone_indices)
510 call this%mark_labeled_zone(zone_indices(i))
511 end do
512 end subroutine bc_mark_labeled_zones
513
518 subroutine bc_finalize_base(this)
519 class(bc_t), target, intent(inout) :: this
520 type(tuple_i4_t), pointer :: bfp(:)
521 type(tuple_i4_t) :: bc_facet
522 type(field_t) :: test_field
523 integer :: facet_size, facet, el
524 integer :: i, j, k, l, msk_c
525 integer :: lx, ly, lz, n
526 character(len=LOG_SIZE) :: log_buf
527 lx = this%Xh%lx
528 ly = this%Xh%ly
529 lz = this%Xh%lz
531
532 ! Note we assume that lx = ly = lz
533 facet_size = lx**2
534 n = facet_size * this%marked_facet%size()
535 allocate(this%facet_node_msk(0:n))
536 allocate(this%facet(0:n))
537
538 if (neko_bcknd_device .eq. 1) then
539 call device_map(this%facet_node_msk, this%facet_node_msk_d, n + 1)
540 call device_map(this%facet, this%facet_d, n + 1)
541 end if
542
543 msk_c = 0
544 bfp => this%marked_facet%array()
545
546 ! Loop through each (facet, element) id tuple
547 ! Then loop over all the nodes of the face and compute their linear index
548 ! This index goes into this%facet_node_msk, whereas the corresponding face
549 ! id goes into this%facet
550 do i = 1, this%marked_facet%size()
551 bc_facet = bfp(i)
552 facet = bc_facet%x(1)
553 el = bc_facet%x(2)
554 select case (facet)
555 case (1)
556 do l = 1, lz
557 do k = 1, ly
558 msk_c = msk_c + 1
559 this%facet_node_msk(msk_c) = &
560 linear_index(1, k, l, el, lx, ly, lz)
561 this%facet(msk_c) = 1
562 end do
563 end do
564 case (2)
565 do l = 1, lz
566 do k = 1, ly
567 msk_c = msk_c + 1
568 this%facet_node_msk(msk_c) = &
569 linear_index(lx, k, l, el, lx, ly, lz)
570 this%facet(msk_c) = 2
571 end do
572 end do
573 case (3)
574 do l = 1, lz
575 do j = 1, lx
576 msk_c = msk_c + 1
577 this%facet_node_msk(msk_c) = &
578 linear_index(j, 1, l, el, lx, ly, lz)
579 this%facet(msk_c) = 3
580 end do
581 end do
582 case (4)
583 do l = 1, lz
584 do j = 1, lx
585 msk_c = msk_c + 1
586 this%facet_node_msk(msk_c) = &
587 linear_index(j, ly, l, el, lx, ly, lz)
588 this%facet(msk_c) = 4
589 end do
590 end do
591 case (5)
592 do k = 1, ly
593 do j = 1, lx
594 msk_c = msk_c + 1
595 this%facet_node_msk(msk_c) = &
596 linear_index(j, k, 1, el, lx, ly, lz)
597 this%facet(msk_c) = 5
598 end do
599 end do
600 case (6)
601 do k = 1, ly
602 do j = 1, lx
603 msk_c = msk_c + 1
604 this%facet_node_msk(msk_c) = &
605 linear_index(j, k, lz, el, lx, ly, lz)
606 this%facet(msk_c) = 6
607 end do
608 end do
609 end select
610 end do
611 this%facet_node_msk(0) = msk_c
612 this%facet(0) = msk_c
613
614 if (neko_bcknd_device .eq. 1) then
615 n = msk_c + 1
616 call device_memcpy(this%facet_node_msk, this%facet_node_msk_d, n, &
617 host_to_device, sync = .true.)
618 call device_memcpy(this%facet, this%facet_d, n, &
619 host_to_device, sync = .true.)
620 end if
621
622 !Makes check for points not on facet that should have bc applied
623 call test_field%init(this%dof)
624
625 n = test_field%size()
626 test_field%x = 0.0_rp
627 !Apply this bc once
628 do i = 1, this%facet_node_msk(0)
629 test_field%x(this%facet_node_msk(i),1,1,1) = 1.0
630 end do
631 if (neko_bcknd_device .eq. 1) then
632 call device_memcpy(test_field%x, test_field%x_d, n, &
633 host_to_device, sync = .true.)
634 end if
635 !Check if some point that was not zeroed was zeroed on another element
636 call this%coef%gs_h%op(test_field, gs_op_add)
637 if (neko_bcknd_device .eq. 1) then
638 call device_memcpy(test_field%x, test_field%x_d, n, &
639 device_to_host, sync = .true.)
640 end if
641 msk_c = 0
642 do i = 1, this%dof%size()
643 if (test_field%x(i,1,1,1) .gt. 0.5) then
644 msk_c = msk_c + 1
645 end if
646 end do
647 !Allocate new mask
648 allocate(this%msk(0:msk_c))
649 j = 1
650 do i = 1, this%dof%size()
651 if (test_field%x(i,1,1,1) .gt. 0.5) then
652 this%msk(j) = i
653 j = j + 1
654 end if
655 end do
656
657 call test_field%free()
658
659 this%msk(0) = msk_c
660
661 if (neko_bcknd_device .eq. 1) then
662 n = msk_c + 1
663 call device_map(this%msk, this%msk_d, n)
664 call device_memcpy(this%msk, this%msk_d, n, &
665 host_to_device, sync = .true.)
666 end if
667
668 if (.not. allocated(this%name)) then
669! gives plenty of empty info lines during AMR restart
670! this%name = ""
671 else
672 write(log_buf, '(A,A)') 'BC assigned name : ', trim(this%name)
673 call neko_log%message(log_buf)
674 end if
675
676! causes trouble for AMR restart
677! if (.not. allocated(this%zone_indices)) then
678! allocate(this%zone_indices(1))
679! this%zone_indices(1) = -1
680! end if
681
682 end subroutine bc_finalize_base
683
687 subroutine bc_debug_mask(this, file_name)
688 class(bc_t), intent(inout) :: this
689 character(len=*), intent(in) :: file_name
690 type(field_t) :: bdry_field
691 integer:: i, m, k
692 type(file_t) :: dump_file
693
694 call bdry_field%init(this%coef%dof, 'bdry')
695 m = this%msk(0)
696 do i = 1, m
697 k = this%msk(i)
698 bdry_field%x(k,1,1,1) = 1.0_rp
699 end do
700 call dump_file%init(file_name)
701 call dump_file%write(bdry_field)
702
703 end subroutine bc_debug_mask
704
705end module bc
Apply the boundary condition to a scalar field on the device.
Definition bc.f90:236
Apply the boundary condition to a scalar field.
Definition bc.f90:197
Apply the boundary condition to a vector field on the device.
Definition bc.f90:256
Apply the boundary condition to a vector field.
Definition bc.f90:217
Constructor.
Definition bc.f90:167
Destructor.
Definition bc.f90:177
Finalize by building the mask and facet arrays.
Definition bc.f90:185
Map a Fortran array to a device (allocate and associate)
Definition device.F90:83
Copy data between host and device (or device and device)
Definition device.F90:72
Unmap a Fortran array from a device (deassociate and free)
Definition device.F90:89
Defines a boundary condition.
Definition bc.f90:34
subroutine bc_mark_zone(this, bc_zone)
Mark all facets from a zone.
Definition bc.f90:463
subroutine bc_finalize_base(this)
Finalize the construction of the bc by populting the msk and facet arrays.
Definition bc.f90:519
integer, parameter, public bc_mixed_constrains_tangent
Definition bc.f90:69
subroutine bc_free_base(this)
Destructor for the base type, bc_t.
Definition bc.f90:306
subroutine bc_mark_labeled_zones(this, zone_indices)
Mark all facets from labeled zones.
Definition bc.f90:505
integer, parameter, public bc_mixed_constrains_normal
Definition bc.f90:68
subroutine bc_restart_vector(this, u, v, w, ulag, vlag, wlag)
Default no-op restart hook for vector boundary conditions.
Definition bc.f90:282
subroutine bc_mark_labeled_zone(this, zone_index)
Mark all facets from a labeled zone.
Definition bc.f90:474
subroutine bc_restart_scalar(this, s, slag)
Default no-op restart hook for scalar boundary conditions. The lag series is optional because not eve...
Definition bc.f90:275
subroutine bc_init_base(this, coef)
Constructor.
Definition bc.f90:290
subroutine bc_apply_scalar_generic(this, x, time, strong, strm)
Apply the boundary condition to a scalar field. Dispatches to the CPU or the device version.
Definition bc.f90:404
integer, parameter, public bc_dirichlet
Supported boundary condition types. The values are set in order of precedence for global resolution....
Definition bc.f90:67
subroutine bc_apply_vector_generic(this, x, y, z, time, strong, strm)
Apply the boundary condition to a vector field. Dispatches to the CPU or the device version.
Definition bc.f90:360
subroutine bc_debug_mask(this, file_name)
Write a field showing the mask of the bc.
Definition bc.f90:688
subroutine bc_mark_facet(this, facet, el)
Mark facet on element el as part of the boundary condition.
Definition bc.f90:435
subroutine bc_mark_facets(this, facet_list)
Mark all facets from a (facet, el) tuple list.
Definition bc.f90:448
integer, parameter, public bc_neumann
Definition bc.f90:70
Coefficients.
Definition coef.f90:34
subroutine, public device_cfill(a_d, c, n, strm)
Set all elements to a constant c .
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
type(c_ptr), bind(C), public glb_cmd_queue
Global command queue.
Definition device.F90:52
Defines a mapping of the degrees of freedom.
Definition dofmap.f90:35
Defines a zone as a subset of facets in a mesh.
Contains the field_serties_t type.
Defines a field.
Definition field.f90:34
Module for file I/O operations.
Definition file.f90:34
Defines Gather-scatter operations.
Definition gs_ops.f90:34
integer, parameter, public gs_op_add
Definition gs_ops.f90:36
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 rzero(a, n)
Zero a real vector.
Definition math.f90:239
Defines a mesh.
Definition mesh.f90:34
integer, parameter, public neko_msh_max_zlbls
Max num. zone labels.
Definition mesh.f90:65
integer, parameter, public neko_msh_max_zlbl_len
Max length of a zone label.
Definition mesh.f90:67
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
Defines a function space.
Definition space.f90:34
Implements a dynamic stack ADT.
Definition stack.f90:49
Module with things related to the simulation time.
Implements a n-tuple.
Definition tuple.f90:41
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:288
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 neko_warning(warning_msg)
Reports a warning to standard output.
Definition utils.f90:452
Pointer to a `bc_t`.
Definition bc.f90:155
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
Stores a series (sequence) of fields, logically connected to a base field, and arranged according to ...
A wrapper around a polymorphic generic_file_t that handles its init. This is essentially a factory fo...
Definition file.f90:56
Type for consistently handling masks in Neko. This type encapsulates the mask array and its associate...
Definition mask.f90:51
The function space for the SEM solution fields.
Definition space.f90:64
Integer 2-tuple based stack.
Definition stack.f90:98
A struct that contains all info about the time, expand as needed.
Integer based 2-tuple.
Definition tuple.f90:58