47 use json_module,
only : json_file
92 u, v, w, p, t, s_target_list, s_index_list, interpolate)
93 character(len=*),
intent(in) :: fname
94 type(json_file),
intent(inout) :: global_interp_subdict
95 character(len=*),
intent(in),
optional :: mesh_fname
96 type(
field_t),
pointer,
intent(inout),
optional :: u,v,w,p,t
97 type(
field_list_t),
intent(inout),
optional :: s_target_list
98 integer,
intent(in),
optional :: s_index_list(:)
99 logical,
intent(in),
optional :: interpolate
101 real(kind=
dp) :: tolerance, padding
109 u, v, w, p, t, s_target_list, s_index_list, &
110 interpolate, tolerance = tolerance, padding = padding)
148 s_target_list, s_index_list, interpolate, tolerance, padding)
149 character(len=*),
intent(in) :: fname
150 character(len=*),
intent(in),
optional :: mesh_fname
151 type(
field_t),
pointer,
intent(inout),
optional :: u,v,w,p,t
152 type(
field_list_t),
intent(inout),
optional :: s_target_list
153 integer,
intent(in),
optional :: s_index_list(:)
154 logical,
intent(in),
optional :: interpolate
155 real(kind=
dp),
intent(in),
optional :: tolerance
156 real(kind=
dp),
intent(in),
optional :: padding
158 character(len=LOG_SIZE) :: log_buf
161 logical :: interpolate_
167 interpolate_ = .false.
168 if (
present(interpolate)) interpolate_ = interpolate
171 call neko_log%section(
"Import fields")
172 call neko_log%message(
"File name : " // trim(fname))
173 write (log_buf,
'(A,L1)')
"Interpolation : ", interpolate_
181 if (interpolate_)
then
182 if (
present(mesh_fname))
then
184 if (trim(mesh_fname) .ne.
"none")
then
185 call neko_log%message(
"Mesh file : " // trim(mesh_fname))
201 if (
present(s_target_list))
then
203 if (
present(s_index_list))
then
204 if (
size(s_index_list) .ne. s_target_list%size())
then
205 call neko_error(
"Scalar lists must have same size!")
208 do i = 1,
size(s_index_list)
210 if (s_index_list(i) .eq. 0)
then
214 if (s_index_list(i) .lt. 1 .or. &
215 s_index_list(i) .gt. fld_data%n_scalars)
then
216 call neko_error(
"s_index_list entry out of bounds")
223 do i = 1, s_target_list%size()
234 if (interpolate_)
then
241 call fld_data%import_fields(u, v, w, p, t, s_target_list, s_index_list, &
242 interpolate_, tolerance = tolerance, padding = padding)
252 character(len=*),
intent(in) :: file_name
256 integer :: sample_idx
257 character(len=NEKO_FNAME_LEN) :: fname_
262 if (sample_idx .eq. -1) &
263 call neko_error(
"Invalid file name. The file format must be e.g. " // &
270 call f%init(trim(fname_))
271 call f%set_counter(sample_idx)
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Device abstraction, common interface for various accelerators.
integer, parameter, public host_to_device
Module for file I/O operations.
subroutine file_free(this)
File operation destructor.
Simple module to handle fld file series. Provides an interface to the different fields sotred in a fl...
Implements global_interpolation given a dofmap.
real(kind=dp), parameter, public glob_interp_tol
real(kind=dp), parameter, public glob_interp_pad
Importation of fields from fld files.
subroutine import_fields_from_json(fname, global_interp_subdict, mesh_fname, u, v, w, p, t, s_target_list, s_index_list, interpolate)
Imports fields from an fld file, potentially with interpolation, with parameters provided in a JSON s...
subroutine import_fields_from_params(fname, mesh_fname, u, v, w, p, t, s_target_list, s_index_list, interpolate, tolerance, padding)
Imports fields from an fld file, potentially with interpolation.
subroutine read_fld_file(file_name, data)
Wrapper around the fld file reader. Translates a file name specified as "field0.f00132" into "field0....
Utilities for retrieving parameters from the case files.
type(log_t), public neko_log
Global log stream.
integer, parameter, public log_size
integer, parameter, public dp
integer, parameter, public rp
Global precision used in computations.
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 filename_chsuffix(fname, new_fname, new_suffix)
Change a filename's suffix.
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...