Neko  0.8.1
A portable framework for high-order spectral element flow simulations
scalar_scheme.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 
35 ! todo: module name
37  use gather_scatter, only : gs_t
38  use checkpoint, only : chkp_t
39  use num_types, only: rp
40  use field, only : field_t
41  use field_list, only: field_list_t
42  use space, only : space_t
43  use dofmap, only : dofmap_t
44  use krylov, only : ksp_t
45  use coefs, only : coef_t
46  use dirichlet, only : dirichlet_t
47  use neumann, only : neumann_t
49  use jacobi, only : jacobi_t
50  use device_jacobi, only : device_jacobi_t
51  use sx_jacobi, only : sx_jacobi_t
52  use hsmg, only : hsmg_t
53  use precon_fctry, only : precon_factory, pc_t, precon_destroy
54  use bc, only : bc_t, bc_list_t, bc_list_free, bc_list_init, &
58  use facet_zone, only : facet_zone_t
60  use logger, only : neko_log, log_size
64  use json_module, only : json_file
65  use user_intf, only : user_t
67  use utils, only : neko_error
68  use comm, only: neko_comm, mpi_integer, mpi_sum
70  use field_series
72  implicit none
73 
75  type, abstract :: scalar_scheme_t
77  type(field_t), pointer :: u
79  type(field_t), pointer :: v
81  type(field_t), pointer :: w
83  type(field_t), pointer :: s
85  type(field_series_t) :: slag
87  type(space_t), pointer :: xh
89  type(dofmap_t), pointer :: dm_xh
91  type(gs_t), pointer :: gs_xh
93  type(coef_t), pointer :: c_xh
95  type(field_t), pointer :: f_xh => null()
99  class(ksp_t), allocatable :: ksp
101  integer :: ksp_maxiter
103  integer :: projection_dim
104 
105  integer :: projection_activ_step
107  class(pc_t), allocatable :: pc
109  type(dirichlet_t) :: dir_bcs(neko_msh_max_zlbls)
111  type(field_dirichlet_t) :: field_dir_bc
113  procedure(field_dirichlet_update), nopass, pointer :: dirichlet_update_ &
114  => null()
116  type(bc_list_t) :: field_dirichlet_bcs
117 
118  type(field_list_t) :: field_dirichlet_fields
120  type(neumann_t) :: neumann_bcs(neko_msh_max_zlbls)
122  type(usr_scalar_t) :: user_bc
124  integer :: n_dir_bcs = 0
126  integer :: n_neumann_bcs = 0
128  type(bc_list_t) :: bclst_dirichlet
130  type(bc_list_t) :: bclst_neumann
132  type(json_file), pointer :: params
134  type(mesh_t), pointer :: msh => null()
136  type(chkp_t) :: chkp
138  real(kind=rp), pointer :: lambda
140  real(kind=rp), pointer :: rho
142  real(kind=rp), pointer :: cp
144  character(len=NEKO_MSH_MAX_ZLBL_LEN), allocatable :: bc_labels(:)
145  contains
147  procedure, pass(this) :: scheme_init => scalar_scheme_init
149  procedure, pass(this) :: scheme_free => scalar_scheme_free
151  procedure, pass(this) :: validate => scalar_scheme_validate
153  procedure, pass(this) :: set_user_bc => scalar_scheme_set_user_bc
155  procedure(scalar_scheme_init_intrf), pass(this), deferred :: init
157  procedure(scalar_scheme_free_intrf), pass(this), deferred :: free
159  procedure(scalar_scheme_step_intrf), pass(this), deferred :: step
161  procedure(scalar_scheme_restart_intrf), pass(this), deferred :: restart
162  end type scalar_scheme_t
163 
165  abstract interface
166  subroutine scalar_scheme_init_intrf(this, msh, coef, gs, params, user,&
167  material_properties)
168  import scalar_scheme_t
169  import json_file
170  import coef_t
171  import gs_t
172  import mesh_t
173  import user_t
174  import material_properties_t
175  class(scalar_scheme_t), target, intent(inout) :: this
176  type(mesh_t), target, intent(inout) :: msh
177  type(coef_t), target, intent(inout) :: coef
178  type(gs_t), target, intent(inout) :: gs
179  type(json_file), target, intent(inout) :: params
180  type(user_t), target, intent(in) :: user
181  type(material_properties_t), intent(inout) :: material_properties
182  end subroutine scalar_scheme_init_intrf
183  end interface
184 
186  abstract interface
187  subroutine scalar_scheme_restart_intrf(this, dtlag, tlag)
188  import scalar_scheme_t
189  import chkp_t
190  import rp
191  class(scalar_scheme_t), target, intent(inout) :: this
192  real(kind=rp) :: dtlag(10), tlag(10)
193  end subroutine scalar_scheme_restart_intrf
194  end interface
195 
196 
198  abstract interface
199  subroutine scalar_scheme_free_intrf(this)
200  import scalar_scheme_t
201  class(scalar_scheme_t), intent(inout) :: this
202  end subroutine scalar_scheme_free_intrf
203  end interface
204 
206  abstract interface
207  subroutine scalar_scheme_step_intrf(this, t, tstep, dt, ext_bdf, dt_controller)
208  import scalar_scheme_t
211  import rp
212  class(scalar_scheme_t), intent(inout) :: this
213  real(kind=rp), intent(inout) :: t
214  integer, intent(inout) :: tstep
215  real(kind=rp), intent(in) :: dt
216  type(time_scheme_controller_t), intent(inout) :: ext_bdf
217  type(time_step_controller_t), intent(in) :: dt_controller
218  end subroutine scalar_scheme_step_intrf
219  end interface
220 
221 contains
222 
227  subroutine scalar_scheme_add_bcs(this, zones, bc_labels)
228  class(scalar_scheme_t), intent(inout) :: this
229  type(facet_zone_t), intent(inout) :: zones(NEKO_MSH_MAX_ZLBLS)
230  character(len=NEKO_MSH_MAX_ZLBL_LEN), intent(in) :: bc_labels(:)
231  character(len=NEKO_MSH_MAX_ZLBL_LEN) :: bc_label
232  integer :: i, j, bc_idx
233  real(kind=rp) :: dir_value, flux_value
234  logical :: bc_exists
235 
236  do i = 1, size(bc_labels)
237  bc_label = trim(bc_labels(i))
238  if (bc_label(1:2) .eq. 'd=') then
239 ! The idea of this commented piece of code is to merge bcs with the same
240 ! Dirichlet value into 1 so that one has less kernel launches. Currently
241 ! segfaults, needs investigation.
242 ! bc_exists = .false.
243 ! bc_idx = 0
244 ! do j = 1, i-1
245 ! if (bc_label .eq. bc_labels(j)) then
246 ! bc_exists = .true.
247 ! bc_idx = j
248 ! end if
249 ! end do
250 
251 ! if (bc_exists) then
252 ! call this%dir_bcs(j)%mark_zone(zones(i))
253 ! else
254  this%n_dir_bcs = this%n_dir_bcs + 1
255  call this%dir_bcs(this%n_dir_bcs)%init(this%c_Xh)
256  call this%dir_bcs(this%n_dir_bcs)%mark_zone(zones(i))
257  read(bc_label(3:), *) dir_value
258  call this%dir_bcs(this%n_dir_bcs)%set_g(dir_value)
259 ! end if
260  end if
261 
262  if (bc_label(1:2) .eq. 'n=') then
263  this%n_neumann_bcs = this%n_neumann_bcs + 1
264  call this%neumann_bcs(this%n_neumann_bcs)%init(this%c_Xh)
265  call this%neumann_bcs(this%n_neumann_bcs)%mark_zone(zones(i))
266  read(bc_label(3:), *) flux_value
267  call this%neumann_bcs(this%n_neumann_bcs)%init_neumann(flux_value)
268  end if
269 
271  if (bc_label(1:4) .eq. 'user') then
272  call this%user_bc%mark_zone(zones(i))
273  end if
274 
275  end do
276 
277  do i = 1, this%n_dir_bcs
278  call this%dir_bcs(i)%finalize()
279  call bc_list_add(this%bclst_dirichlet, this%dir_bcs(i))
280  end do
281 
282  ! Create list with just Neumann bcs
283  call bc_list_init(this%bclst_neumann, this%n_neumann_bcs)
284  do i=1, this%n_neumann_bcs
285  call this%neumann_bcs(i)%finalize()
286  call bc_list_add(this%bclst_neumann, this%neumann_bcs(i))
287  end do
288 
289  end subroutine scalar_scheme_add_bcs
290 
298  subroutine scalar_scheme_init(this, msh, c_Xh, gs_Xh, params, scheme, user, &
299  material_properties)
300  class(scalar_scheme_t), target, intent(inout) :: this
301  type(mesh_t), target, intent(inout) :: msh
302  type(coef_t), target, intent(inout) :: c_Xh
303  type(gs_t), target, intent(inout) :: gs_Xh
304  type(json_file), target, intent(inout) :: params
305  character(len=*), intent(in) :: scheme
306  type(user_t), target, intent(in) :: user
307  type(material_properties_t), target, intent(inout) :: material_properties
308  ! IO buffer for log output
309  character(len=LOG_SIZE) :: log_buf
310  ! Variables for retrieving json parameters
311  logical :: logical_val
312  real(kind=rp) :: real_val, solver_abstol
313  integer :: integer_val, ierr
314  character(len=:), allocatable :: solver_type, solver_precon
315 
316  this%u => neko_field_registry%get_field('u')
317  this%v => neko_field_registry%get_field('v')
318  this%w => neko_field_registry%get_field('w')
319 
320  call neko_log%section('Scalar')
321  call json_get(params, 'case.fluid.velocity_solver.type', solver_type)
322  call json_get(params, 'case.fluid.velocity_solver.preconditioner',&
323  solver_precon)
324  call json_get(params, 'case.fluid.velocity_solver.absolute_tolerance',&
325  solver_abstol)
326 
327  !
328  ! Material properties
329  !
330  this%rho => material_properties%rho
331  this%lambda => material_properties%lambda
332  this%cp => material_properties%cp
333 
334  write(log_buf, '(A,ES13.6)') 'rho :', this%rho
335  call neko_log%message(log_buf)
336  write(log_buf, '(A,ES13.6)') 'lambda :', this%lambda
337  call neko_log%message(log_buf)
338  write(log_buf, '(A,ES13.6)') 'cp :', this%cp
339  call neko_log%message(log_buf)
340 
341  call json_get_or_default(params, &
342  'case.fluid.velocity_solver.projection_space_size',&
343  this%projection_dim, 20)
344  call json_get_or_default(params, &
345  'case.fluid.velocity_solver.projection_hold_steps',&
346  this%projection_activ_step, 5)
347 
348 
349  write(log_buf, '(A, A)') 'Type : ', trim(scheme)
350  call neko_log%message(log_buf)
351  call neko_log%message('Ksp scalar : ('// trim(solver_type) // &
352  ', ' // trim(solver_precon) // ')')
353  write(log_buf, '(A,ES13.6)') ' `-abs tol :', solver_abstol
354  call neko_log%message(log_buf)
355 
356  this%Xh => this%u%Xh
357  this%dm_Xh => this%u%dof
358  this%params => params
359  this%msh => msh
360  if (.not. neko_field_registry%field_exists('s')) then
361  call neko_field_registry%add_field(this%dm_Xh, 's')
362  end if
363  this%s => neko_field_registry%get_field('s')
364 
365  call this%slag%init(this%s, 2)
366 
367  this%gs_Xh => gs_xh
368  this%c_Xh => c_xh
369 
370 
371  !
372  ! Setup scalar boundary conditions
373  !
374  call bc_list_init(this%bclst_dirichlet)
375  call this%user_bc%init(this%c_Xh)
376 
377  ! Read boundary types from the case file
378  allocate(this%bc_labels(neko_msh_max_zlbls))
379 
380  ! A filler value
381  this%bc_labels = "not"
382 
383  if (params%valid_path('case.scalar.boundary_types')) then
384  call json_get(params, &
385  'case.scalar.boundary_types', &
386  this%bc_labels)
387  end if
388 
389 
390  !
391  ! Setup right-hand side field.
392  !
393  allocate(this%f_Xh)
394  call this%f_Xh%init(this%dm_Xh, fld_name="scalar_rhs")
395 
396  ! Initialize the source term
397  call this%source_term%init(params, this%f_Xh, this%c_Xh, user)
398 
399  call scalar_scheme_add_bcs(this, msh%labeled_zones, this%bc_labels)
400 
401  ! Mark BC zones
402  call this%user_bc%mark_zone(msh%wall)
403  call this%user_bc%mark_zone(msh%inlet)
404  call this%user_bc%mark_zone(msh%outlet)
405  call this%user_bc%mark_zone(msh%outlet_normal)
406  call this%user_bc%mark_zone(msh%sympln)
407  call this%user_bc%finalize()
408  call this%user_bc%set_coef(this%c_Xh)
409  if (this%user_bc%msk(0) .gt. 0) call bc_list_add(this%bclst_dirichlet,&
410  this%user_bc)
411 
412  ! Add field dirichlet BCs
413  call this%field_dir_bc%init(this%c_Xh)
414  call this%field_dir_bc%mark_zones_from_list(msh%labeled_zones, &
415  'd_s', this%bc_labels)
416  call this%field_dir_bc%finalize()
417  call mpi_allreduce(this%field_dir_bc%msk(0), integer_val, 1, &
418  mpi_integer, mpi_sum, neko_comm, ierr)
419  if (integer_val .gt. 0) call this%field_dir_bc%init_field('d_s')
420 
421  call bc_list_add(this%bclst_dirichlet, this%field_dir_bc)
422 
423  !
424  ! Associate our field dirichlet update to the user one.
425  !
426  this%dirichlet_update_ => user%user_dirichlet_update
427 
428  !
429  ! Initialize field list and bc list for user_dirichlet_update
430  !
431  allocate(this%field_dirichlet_fields%fields(1))
432  this%field_dirichlet_fields%fields(1)%f => &
433  this%field_dir_bc%field_bc
434 
435  call bc_list_init(this%field_dirichlet_bcs, size=1)
436  call bc_list_add(this%field_dirichlet_bcs, this%field_dir_bc)
437 
438 
439  ! todo parameter file ksp tol should be added
440  call json_get_or_default(params, 'case.fluid.velocity_solver.max_iterations',&
441  integer_val, 800)
442  call scalar_scheme_solver_factory(this%ksp, this%dm_Xh%size(), &
443  solver_type, integer_val, solver_abstol)
444  call scalar_scheme_precon_factory(this%pc, this%ksp, &
445  this%c_Xh, this%dm_Xh, this%gs_Xh, this%bclst_dirichlet, solver_precon)
446 
447  call neko_log%end_section()
448 
449  end subroutine scalar_scheme_init
450 
451 
453  subroutine scalar_scheme_free(this)
454  class(scalar_scheme_t), intent(inout) :: this
455 
456  nullify(this%Xh)
457  nullify(this%dm_Xh)
458  nullify(this%gs_Xh)
459  nullify(this%c_Xh)
460  nullify(this%params)
461 
462  if (allocated(this%ksp)) then
463  call krylov_solver_destroy(this%ksp)
464  deallocate(this%ksp)
465  end if
466 
467  if (allocated(this%pc)) then
468  call precon_destroy(this%pc)
469  deallocate(this%pc)
470  end if
471 
472  if (allocated(this%bc_labels)) then
473  deallocate(this%bc_labels)
474  end if
475 
476  call this%source_term%free()
477 
478  call bc_list_free(this%bclst_dirichlet)
479  call bc_list_free(this%bclst_neumann)
480 
481  call this%slag%free()
482 
483  ! Free everything related to field dirichlet BCs
484  call this%field_dirichlet_fields%free()
485  call bc_list_free(this%field_dirichlet_bcs)
486  call this%field_dir_bc%field_bc%free()
487  call this%field_dir_bc%free()
488  if (associated(this%dirichlet_update_)) then
489  this%dirichlet_update_ => null()
490  end if
491 
492  end subroutine scalar_scheme_free
493 
496  subroutine scalar_scheme_validate(this)
497  class(scalar_scheme_t), target, intent(inout) :: this
498 
499  if ( (.not. allocated(this%u%x)) .or. &
500  (.not. allocated(this%v%x)) .or. &
501  (.not. allocated(this%w%x)) .or. &
502  (.not. allocated(this%s%x))) then
503  call neko_error('Fields are not allocated')
504  end if
505 
506  if (.not. allocated(this%ksp)) then
507  call neko_error('No Krylov solver for velocity defined')
508  end if
509 
510  if (.not. associated(this%Xh)) then
511  call neko_error('No function space defined')
512  end if
513 
514  if (.not. associated(this%dm_Xh)) then
515  call neko_error('No dofmap defined')
516  end if
517 
518  if (.not. associated(this%c_Xh)) then
519  call neko_error('No coefficients defined')
520  end if
521 
522  if (.not. associated(this%f_Xh)) then
523  call neko_error('No rhs allocated')
524  end if
525 
526  if (.not. associated(this%params)) then
527  call neko_error('No parameters defined')
528  end if
529 
530  !
531  ! Setup checkpoint structure (if everything is fine)
532  !
533 ! @todo no io for now
534 ! call this%chkp%init(this%u, this%v, this%w, this%p)
535 
536  end subroutine scalar_scheme_validate
537 
540  subroutine scalar_scheme_solver_factory(ksp, n, solver, max_iter, abstol)
541  class(ksp_t), allocatable, target, intent(inout) :: ksp
542  integer, intent(in), value :: n
543  integer, intent(in) :: max_iter
544  character(len=*), intent(in) :: solver
545  real(kind=rp) :: abstol
546 
547  call krylov_solver_factory(ksp, n, solver, max_iter, abstol)
548 
549  end subroutine scalar_scheme_solver_factory
550 
552  subroutine scalar_scheme_precon_factory(pc, ksp, coef, dof, gs, bclst, pctype)
553  class(pc_t), allocatable, target, intent(inout) :: pc
554  class(ksp_t), target, intent(inout) :: ksp
555  type(coef_t), target, intent(inout) :: coef
556  type(dofmap_t), target, intent(inout) :: dof
557  type(gs_t), target, intent(inout) :: gs
558  type(bc_list_t), target, intent(inout) :: bclst
559  character(len=*) :: pctype
560 
561  call precon_factory(pc, pctype)
562 
563  select type(pcp => pc)
564  type is(jacobi_t)
565  call pcp%init(coef, dof, gs)
566  type is (sx_jacobi_t)
567  call pcp%init(coef, dof, gs)
568  type is (device_jacobi_t)
569  call pcp%init(coef, dof, gs)
570  type is(hsmg_t)
571  if (len_trim(pctype) .gt. 4) then
572  if (index(pctype, '+') .eq. 5) then
573  call pcp%init(dof%msh, dof%Xh, coef, dof, gs, &
574  bclst, trim(pctype(6:)))
575  else
576  call neko_error('Unknown coarse grid solver')
577  end if
578  else
579  call pcp%init(dof%msh, dof%Xh, coef, dof, gs, bclst)
580  end if
581  end select
582 
583  call ksp%set_pc(pc)
584 
585  end subroutine scalar_scheme_precon_factory
586 
589  subroutine scalar_scheme_set_user_bc(this, usr_eval)
590  class(scalar_scheme_t), intent(inout) :: this
591  procedure(usr_scalar_bc_eval) :: usr_eval
592 
593  call this%user_bc%set_eval(usr_eval)
594 
595  end subroutine scalar_scheme_set_user_bc
596 
597 
598 end module scalar_scheme
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...
Definition: json_utils.f90:53
Retrieves a parameter by name or throws an error.
Definition: json_utils.f90:44
Abstract interface to dealocate a scalar formulation.
Abstract interface to initialize a scalar formulation.
Abstract interface to restart a scalar formulation.
Abstract interface to compute a time-step.
Abstract interface defining a user defined scalar boundary condition (pointwise) Just imitating inflo...
Definition: usr_scalar.f90:77
Defines a boundary condition.
Definition: bc.f90:34
subroutine, public bc_list_add(bclst, bc)
Add a condition to a list of boundary conditions.
Definition: bc.f90:490
subroutine, public bc_list_init(bclst, size)
Constructor for a list of boundary conditions.
Definition: bc.f90:449
subroutine, public bc_list_free(bclst)
Destructor for a list of boundary conditions.
Definition: bc.f90:476
subroutine, public bc_list_apply_scalar(bclst, x, n, t, tstep)
Apply a list of boundary conditions to a scalar field.
Definition: bc.f90:515
Defines a checkpoint.
Definition: checkpoint.f90:34
Coefficients.
Definition: coef.f90:34
Definition: comm.F90:1
type(mpi_comm) neko_comm
MPI communicator.
Definition: comm.F90:16
Jacobi preconditioner accelerator backend.
Defines a dirichlet boundary condition.
Definition: dirichlet.f90:34
Defines a mapping of the degrees of freedom.
Definition: dofmap.f90:35
Defines a zone as a subset of facets in a mesh.
Definition: facet_zone.f90:34
Defines inflow dirichlet conditions.
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
Stores a series fields.
Defines a field.
Definition: field.f90:34
Gather-scatter.
Krylov preconditioner.
Definition: pc_hsmg.f90:61
Jacobi preconditioner.
Definition: pc_jacobi.f90:34
Utilities for retrieving parameters from the case files.
Definition: json_utils.f90:34
subroutine, public krylov_solver_destroy(ksp)
Destroy an interative Krylov solver.
subroutine, public krylov_solver_factory(ksp, n, solver, max_iter, abstol, M)
Initialize an iterative Krylov solver.
Implements the base abstract type for Krylov solvers plus helper types.
Definition: krylov.f90:34
Logging routines.
Definition: log.f90:34
type(log_t), public neko_log
Global log stream.
Definition: log.f90:61
integer, parameter, public log_size
Definition: log.f90:40
Implements material_properties_t type.
Defines a mesh.
Definition: mesh.f90:34
integer, parameter, public neko_msh_max_zlbls
Max num. zone labels.
Definition: mesh.f90:55
integer, parameter, public neko_msh_max_zlbl_len
Max length of a zone label.
Definition: mesh.f90:57
Defines a Neumann boundary condition.
Definition: neumann.f90:34
integer, parameter, public rp
Global precision used in computations.
Definition: num_types.f90:12
subroutine precon_destroy(pc)
Destroy a preconditioner.
subroutine precon_factory(pc, pctype)
Create a preconditioner.
Contains the scalar_scheme_t type.
subroutine scalar_scheme_init(this, msh, c_Xh, gs_Xh, params, scheme, user, material_properties)
Initialize all related components of the current scheme.
subroutine scalar_scheme_add_bcs(this, zones, bc_labels)
Initialize boundary conditions.
subroutine scalar_scheme_free(this)
Deallocate a scalar formulation.
subroutine scalar_scheme_set_user_bc(this, usr_eval)
Initialize a user defined scalar bc.
subroutine scalar_scheme_validate(this)
Validate that all fields, solvers etc necessary for performing time-stepping are defined.
subroutine scalar_scheme_precon_factory(pc, ksp, coef, dof, gs, bclst, pctype)
Initialize a Krylov preconditioner.
subroutine scalar_scheme_solver_factory(ksp, n, solver, max_iter, abstol)
Initialize a linear solver.
Implements the scalar_source_term_t type.
Implements the source_term_t type and a wrapper source_term_wrapper_t.
Definition: source_term.f90:34
Defines a function space.
Definition: space.f90:34
Jacobi preconditioner SX-Aurora backend.
Compound scheme for the advection and diffusion operators in a transport equation.
Implements type time_step_controller.
Interfaces for user interaction with NEKO.
Definition: user_intf.f90:34
Defines dirichlet conditions for scalars.
Definition: usr_scalar.f90:34
Utilities.
Definition: utils.f90:35
A list of boundary conditions.
Definition: bc.f90:102
Base type for a boundary condition.
Definition: bc.f90:51
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Definition: coef.f90:54
Defines a jacobi preconditioner.
Generic Dirichlet boundary condition on .
Definition: dirichlet.f90:44
User defined dirichlet condition, for which the user can work with an entire field....
field_list_t, To be able to group fields together
Definition: field_list.f90:7
Defines a jacobi preconditioner.
Definition: pc_jacobi.f90:45
Base abstract type for a canonical Krylov method, solving .
Definition: krylov.f90:65
Contains all the material properties necessary in the simulation.
Generic Neumann boundary condition. This sets the flux of the field to the chosen value.
Definition: neumann.f90:47
Base type for a scalar advection-diffusion solver.
Wrapper contaning and executing the scalar source terms.
The function space for the SEM solution fields.
Definition: space.f90:62
Defines a jacobi preconditioner for SX-Aurora.
Implements the logic to compute the time coefficients for the advection and diffusion operators in a ...
Provides a tool to set time step dt.
User defined dirichlet condition for scalars.
Definition: usr_scalar.f90:45