57 real(kind=
dp) :: t_begin
68 procedure, pass(this) :: configure_file => &
80 real(kind=
dp),
intent(in) :: t_begin
81 character(len=*),
intent(in) :: hom_dir
82 character(len=*),
intent(in),
optional :: name
83 character(len=*),
intent(in),
optional :: path
84 character(len=1024) :: fname
86 if (trim(hom_dir) .eq.
'none' .or. &
87 trim(hom_dir) .eq.
'x' .or.&
88 trim(hom_dir) .eq.
'y' .or.&
89 trim(hom_dir) .eq.
'z'&
91 if (
present(name) .and.
present(path))
then
92 fname = trim(path) // trim(name) //
'.fld'
93 else if (
present(name))
then
94 fname = trim(name) //
'.fld'
95 else if (
present(path))
then
96 fname = trim(path) //
'scalar_sgs_stats.fld'
98 fname =
'scalar_sgs_stats.fld'
103 if (trim(hom_dir) .eq.
'x' .or.&
104 trim(hom_dir) .eq.
'y' .or.&
105 trim(hom_dir) .eq.
'z' )
then
106 call this%map_2d%init_char(
stats%coef, hom_dir, 1e-7_rp)
110 if (
present(name) .and.
present(path))
then
111 fname = trim(path) // trim(name) //
'.csv'
112 else if (
present(name))
then
113 fname = trim(name) //
'.csv'
114 else if (
present(path))
then
115 fname = trim(path) //
'scalar_sgs_stats.csv'
117 fname =
'scalar_sgs_stats.csv'
119 call this%map_1d%init_char(
stats%coef, hom_dir, 1e-7_rp)
123 call this%init_base(fname)
125 this%T_begin = t_begin
132 call this%free_base()
135 call this%map_1d%free()
136 call this%map_2d%free()
143 real(kind=
dp),
intent(in) :: t
147 real(kind=
rp) :: u, v, w, p
148 associate(out_fields => this%stats%stat_fields%items)
149 if (t .ge. this%T_begin)
then
151 do i = 1,
size(out_fields)
152 call device_memcpy(out_fields(i)%ptr%x, out_fields(i)%ptr%x_d,&
154 sync = (i .eq.
size(out_fields)))
157 if (this%output_dim .eq. 1)
then
158 call this%map_1d%average_planes(avg_output_1d, &
159 this%stats%stat_fields)
160 call this%file_%write(avg_output_1d, t)
161 call avg_output_1d%free()
162 else if (this%output_dim .eq. 2)
then
163 call this%map_2d%average(output_2d, this%stats%stat_fields)
165 do i = 1, this%map_2d%n_2d
176 call this%file_%write(output_2d, t)
177 call output_2d%free()
179 call this%file_%write(this%stats%stat_fields, t)
181 call this%stats%reset()
192 select type (ft => this%file_%file_type)
194 ft%skip_pressure = .false.
195 ft%skip_velocity = .false.
196 ft%skip_temperature = .false.
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 dp
integer, parameter, public rp
Global precision used in computations.
Implements scalar_sgs_stats_ouput_t.
subroutine scalar_sgs_stats_output_configure_file(this)
Puts the leading fields in the UVW, P and T slots rather than the scalar block.
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.
Map every GLL point in the mesh to a level in one physical direction. Can be used to average across t...
Abstract type defining an output type.
Defines an output for the sgs statistics for scalar computed using the scalar_sgs_stats_t object.