Skip to content

Commit

Permalink
Fix element type for more complex Fields
Browse files Browse the repository at this point in the history
If we a Vector Field, `eltype` will return `Vector`, not float. So, we
have to be more creative with how to get the float_type for general
cases.
  • Loading branch information
Sbozzolo committed Sep 15, 2023
1 parent 11853ac commit b6a9bda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/diagnostics/diagnostic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ reset_accumulator!(_, reduction_time_func::Nothing) = nothing
function reset_accumulator!(diag_accumulator, reduction_time_func)
# identity_of_reduction works by dispatching over operation
identity = identity_of_reduction(reduction_time_func)
float_type = eltype(diag_accumulator)
float_type = Spaces.undertype(axes((diag_accumulator)))
identity_ft = convert(float_type, identity)
diag_accumulator .= identity_ft
end
Expand Down

0 comments on commit b6a9bda

Please sign in to comment.