56 real(kind=
rp) :: t_begin
75 real(kind=
rp),
intent(in) :: t_begin
76 character(len=*),
intent(in) :: hom_dir
77 character(len=*),
intent(in),
optional :: name
78 character(len=*),
intent(in),
optional :: path
79 character(len=1024) :: fname
81 if (trim(hom_dir) .eq.
'none' .or. &
82 trim(hom_dir) .eq.
'x' .or.&
83 trim(hom_dir) .eq.
'y' .or.&
84 trim(hom_dir) .eq.
'z'&
86 if (
present(name) .and.
present(path))
then
87 fname = trim(path) // trim(name) //
'.fld'
88 else if (
present(name))
then
89 fname = trim(name) //
'.fld'
90 else if (
present(path))
then
91 fname = trim(path) //
'fluid_stats.fld'
93 fname =
'fluid_stats.fld'
98 if (trim(hom_dir) .eq.
'x' .or.&
99 trim(hom_dir) .eq.
'y' .or.&
100 trim(hom_dir) .eq.
'z' )
then
101 call this%map_2d%init_char(
stats%coef, hom_dir, 1e-7_rp)
105 if (
present(name) .and.
present(path))
then
106 fname = trim(path) // trim(name) //
'.csv'
107 else if (
present(name))
then
108 fname = trim(name) //
'.csv'
109 else if (
present(path))
then
110 fname = trim(path) //
'fluid_stats.csv'
112 fname =
'fluid_stats.csv'
114 call this%map_1d%init_char(
stats%coef, hom_dir, 1e-7_rp)
118 call this%init_base(fname)
120 this%T_begin = t_begin
127 call this%map_1d%free()
128 call this%map_2d%free()
134 real(kind=
rp),
intent(in) :: t
138 real(kind=
rp) :: u, v, w, p
139 associate(out_fields => this%stats%stat_fields%items)
140 if (t .ge. this%T_begin)
then
141 call this%stats%make_strong_grad()
143 do i = 1,
size(out_fields)
144 call device_memcpy(out_fields(i)%ptr%x, out_fields(i)%ptr%x_d,&
146 sync = (i .eq.
size(out_fields)))
149 if (this%output_dim .eq. 1)
then
150 call this%map_1d%average_planes(avg_output_1d, &
151 this%stats%stat_fields)
152 call this%file_%write(avg_output_1d, t)
153 else if (this%output_dim .eq. 2)
then
154 call this%map_2d%average(output_2d, this%stats%stat_fields)
157 do i = 1, this%map_2d%n_2d
168 call this%file_%write(output_2d, t)
170 call this%file_%write(this%stats%stat_fields, t)
172 call this%stats%reset()
Copy data between host and device (or device and device)
Device abstraction, common interface for various accelerators.
integer, parameter, public device_to_host
Simple module to handle fld file series. Provides an interface to the different fields sotred in a fl...
Implements fluid_stats_ouput_t.
subroutine fluid_stats_output_free(this)
Destructor.
subroutine fluid_stats_output_sample(this, t)
Sample fluid_stats at time t.
subroutine fluid_stats_output_init(this, stats, t_begin, hom_dir, name, path)
Constructor.
Computes various statistics for the fluid fields. We use the Reynolds decomposition for a field u = ...
Creates a 1d GLL point map along a specified direction based on the connectivity in the mesh.
Maps a 3D dofmap to a 2D spectral element grid.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Defines a container for all statistics.
Defines an output for the fluid statistics computed using the fluid_stats_t object.
Type that encapsulates a mapping from each gll point in the mesh to its corresponding (global) GLL po...
Abstract type defining an output type.