45 use json_module,
only: json_file
67 class(
ksp_t),
allocatable :: shared_ksp
89 numerics_params, user, chkp, ulag, vlag, wlag, time_scheme, rho)
91 integer,
intent(in) :: n_scalars
92 type(
mesh_t),
target,
intent(in) :: msh
93 type(
coef_t),
target,
intent(in) :: coef
94 type(
gs_t),
target,
intent(inout) :: gs
95 type(json_file),
target,
intent(inout) :: params
96 type(json_file),
target,
intent(inout) :: numerics_params
97 type(
user_t),
target,
intent(in) :: user
100 TYPE(
field_t),
TARGET,
INTENT(IN) :: rho
101 type(
chkp_t),
target,
intent(inout) :: chkp
102 type(json_file) :: json_subdict
104 character(len=:),
allocatable :: field_name
105 character(len=:),
allocatable :: field_names(:)
106 character(len=256) :: error_msg
113 allocate(
character(len=256) :: field_names(n_scalars))
120 if (json_subdict%valid_path(
'name'))
then
121 call json_get(json_subdict,
'name', field_name)
127 if (len_trim(field_name) == 0)
then
128 if (n_scalars == 1)
then
131 write(field_name,
'(A,I0)')
's_', i
135 field_names(i) = trim(field_name)
138 if (n_scalars > 1)
then
141 if (trim(field_names(i)) == trim(field_names(j)))
then
142 write(field_name,
'(A,I0)') trim(field_names(i))//
'_', j
143 field_names(i) = trim(field_name)
156 call json_subdict%add(
'name', trim(field_names(i)))
158 call this%scalar_fields(i)%init(msh, coef, gs, json_subdict, &
163 if (n_scalars > 1)
then
164 call this%register_lags_with_checkpoint(chkp)
167 call chkp%add_scalar(this%scalar_fields(1)%s, this%scalar_fields(1)%slag)
172 user, chkp, ulag, vlag, wlag, time_scheme, rho)
174 type(
mesh_t),
target,
intent(in) :: msh
175 type(
coef_t),
target,
intent(in) :: coef
176 type(
gs_t),
target,
intent(inout) :: gs
177 type(json_file),
target,
intent(inout) :: params
178 type(json_file),
target,
intent(inout) :: numerics_params
179 type(
user_t),
target,
intent(in) :: user
180 type(
chkp_t),
target,
intent(inout) :: chkp
183 TYPE(
field_t),
TARGET,
INTENT(IN) :: rho
189 if (.not. params%valid_path(
'name'))
then
190 call params%add(
'name',
's')
194 call this%scalar_fields(1)%init(msh, coef, gs, params, numerics_params, &
198 call chkp%add_scalar(this%scalar_fields(1)%s, this%scalar_fields(1)%slag)
208 type(
ksp_monitor_t),
dimension(size(this%scalar_fields)) :: ksp_results
211 do i = 1,
size(this%scalar_fields)
212 call this%scalar_fields(i)%step(time, ext_bdf, dt_controller, &
222 type(
chkp_t),
intent(inout) :: chkp
223 integer :: i, n_scalars
225 n_scalars =
size(this%scalar_fields)
226 do i = 1,
size(this%scalar_fields)
227 call this%scalar_fields(i)%restart(chkp)
236 do i = 1,
size(this%scalar_fields)
237 call this%scalar_fields(i)%slag%set(this%scalar_fields(i)%s)
238 call this%scalar_fields(i)%validate()
248 if (
allocated(this%scalar_fields))
then
249 do i = 1,
size(this%scalar_fields)
250 call this%scalar_fields(i)%free()
252 deallocate(this%scalar_fields)
259 type(
chkp_t),
intent(inout) :: chkp
260 integer :: i, n_scalars
262 n_scalars =
size(this%scalar_fields)
265 allocate(chkp%scalar_abx1(n_scalars))
266 allocate(chkp%scalar_abx2(n_scalars))
270 call chkp%scalar_lags%append(this%scalar_fields(i)%slag)
273 select type(scalar_field => this%scalar_fields(i))
283 type(
chkp_t),
intent(inout) :: chkp
284 integer,
intent(in) :: index
287 chkp%scalar_abx1(index)%ptr => scalar_field%abx1
288 chkp%scalar_abx2(index)%ptr => scalar_field%abx2
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.
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
Contains the field_serties_t type.
Utilities for retrieving parameters from the case files.
subroutine, public json_extract_object(json, name, object)
Extract object as a separate JSON dictionary.
Implements the base abstract type for Krylov solvers plus helper types.
integer, parameter, public neko_log_verbose
Verbose log level.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
integer, parameter, public rp
Global precision used in computations.
Auxiliary routines for fluid solvers.
subroutine scalar_step_info(time, ksp_results, strict_convergence)
Prints for prs, velx, vely, velz the following: Number of iterations, start residual,...
Contains the scalar_pnpn_t type.
Contains the scalar_scheme_t type.
Contains the scalars_t type that manages multiple scalar fields.
subroutine scalars_validate(this)
Check if the configuration is valid.
subroutine associate_scalar_abx_fields(chkp, index, scalar_field)
Helper subroutine to associate ABX field pointers with proper TARGET attribute.
subroutine register_lags_with_checkpoint(this, chkp)
Register scalar lag fields with checkpoint.
subroutine scalars_init(this, n_scalars, msh, coef, gs, params, numerics_params, user, chkp, ulag, vlag, wlag, time_scheme, rho)
Initialize the scalars container.
subroutine scalars_init_single(this, msh, coef, gs, params, numerics_params, user, chkp, ulag, vlag, wlag, time_scheme, rho)
subroutine scalars_free(this)
Clean up all resources.
subroutine scalars_step(this, time, ext_bdf, dt_controller)
Perform a time step for all scalar fields.
subroutine scalars_restart(this, chkp)
Restart from checkpoint data.
Defines a function space.
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.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
field_list_t, To be able to group fields together
Stores a series (sequence) of fields, logically connected to a base field, and arranged according to ...
Type for storing initial and final residuals in a Krylov solver.
Base abstract type for a canonical Krylov method, solving .
Base type for a scalar advection-diffusion solver.
Type to manage multiple scalar transport equations.
The function space for the SEM solution fields.
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.
Provides a tool to set time step dt.
A type collecting all the overridable user routines and flag to suppress type injection from custom m...