57 real(kind=
rp) :: t_begin
77 real(kind=
rp),
intent(in) :: t_begin
78 character(len=*),
intent(in) :: hom_dir
79 character(len=*),
intent(in),
optional :: name
80 character(len=*),
intent(in),
optional :: path
81 character(len=1024) :: fname
83 if (trim(hom_dir) .eq.
'none' .or. &
84 trim(hom_dir) .eq.
'x' .or.&
85 trim(hom_dir) .eq.
'y' .or.&
86 trim(hom_dir) .eq.
'z'&
88 if (
present(name) .and.
present(path))
then
89 fname = trim(path) // trim(name) //
'.fld'
90 else if (
present(name))
then
91 fname = trim(name) //
'.fld'
92 else if (
present(path))
then
93 fname = trim(path) //
'scalar_sgs_stats.fld'
95 fname =
'scalar_sgs_stats.fld'
100 if (trim(hom_dir) .eq.
'x' .or.&
101 trim(hom_dir) .eq.
'y' .or.&
102 trim(hom_dir) .eq.
'z' )
then
103 call this%map_2d%init_char(
stats%coef, hom_dir, 1e-7_rp)
107 if (
present(name) .and.
present(path))
then
108 fname = trim(path) // trim(name) //
'.csv'
109 else if (
present(name))
then
110 fname = trim(name) //
'.csv'
111 else if (
present(path))
then
112 fname = trim(path) //
'scalar_sgs_stats.csv'
114 fname =
'scalar_sgs_stats.csv'
116 call this%map_1d%init_char(
stats%coef, hom_dir, 1e-7_rp)
120 call this%init_base(fname)
121 select type (ft => this%file_%file_type)
123 ft%skip_pressure = .false.
124 ft%skip_velocity = .false.
125 ft%skip_temperature = .false.
129 this%T_begin = t_begin
136 call this%free_base()
139 call this%map_1d%free()
140 call this%map_2d%free()
147 real(kind=
rp),
intent(in) :: t
151 real(kind=
rp) :: u, v, w, p
152 associate(out_fields => this%stats%stat_fields%items)
153 if (t .ge. this%T_begin)
then
155 do i = 1,
size(out_fields)
156 call device_memcpy(out_fields(i)%ptr%x, out_fields(i)%ptr%x_d,&
158 sync = (i .eq.
size(out_fields)))
161 if (this%output_dim .eq. 1)
then
162 call this%map_1d%average_planes(avg_output_1d, &
163 this%stats%stat_fields)
164 call this%file_%write(avg_output_1d, t)
165 else if (this%output_dim .eq. 2)
then
166 call this%map_2d%average(output_2d, this%stats%stat_fields)
168 do i = 1, this%map_2d%n_2d
179 call this%file_%write(output_2d, t)
181 call this%file_%write(this%stats%stat_fields, t)
183 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...
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.
Implements scalar_sgs_stats_ouput_t.
subroutine scalar_sgs_stats_output_free(this)
Destructor.
subroutine scalar_sgs_stats_output_sample(this, t)
Sample scalar_sgs_stats at time t.
subroutine scalar_sgs_stats_output_init(this, stats, t_begin, hom_dir, name, path)
Constructor.
Computes the subgrid-scale contributions for the scalar fluxes. We use the Reynolds decomposition for...
Defines a container for all statistics.
Interface for NEKTON fld files.
Type that encapsulates a mapping from each gll point in the mesh to its corresponding (global) GLL po...
Abstract type defining an output type.
Defines an output for the sgs statistics for scalar computed using the scalar_sgs_stats_t object.