Skip to content

Commit b779f77

Browse files
benegeeranocha
andauthored
Use reinterpret when applying solution_variables for visualization (#2388)
* remove todo and try reinterpret * Revert "remove todo and try reinterpret" This reverts commit d53b1f8. * Just add a comment reinterpret does not work because of Measurements non-bits type --------- Co-authored-by: Hendrik Ranocha <[email protected]>
1 parent 0929590 commit b779f77

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/visualization/utilities.jl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,9 @@ function get_unstructured_data(u, solution_variables, mesh, equations, solver, c
465465
raw_data = u
466466
n_vars = size(raw_data, 1)
467467
else
468-
# FIXME: Remove this comment once the implementation following it has been verified
469-
# Reinterpret the solution array as an array of conservative variables,
470-
# compute the solution variables via broadcasting, and reinterpret the
471-
# result as a plain array of floating point numbers
472-
# raw_data = Array(reinterpret(eltype(u),
473-
# solution_variables.(reinterpret(SVector{nvariables(equations),eltype(u)}, u),
474-
# Ref(equations))))
475-
# n_vars = size(raw_data, 1)
468+
# Similar to `save_solution_file` in `callbacks_step/save_solution_dg.jl`.
469+
# However, we cannot use `reinterpret` here as `u` might have a non-bits type.
470+
# See https://github.com/trixi-framework/Trixi.jl/pull/2388
476471
n_vars_in = nvariables(equations)
477472
n_vars = length(solution_variables(get_node_vars(u, equations, solver),
478473
equations))

0 commit comments

Comments
 (0)