Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
scalar_pnpn.f90
Go to the documentation of this file.
1! Copyright (c) 2022-2024, 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!
34
36 use num_types, only : rp
37 use, intrinsic :: iso_fortran_env, only : error_unit
39 rhs_maker_ext_fctry, rhs_maker_bdf_fctry, rhs_maker_oifs_fctry
41 use checkpoint, only : chkp_t
42 use field, only : field_t
44 use mesh, only : mesh_t
45 use coefs, only : coef_t
48 use gather_scatter, only : gs_t, gs_op_add, gs_op_min, gs_op_max
49 use scalar_residual, only : scalar_residual_t, scalar_residual_factory
50 use ax_product, only : ax_t, ax_helm_allocator
53 use krylov, only : ksp_monitor_t
56 use projection, only : projection_t
57 use math, only : glsc2, col2, add2s2
61 use advection, only : advection_t, advection_factory
64 use json_module, only : json_file, json_core, json_value
65 use user_intf, only : user_t
68 use time_state, only : time_state_t
69 use bc, only : bc_t, bc_dirichlet
70 use comm, only : neko_comm
71 use mpi_f08, only : mpi_allreduce, mpi_integer, mpi_max
72 implicit none
73 private
74
75
76 type, public, extends(scalar_scheme_t) :: scalar_pnpn_t
77
79 type(field_t) :: s_res
80
82 type(field_t) :: ds
83
85 class(ax_t), allocatable :: ax
86
88 type(projection_t) :: proj_s
89
91 type(scalar_bc_projector_t) :: bc_projector
92
94 class(advection_t), allocatable :: adv
95
96 ! Time interpolation scheme
97 logical :: oifs
98
99 ! Advection terms for the oifs method
100 type(field_t) :: advs
101
103 class(scalar_residual_t), allocatable :: res
104
106 class(rhs_maker_ext_t), allocatable :: makeext
107
109 class(rhs_maker_bdf_t), allocatable :: makebdf
110
112 class(rhs_maker_oifs_t), allocatable :: makeoifs
113
115 type(field_t) :: abx1, abx2
116
118 type(field_series_t), pointer :: ulag => null()
119 type(field_series_t), pointer :: vlag => null()
120 type(field_series_t), pointer :: wlag => null()
121
122 contains
124 procedure, pass(this) :: init => scalar_pnpn_init
126 procedure, pass(this) :: restart => scalar_pnpn_restart
128 procedure, pass(this) :: free => scalar_pnpn_free
130 procedure, pass(this) :: step => scalar_pnpn_step
132 procedure, pass(this) :: apply_strong_bcs => scalar_scheme_apply_strong_bcs
134 procedure, pass(this) :: setup_bcs_ => scalar_pnpn_setup_bcs_
136 end type scalar_pnpn_t
137
138 interface
139
145 module subroutine bc_factory(object, scheme, json, coef, user)
146 class(bc_t), pointer, intent(inout) :: object
147 type(scalar_pnpn_t), intent(in) :: scheme
148 type(json_file), intent(inout) :: json
149 type(coef_t), target, intent(in) :: coef
150 type(user_t), intent(in) :: user
151 end subroutine bc_factory
152 end interface
153
154contains
155
168 subroutine scalar_pnpn_init(this, msh, coef, gs, params, numerics_params, &
169 user, chkp, ulag, vlag, wlag, time_scheme, rho)
170 class(scalar_pnpn_t), target, intent(inout) :: this
171 type(mesh_t), target, intent(in) :: msh
172 type(coef_t), target, intent(in) :: coef
173 type(gs_t), target, intent(inout) :: gs
174 type(json_file), target, intent(inout) :: params
175 type(json_file), target, intent(inout) :: numerics_params
176 type(user_t), target, intent(in) :: user
177 type(chkp_t), target, intent(inout) :: chkp
178 type(field_series_t), target, intent(in) :: ulag, vlag, wlag
179 type(time_scheme_controller_t), target, intent(in) :: time_scheme
180 type(field_t), target, intent(in) :: rho
181 integer :: i
182 class(bc_t), pointer :: bc_i
183 character(len=15), parameter :: scheme = 'Modular (Pn/Pn)'
184 logical :: advection
185
186 call this%free()
187
188 ! Initiliaze base type.
189 call this%scheme_init(msh, coef, gs, params, scheme, user, rho)
190
191 ! Setup backend dependent Ax routines
192 call ax_helm_allocator(this%ax, type_name = "standard")
193
194 ! Setup backend dependent scalar residual routines
195 call scalar_residual_factory(this%res)
196
197 ! Setup backend dependent summation of extrapolation scheme
198 call rhs_maker_ext_fctry(this%makeext)
199
200 ! Setup backend dependent contributions to F from lagged BD terms
201 call rhs_maker_bdf_fctry(this%makebdf)
202
203 ! Setup backend dependent contributions of the OIFS scheme
204 call rhs_maker_oifs_fctry(this%makeoifs)
205
206 ! Initialize variables specific to this plan
207 associate(xh_lx => this%Xh%lx, xh_ly => this%Xh%ly, xh_lz => this%Xh%lz, &
208 dm_xh => this%dm_Xh, nelv => this%msh%nelv)
209
210 call this%s_res%init(dm_xh, "s_res")
211
212 call this%abx1%init(dm_xh, trim(this%name) // "_abx1")
213
214 call this%abx2%init(dm_xh, trim(this%name) // "_abx2")
215
216 call this%advs%init(dm_xh, "advs")
217
218 call this%ds%init(dm_xh, 'ds')
219
220 end associate
221
222 ! Set up boundary conditions
223 call this%setup_bcs_(user)
224
225 do i = 1, this%bcs%size()
226 if (this%bcs%bc_type(i) .eq. bc_dirichlet) then
227 bc_i => this%bcs%get(i)
228 call this%bc_projector%mark(bc_i)
229 end if
230 end do
231
232 ! Initialize projection space
233 call this%proj_s%init(this%dm_Xh%size(), this%projection_dim, &
234 this%projection_activ_step)
235
236 ! Determine the time-interpolation scheme
237 call json_get_or_default(numerics_params, 'oifs', this%oifs, .false.)
238 ! Point to case checkpoint
239 this%chkp => chkp
240 ! Initialize advection factory
241 call json_get_or_default(params, 'advection', advection, .true.)
242 ! OIFS integrates the advection term. With advection disabled, fall back to
243 ! the standard BDF history assembly.
244 this%oifs = this%oifs .and. advection
245
246 this%ulag => ulag
247 this%vlag => vlag
248 this%wlag => wlag
249
250 call advection_factory(this%adv, numerics_params, this%c_Xh, &
251 ulag, vlag, wlag, this%chkp%dtlag, &
252 this%chkp%tlag, time_scheme, .not. advection, &
253 this%slag)
254 end subroutine scalar_pnpn_init
255
256 ! Restarts the scalar from a checkpoint
257 subroutine scalar_pnpn_restart(this, chkp)
258 class(scalar_pnpn_t), target, intent(inout) :: this
259 type(chkp_t), intent(inout) :: chkp
260 real(kind=rp) :: dtlag(10), tlag(10)
261 integer :: n
262 type(field_t), pointer :: temp_field
263 dtlag = chkp%dtlag
264 tlag = chkp%tlag
265
266 n = this%s%dof%size()
267
268 ! Lag fields are restored through the checkpoint's fsp mechanism
269
270 call col2(this%s%x, this%c_Xh%mult, n)
271 call col2(this%slag%lf(1)%x, this%c_Xh%mult, n)
272 call col2(this%slag%lf(2)%x, this%c_Xh%mult, n)
273 if (neko_bcknd_device .eq. 1) then
274 call device_memcpy(this%s%x, this%s%x_d, &
275 n, host_to_device, sync = .false.)
276 call device_memcpy(this%slag%lf(1)%x, this%slag%lf(1)%x_d, &
277 n, host_to_device, sync = .false.)
278 call device_memcpy(this%slag%lf(2)%x, this%slag%lf(2)%x_d, &
279 n, host_to_device, sync = .false.)
280 call device_memcpy(this%abx1%x, this%abx1%x_d, &
281 n, host_to_device, sync = .false.)
282 call device_memcpy(this%abx2%x, this%abx2%x_d, &
283 n, host_to_device, sync = .false.)
284 call device_memcpy(this%advs%x, this%advs%x_d, &
285 n, host_to_device, sync = .false.)
286 end if
287
288 call this%gs_Xh%op(this%s, gs_op_add)
289 call this%gs_Xh%op(this%slag%lf(1), gs_op_add)
290 call this%gs_Xh%op(this%slag%lf(2), gs_op_add)
291
292 end subroutine scalar_pnpn_restart
293
294 subroutine scalar_pnpn_free(this)
295 class(scalar_pnpn_t), intent(inout) :: this
296
297 !Deallocate scalar field
298 call this%scheme_free()
299
300 call this%bc_projector%free()
301 call this%proj_s%free()
302
303 call this%s_res%free()
304
305 call this%ds%free()
306
307 call this%abx1%free()
308 call this%abx2%free()
309
310 call this%advs%free()
311
312 if (allocated(this%adv)) then
313 call this%adv%free()
314 deallocate(this%adv)
315 end if
316
317 nullify(this%ulag)
318 nullify(this%vlag)
319 nullify(this%wlag)
320
321 if (allocated(this%Ax)) then
322 deallocate(this%Ax)
323 end if
324
325 if (allocated(this%res)) then
326 deallocate(this%res)
327 end if
328
329 if (allocated(this%makeext)) then
330 deallocate(this%makeext)
331 end if
332
333 if (allocated(this%makebdf)) then
334 deallocate(this%makebdf)
335 end if
336
337 if (allocated(this%makeoifs)) then
338 deallocate(this%makeoifs)
339 end if
340
341 end subroutine scalar_pnpn_free
342
343 subroutine scalar_pnpn_step(this, time, ext_bdf, dt_controller, &
344 ksp_results)
345 class(scalar_pnpn_t), intent(inout) :: this
346 type(time_state_t), intent(in) :: time
347 type(time_scheme_controller_t), intent(in) :: ext_bdf
348 type(time_step_controller_t), intent(in) :: dt_controller
349 type(ksp_monitor_t), intent(inout) :: ksp_results
350 type(field_t), pointer :: rho_cp
351 integer :: rho_cp_index
352 ! Number of degrees of freedom
353 integer :: n
354
355 if (this%freeze) return
356
357 n = this%dm_Xh%size()
358 call neko_scratch_registry%request_field(rho_cp, rho_cp_index, .false.)
359
360 call profiler_start_region(trim(this%name), 2)
361 associate(u => this%u, v => this%v, w => this%w, s => this%s, &
362 cp => this%cp, rho => this%rho, lambda_tot => this%lambda_tot, &
363 ds => this%ds, &
364 s_res => this%s_res, &
365 ax => this%Ax, f_xh => this%f_Xh, xh => this%Xh, &
366 c_xh => this%c_Xh, dm_xh => this%dm_Xh, gs_xh => this%gs_Xh, &
367 slag => this%slag, oifs => this%oifs, &
368 projection_dim => this%projection_dim, &
369 msh => this%msh, res => this%res, makeoifs => this%makeoifs, &
370 makeext => this%makeext, makebdf => this%makebdf, &
371 t => time%t, tstep => time%tstep, dt => time%dt)
372
373 ! Logs extra information the log level is NEKO_LOG_DEBUG or above.
374 call print_debug(this)
375
376 ! Update material properties and their pointwise product.
377 call this%update_material_properties(time)
378 call field_col3(rho_cp, rho, cp, n)
379
380 ! Compute the source terms
381 call this%source_term%compute(time)
382
383 if (oifs) then
384 ! The fluid step has already advanced u, v, and w to the new time.
385 ! Its first lag fields contain the velocity at tlag(1), which is the
386 ! latest time represented by the OIFS interpolation history.
387 call this%adv%compute_scalar(this%ulag%lf(1), this%vlag%lf(1), &
388 this%wlag%lf(1), s, this%advs, &
389 xh, this%c_Xh, dm_xh%size())
390 else
391 ! Add the advection operators to the right-hand side.
392 call this%adv%compute_scalar(u, v, w, s, f_xh, &
393 xh, this%c_Xh, dm_xh%size())
394 end if
395
396 ! Scale the volumetric source and advection terms by rho * cp.
397 call field_col2(f_xh, rho_cp, n)
398
399 ! Add weak boundary fluxes without scaling them by rho * cp.
400 call this%bcs%apply_scalar(f_xh%x, n, time, .false.)
401
402 ! Extrapolate the already scaled explicit right-hand side.
403 call makeext%compute_scalar(this%abx1, this%abx2, f_xh%x, &
404 ext_bdf%advection_coeffs%x, n)
405
406 if (oifs) then
407 call makeoifs%compute_scalar(this%advs%x, f_xh%x, &
408 rho_cp, real(dt, kind=rp), n)
409 else
410
411 ! Add the RHS contributions coming from the BDF scheme.
412 call makebdf%compute_scalar(slag, f_xh%x, s, c_xh%B, &
413 rho_cp, real(dt, kind=rp), ext_bdf%diffusion_coeffs%x, &
414 ext_bdf%ndiff, n)
415 end if
416
417 call slag%update()
418
420 call this%apply_strong_bcs(time)
421
422 ! Compute scalar residual.
423 call profiler_start_region(trim(this%name) // '_residual', 20)
424 call res%compute(ax, s, s_res, f_xh, c_xh, msh, xh, lambda_tot, &
425 rho_cp, ext_bdf%diffusion_coeffs%x(1), &
426 real(dt, kind=rp), dm_xh%size())
427
428 call gs_xh%op(s_res, gs_op_add)
429
430 ! Zero-out residual at Dirichlet nodes before solving.
431 call this%bc_projector%apply(s_res%x, dm_xh%size())
432
433 call profiler_end_region(trim(this%name) // '_residual', 20)
434
435 call this%proj_s%pre_solving(s_res%x, tstep, c_xh, n, dt_controller)
436
437 call this%pc%update()
438 call profiler_start_region(trim(this%name) // '_solve', 21)
439 ksp_results = this%ksp%solve(ax, ds, s_res%x, n, &
440 c_xh, this%bc_projector, gs_xh)
441 ksp_results%name = trim(this%name)
442 call profiler_end_region(trim(this%name) // '_solve', 21)
443
444 call this%proj_s%post_solving(ds%x, ax, c_xh, this%bc_projector, gs_xh, &
445 n, tstep, dt_controller)
446
447 ! Update the solution
448 if (neko_bcknd_device .eq. 1) then
449 call device_add2s2(s%x_d, ds%x_d, 1.0_rp, n)
450 else
451 call add2s2(s%x, ds%x, 1.0_rp, n)
452 end if
453
454 end associate
455 call neko_scratch_registry%relinquish_field(rho_cp_index)
456 call profiler_end_region(trim(this%name), 2)
457 end subroutine scalar_pnpn_step
458
459 subroutine print_debug(this)
460 class(scalar_pnpn_t), intent(inout) :: this
461 character(len=LOG_SIZE) :: log_buf
462 integer :: n
463
464 n = this%dm_Xh%size()
465
466 write(log_buf, '(A, A, E15.7, A, E15.7, A, E15.7)') 'Scalar debug', &
467 ' l2norm s', glsc2(this%s%x, this%s%x, n), &
468 ' slag1', glsc2(this%slag%lf(1)%x, this%slag%lf(1)%x, n), &
469 ' slag2', glsc2(this%slag%lf(2)%x, this%slag%lf(2)%x, n)
470 call neko_log%message(log_buf, lvl = neko_log_debug)
471 write(log_buf, '(A, A, E15.7, A, E15.7)') 'Scalar debug2', &
472 ' l2norm abx1', glsc2(this%abx1%x, this%abx1%x, n), &
473 ' abx2', glsc2(this%abx2%x, this%abx2%x, n)
474 call neko_log%message(log_buf, lvl = neko_log_debug)
475 end subroutine print_debug
476
479 subroutine scalar_pnpn_setup_bcs_(this, user)
480 class(scalar_pnpn_t), target, intent(inout) :: this
481 type(user_t), target, intent(in) :: user
482 integer :: i, j, n_bcs, zone_size, global_zone_size, ierr
483 type(json_core) :: core
484 type(json_value), pointer :: bc_object
485 type(json_file) :: bc_subdict
486 class(bc_t), pointer :: bc_i
487 logical :: found
488 ! Monitor which boundary zones have been marked
489 logical, allocatable :: marked_zones(:)
490 integer, allocatable :: zone_indices(:)
491
492 if (this%params%valid_path('boundary_conditions')) then
493 call this%params%info('boundary_conditions', &
494 n_children = n_bcs)
495 call this%params%get_core(core)
496 call this%params%get('boundary_conditions', bc_object, found)
497
498 call this%bcs%init(n_bcs)
499
500 allocate(marked_zones(size(this%msh%labeled_zones)))
501 marked_zones = .false.
502
503 do i = 1, n_bcs
504 ! Create a new json containing just the subdict for this bc
505 call json_extract_item(core, bc_object, i, bc_subdict)
506
507 ! Check that we are not trying to assing a bc to zone, for which one
508 ! has already been assigned and that the zone has more than 0 size
509 ! in the mesh.
510 call json_get(bc_subdict, "zone_indices", zone_indices)
511
512 do j = 1, size(zone_indices)
513 zone_size = this%msh%labeled_zones(zone_indices(j))%size
514 call mpi_allreduce(zone_size, global_zone_size, 1, &
515 mpi_integer, mpi_max, neko_comm, ierr)
516
517 if (global_zone_size .eq. 0) then
518 write(error_unit, '(A, A, I0, A, A, I0, A)') &
519 "*** ERROR ***: ", "Zone index ", zone_indices(j), &
520 " is invalid as this zone has 0 size, meaning it ", &
521 "does not exist in the mesh. Check scalar boundary ", &
522 "condition ", i, "."
523 error stop
524 end if
525
526 if (marked_zones(zone_indices(j))) then
527 write(error_unit, '(A, A, I0, A, A, A, A)') "*** ERROR ***: ", &
528 "Zone with index ", zone_indices(j), &
529 " has already been assigned a boundary condition. ", &
530 "Please check your boundary_conditions entry for the ", &
531 "scalar and make sure that each zone index appears only ",&
532 "in a single boundary condition."
533 error stop
534 else
535 marked_zones(zone_indices(j)) = .true.
536 end if
537 end do
538
539 bc_i => null()
540
541 call bc_factory(bc_i, this, bc_subdict, this%c_Xh, user)
542 call this%bcs%append(bc_i)
543 end do
544
545 ! Make sure all labeled zones with non-zero size have been marked
546 do i = 1, size(this%msh%labeled_zones)
547 if ((this%msh%labeled_zones(i)%size .gt. 0) .and. &
548 (.not. marked_zones(i))) then
549 write(error_unit, '(A, A, I0)') "*** ERROR ***: ", &
550 "No scalar boundary condition assigned to zone ", i
551 error stop
552 end if
553 end do
554 else
555 ! Check that there are no labeled zones, i.e. all are periodic.
556 do i = 1, size(this%msh%labeled_zones)
557 if (this%msh%labeled_zones(i)%size .gt. 0) then
558 write(error_unit, '(A, A, A)') "*** ERROR ***: ", &
559 "No boundary_conditions entry in the case file for scalar ", &
560 this%s%name
561 error stop
562 end if
563 end do
564
565 ! For a pure periodic case, we still need to initilise the bc lists
566 ! to a zero size to avoid issues with apply() in step()
567 call this%bcs%init()
568
569 end if
570 end subroutine scalar_pnpn_setup_bcs_
571
574 subroutine scalar_scheme_apply_strong_bcs(this, time)
575 class(scalar_pnpn_t), intent(inout) :: this
576 type(time_state_t), intent(in) :: time
577
578 integer :: i
579 class(bc_t), pointer :: bc_i
580 bc_i => null()
581
582 ! First apply call, sets the Dirichlet value, let's call it d.
583 call this%bcs%apply(this%s, time = time, strong = .true.)
584 ! If we now have local nodes sharing the same global node, and with
585 ! some nodes not masked as Dirichlet, the node which *is* masked
586 ! will have the value d, and the the other ones just some value u.
587 ! Take a nodewise minimum between the local nodes.
588 ! Now, all local nodes store m = min(d, u)
589 call this%gs_Xh%op(this%s, gs_op_min, glb_cmd_event)
590 call device_event_sync(glb_cmd_event)
591
592 ! Second apply call, so Dirichlet nodes again store d, the rest still store
593 ! m, where m < d by construction.
594 call this%bcs%apply(this%s, time = time, strong = .true.)
595 ! Now apply a max, which guarantees that d wins and gets stored in all the
596 ! local nodes.
597 call this%gs_Xh%op(this%s, gs_op_max, glb_cmd_event)
598 call device_event_sync(glb_cmd_event)
599
600 ! Reset updated flags
601 do i = 1, this%bcs%size()
602 bc_i => this%bcs%get(i)
603 bc_i%updated = .false.
604 end do
605 nullify(bc_i)
606
607 end subroutine scalar_scheme_apply_strong_bcs
608
609
610end module scalar_pnpn
double real
Copy data between host and device (or device and device)
Definition device.F90:72
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.
Subroutines to add advection terms to the RHS of a transport equation.
Definition advection.f90:34
Defines a Matrix-vector product.
Definition ax.f90:34
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:66
Defines a checkpoint.
Coefficients.
Definition coef.f90:34
Definition comm.F90:1
type(mpi_comm), public neko_comm
MPI communicator.
Definition comm.F90:46
subroutine, public device_add2s2(a_d, b_d, c1, n, strm)
Vector addition with scalar multiplication (multiplication on first argument)
subroutine, public device_col2(a_d, b_d, n, strm)
Vector multiplication .
Device abstraction, common interface for various accelerators.
Definition device.F90:34
subroutine, public device_event_sync(event)
Synchronize an event.
Definition device.F90:1667
integer, parameter, public host_to_device
Definition device.F90:48
type(c_ptr), bind(C), public glb_cmd_event
Event for the global command queue.
Definition device.F90:63
Dirichlet condition applied in the facet normal direction.
subroutine, public field_col2(a, b, n)
Vector multiplication .
subroutine, public field_col3(a, b, c, n)
Vector multiplication with 3 vectors .
Contains the field_serties_t type.
Defines a field.
Definition field.f90:34
Gather-scatter.
Utilities for retrieving parameters from the case files.
Implements the base abstract type for Krylov solvers plus helper types.
Definition krylov.f90:34
Logging routines.
Definition log.f90:34
integer, parameter, public neko_log_debug
Debug log level.
Definition log.f90:90
type(log_t), public neko_log
Global log stream.
Definition log.f90:80
integer, parameter, public log_size
Definition log.f90:46
Definition math.f90:60
real(kind=rp) function, public glsc2(a, b, n)
Weighted inner product .
Definition math.f90:1269
subroutine, public col2(a, b, n)
Vector multiplication .
Definition math.f90:1049
subroutine, public add2s2(a, b, c1, n)
Vector addition with scalar multiplication (multiplication on second argument)
Definition math.f90:1001
Defines a mesh.
Definition mesh.f90:34
Build configurations.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:14
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
Project x onto X, the space of old solutions and back again.
Routines to generate the right-hand sides for the convection-diffusion equation. Employs the EXT/BDF ...
Definition rhs_maker.f90:38
Implements scalar_projector_t.
Contains the scalar_pnpn_t type.
subroutine scalar_pnpn_step(this, time, ext_bdf, dt_controller, ksp_results)
subroutine scalar_pnpn_setup_bcs_(this, user)
Initialize boundary conditions.
subroutine scalar_scheme_apply_strong_bcs(this, time)
Apply strong boundary conditions.
subroutine scalar_pnpn_restart(this, chkp)
subroutine scalar_pnpn_init(this, msh, coef, gs, params, numerics_params, user, chkp, ulag, vlag, wlag, time_scheme, rho)
Boundary condition factory. Both constructs and initializes the object.
subroutine scalar_pnpn_free(this)
Defines the residual for the scalar transport equation.
Contains the scalar_scheme_t type.
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.
Compound scheme for the advection and diffusion operators in a transport equation.
Base class for time integration schemes.
Module with things related to the simulation time.
Implements type time_step_controller.
Interfaces for user interaction with NEKO.
Definition user_intf.f90:34
Base abstract type for computing the advection operator.
Definition advection.f90:46
Base type for a matrix-vector product providing .
Definition ax.f90:43
Base type for a boundary condition.
Definition bc.f90:72
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition coef.f90:93
Dirichlet condition in facet normal direction.
Stores a series (sequence) of fields, logically connected to a base field, and arranged according to ...
Gather-scatter kernel.
Type for storing initial and final residuals in a Krylov solver.
Definition krylov.f90:57
Abstract type to add contributions to F from lagged BD terms.
Definition rhs_maker.f90:59
Abstract type to sum up contributions to kth order extrapolation scheme.
Definition rhs_maker.f90:52
Abstract type to add contributions of kth order OIFS scheme.
Definition rhs_maker.f90:66
Projector for scalar boundary conditions.
Abstract type to compute scalar residual.
Base type for a scalar advection-diffusion solver.
Implements the logic to compute the time coefficients for the advection and diffusion operators in a ...
A struct that contains all info about the time, expand as needed.
A type collecting all the overridable user routines and flag to suppress type injection from custom m...