Skip to content

Commit

Permalink
add unsafe_wrap explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
ArseniyKholod committed Feb 16, 2024
1 parent 49fb007 commit a502c36
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/literate/src/files/behind_the_scenes_simulation_setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,10 @@ ode = semidiscretize(semi, (0.0, 1.0));
# OrdinaryDiffEq.jl. However, for internal use within Trixi.jl, identifying which part of the
# vector relates to specific variables, elements, or nodes can be challenging.

# This is why the `u_ode` vector is wrapped by the `wrap_array` function to create a
# multidimensional array `u`, with each dimension representing variables, nodes and elements.
# This is why the `u_ode` vector is wrapped by the `wrap_array` function using `unsafe_wrap`
# to form a multidimensional array `u`. In this array, the first dimension corresponds to
# variables, followed by N dimensions corresponding to nodes for each of N space dimensions.
# The last dimension corresponds to the elements.
# Consequently, navigation within this multidimensional array becomes noticeably easier.

# "Wrapping" in this context involves the creation of a reference to the same storage location
Expand Down

0 comments on commit a502c36

Please sign in to comment.