37 use json_module,
only : json_file
55 character(len=20),
allocatable :: field_names(:)
58 real(kind=
rp) :: start_time
67 procedure, pass(this) :: init_from_components => &
80 type(json_file),
intent(inout) :: json
81 class(
case_t),
intent(inout),
target :: case
82 character(len=20),
allocatable :: which_fields(:)
83 character(len=:),
allocatable :: name
84 real(kind=
rp) :: start_time
85 logical :: stream_mesh
88 call json_get(json,
'fields', which_fields)
95 call this%init_base(json,
case)
96 call this%init_from_components(name, which_fields, start_time, stream_mesh)
105 which_fields, start_time, stream_mesh)
107 character(len=*),
intent(in) :: name
108 character(len=20),
intent(in) :: which_fields(:)
109 real(kind=
rp),
intent(in) :: start_time
110 logical,
intent(in) :: stream_mesh
114 this%field_names = which_fields
115 this%start_time = start_time
117 call this%dstream%init(this%case%fluid%c_Xh)
119 if (stream_mesh)
then
124 call neko_log%message(
"Using field " // trim(f%name) // &
126 call neko_log%message(
"Streaming mesh: x-coordinates", &
128 call this%dstream%stream(f%dof%x)
129 call neko_log%message(
"Streaming mesh: y-coordinates", &
131 call this%dstream%stream(f%dof%y)
132 call neko_log%message(
"Streaming mesh: z-coordinates", &
134 call this%dstream%stream(f%dof%z)
142 call this%free_base()
144 if (
allocated(this%field_names))
deallocate(this%field_names)
145 this%start_time = -1.0_rp
146 call this%dstream%free()
159 if (time%t .ge. this%start_time)
then
160 do i = 1,
size(this%field_names)
166 call neko_log%message(
"Streaming field: " // this%field_names(i))
169 call this%dstream%stream(f%x)
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 simulation case.
A simulation component that streams data using ADIOS2.
subroutine data_streamer_simcomp_free(this)
Destructor.
subroutine data_streamer_simcomp_init_from_json(this, json, case)
Constructor from json.
subroutine data_streamer_simcomp_compute(this, time)
Compute the data_streamer_simcomp field.
subroutine data_streamer_simcomp_init_from_components(this, name, which_fields, start_time, stream_mesh)
Common part of constructors.
Implements type data_streamer_t.
Device abstraction, common interface for various accelerators.
integer, parameter, public device_to_host
Utilities for retrieving parameters from the case files.
integer, parameter, public neko_log_debug
Debug log level.
type(log_t), public neko_log
Global log stream.
integer, parameter, public rp
Global precision used in computations.
Defines a registry for storing solution fields.
type(registry_t), target, public neko_registry
Global field registry.
Simulation components are objects that encapsulate functionality that can be fit to a particular comp...
subroutine compute_(this, time)
Dummy compute function.
Contains the time_based_controller_t type.
Module with things related to the simulation time.
Provides access to data streaming by interfacing with c++ ADIOS2 subroutines.
Base abstract class for simulation components.
A utility type for determining whether an action should be executed based on the current time value....
A struct that contains all info about the time, expand as needed.