64 integer,
intent(inout) :: precision
66 class(
scalars_t),
intent(in),
optional,
target :: scalar_fields
67 character(len=*),
intent(in),
optional :: name
68 character(len=*),
intent(in),
optional :: path
69 character(len=*),
intent(in),
optional :: fmt
70 integer,
intent(in),
optional :: layout
71 character(len=1024) :: fname
72 integer :: i, j, n_scalars
73 character(len=10) :: suffix
74 logical :: has_max_wave_speed, has_density
75 type(
field_t),
pointer :: max_wave_speed_field
78 if (
present(fmt))
then
79 if (fmt .eq.
'adios2')
then
84 if (
present(name) .and.
present(path))
then
85 fname = trim(path) // trim(name) // trim(suffix)
86 else if (
present(name))
then
87 fname = trim(name) // trim(suffix)
88 else if (
present(path))
then
89 fname = trim(path) //
'field' // trim(suffix)
91 fname =
'field' // trim(suffix)
94 if (
present(layout))
then
95 call this%init_base(fname, precision, layout)
97 call this%init_base(fname, precision)
102 if (
present(scalar_fields))
then
103 n_scalars =
size(scalar_fields%scalar_fields)
114 has_density =
associated(fluid%rho)
116 has_density = .false.
125 if (has_density)
then
129 if (has_max_wave_speed)
then
133 call this%fluid%init(i + n_scalars)
135 call this%fluid%assign(1, fluid%p)
136 call this%fluid%assign(2, fluid%u)
137 call this%fluid%assign(3, fluid%v)
138 call this%fluid%assign(4, fluid%w)
142 if (
present(scalar_fields))
then
145 call this%fluid%assign(i, scalar_fields%scalar_fields(j)%s)
150 if (has_density)
then
152 call this%fluid%assign(i, fluid%rho)
156 if (has_max_wave_speed)
then
159 call this%fluid%assign(i, max_wave_speed_field)
168 call this%fluid%free()
175 real(kind=
rp),
intent(in) :: t
180 associate(fields => this%fluid%items)
181 do i = 1,
size(fields)
184 sync = (i .eq.
size(fields)))
190 call this%file_%write(this%fluid, t)
Copy data between host and device (or device and device)
Device abstraction, common interface for various accelerators.
integer, parameter, public device_to_host
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
Defines an output for a fluid.
subroutine fluid_output_sample(this, t)
Sample a fluid solution at time t.
subroutine fluid_output_free(this)
Destroy a fluid output list.
subroutine fluid_output_init(this, precision, fluid, scalar_fields, name, path, fmt, layout)
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Contains the scalar_scheme_t type.
Contains the scalars_t type that manages multiple scalar fields.
field_list_t, To be able to group fields together
Base type of all fluid formulations.
Base type of compressible fluid formulations.
Base type of all fluid formulations.
Abstract type defining an output type.
Base type for a scalar advection-diffusion solver.
Type to manage multiple scalar transport equations.