46 use json_module,
only : json_file
85 type(
field_t),
intent(inout) :: s
86 type(
coef_t),
intent(in) :: coef
87 type(
gs_t),
intent(inout) :: gs
88 character(len=*) :: type
89 type(json_file),
intent(inout) :: params
90 integer,
intent(in) :: i
93 real(kind=
rp) :: ic_value
94 character(len=:),
allocatable :: read_str
95 character(len=NEKO_FNAME_LEN) :: fname, mesh_fname
96 real(kind=
rp) :: zone_value, tol
97 logical :: interpolate
98 integer :: tgt_scal_idx
100 if (trim(type) .eq.
'uniform')
then
105 else if (trim(type) .eq.
'point_zone')
then
108 call json_get(params,
'zone_name', read_str)
113 else if (trim(type) .eq.
'field')
then
115 call json_get(params,
'file_name', read_str)
116 fname = trim(read_str)
122 mesh_fname = trim(read_str)
147 character(len=*),
intent(in) :: scheme_name
148 type(
field_t),
target,
intent(inout) :: s
149 type(
coef_t),
intent(in) :: coef
150 type(
gs_t),
intent(inout) :: gs
157 call fields%assign_to_field(1, s)
159 call user_proc(scheme_name, fields)
171 type(
field_t),
intent(inout) :: s
172 type(
coef_t),
intent(in) :: coef
173 type(
gs_t),
intent(inout) :: gs
182 call gs%op(s%x, n, gs_op_add)
187 call col2(s%x, coef%mult, n)
197 type(
field_t),
intent(inout) :: s
198 real(kind=
rp),
intent(in) :: ic_value
200 character(len=LOG_SIZE) :: log_buf
202 call neko_log%message(
"Type : uniform")
203 write (log_buf,
'(A,ES12.6)')
"Value: ", ic_value
209 call cfill(s%x, ic_value, n)
222 type(
field_t),
intent(inout) :: s
223 real(kind=
rp),
intent(in) :: base_value
224 character(len=*),
intent(in) :: zone_name
225 real(kind=
rp),
intent(in) :: zone_value
228 character(len=LOG_SIZE) :: log_buf
232 call neko_log%message(
"Type : point_zone")
233 write (log_buf,
'(A,ES12.6)')
"Base value: ", base_value
235 call neko_log%message(
"Zone name : " // trim(zone_name))
236 write (log_buf,
'(A,ES12.6)')
"Zone value: ", zone_value
243 call cfill_mask(s%x, zone_value,
size, zone%mask%get(), zone%size)
265 interpolate, tolerance, mesh_file_name, i, target_idx)
266 type(
field_t),
target,
intent(inout) :: s
267 character(len=*),
intent(in) :: file_name
268 logical,
intent(in) :: interpolate
269 real(kind=
rp),
intent(in) :: tolerance
270 character(len=*),
intent(inout) :: mesh_file_name
271 integer,
intent(in) :: i
272 integer,
intent(in) :: target_idx
274 character(len=LOG_SIZE) :: log_buf
278 if (i .ne. target_idx)
then
279 write (log_buf,
'(A,I0,A,I0)')
"Loading scalar #", target_idx, &
288 call s_tgt_list%init(1)
289 call s_tgt_list%assign(1, ss)
292 s_target_list = s_tgt_list, &
293 s_index_list = [target_idx], &
294 interpolate = interpolate, tolerance = tolerance)
296 call s_tgt_list%free()
Copy data between host and device (or device and device)
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.
Abstract interface for user defined initial conditions.
subroutine, public device_col2(a_d, b_d, n, strm)
Vector multiplication .
Device abstraction, common interface for various accelerators.
integer, parameter, public host_to_device
integer, parameter, public device_to_host
Module for file I/O operations.
Simple module to handle fld file series. Provides an interface to the different fields sotred in a fl...
Implements global_interpolation given a dofmap.
Importation of fields from fld files.
subroutine, public import_fields(fname, mesh_fname, u, v, w, p, t, s_target_list, s_index_list, interpolate, tolerance)
Imports fields from an fld file, potentially with interpolation.
Routines to interpolate between different spaces.
Utilities for retrieving parameters from the case files.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
subroutine, public cfill(a, c, n)
Set all elements to a constant c .
subroutine, public col2(a, b, n)
Vector multiplication .
subroutine, public cfill_mask(a, c, n, mask, n_mask)
Fill a constant to a masked vector. .
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
type(point_zone_registry_t), target, public neko_point_zone_registry
Global point_zone registry.
Scalar initial condition.
subroutine set_scalar_ic_uniform(s, ic_value)
Uniform initial condition.
subroutine set_scalar_ic_point_zone(s, base_value, zone_name, zone_value)
Point zone initial condition.
subroutine set_scalar_ic_common(s, coef, gs)
Set scalar initial condition (common)
subroutine set_scalar_ic_int(s, coef, gs, type, params, i)
Set scalar initial condition (builtin)
subroutine set_scalar_ic_fld(s, file_name, interpolate, tolerance, mesh_file_name, i, target_idx)
Set the initial condition of the scalar based on a field. @detail The field is read from an fld file....
subroutine set_scalar_ic_usr(scheme_name, s, coef, gs, user_proc)
Set scalar intial condition (user defined)
Defines a function space.
integer, parameter, public gll
Interfaces for user interaction with NEKO.
integer function, public extract_fld_file_index(fld_filename, default_index)
Extracts the index of a field file. For example, "myfield.f00045" will return 45. If the suffix of th...
integer, parameter, public neko_fname_len
subroutine, public neko_warning(warning_msg)
Reports a warning to standard output.
subroutine, public filename_chsuffix(fname, new_fname, new_suffix)
Change a filename's suffix.
subroutine, public filename_suffix(fname, suffix)
Extract a filename's suffix.
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
A wrapper around a polymorphic generic_file_t that handles its init. This is essentially a factory fo...
Interface for NEKTON fld files.
Implements global interpolation for arbitrary points in the domain.
Interpolation between two space::space_t.
Base abstract type for point zones.
The function space for the SEM solution fields.