From e11d19ccbd7ac7d693d6d698a796137ce27750c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Rueda-Ram=C3=ADrez?= Date: Thu, 24 Oct 2024 16:48:27 +0200 Subject: [PATCH] Output the mpi rank to element_variables for visualization --- src/solvers/dg.jl | 5 +++++ src/solvers/dgsem_p4est/dg_3d_parallel.jl | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/solvers/dg.jl b/src/solvers/dg.jl index 0e4d667fbc2..7e7190100fe 100644 --- a/src/solvers/dg.jl +++ b/src/solvers/dg.jl @@ -12,6 +12,10 @@ function get_element_variables!(element_variables, u, mesh, equations, nothing end +function get_element_variables!(element_variables, mesh) + nothing +end + function get_node_variables!(node_variables, mesh, equations, volume_integral::AbstractVolumeIntegral, dg, cache) nothing @@ -427,6 +431,7 @@ Base.summary(io::IO, dg::DG) = print(io, "DG(" * summary(dg.basis) * ")") function get_element_variables!(element_variables, u, mesh, equations, dg::DG, cache) get_element_variables!(element_variables, u, mesh, equations, dg.volume_integral, dg, cache) + get_element_variables!(element_variables, mesh) end function get_node_variables!(node_variables, mesh, equations, dg::DG, cache) diff --git a/src/solvers/dgsem_p4est/dg_3d_parallel.jl b/src/solvers/dgsem_p4est/dg_3d_parallel.jl index 635c8dc795e..7040b0ade7e 100644 --- a/src/solvers/dgsem_p4est/dg_3d_parallel.jl +++ b/src/solvers/dgsem_p4est/dg_3d_parallel.jl @@ -5,6 +5,14 @@ @muladd begin #! format: noindent +# Function to output the mpi rank for visualization +function get_element_variables!(element_variables, + mesh::Union{ParallelP4estMesh{3}, + ParallelT8codeMesh{3}}) + element_variables[:mpi_rank] = mpi_rank() + return nothing +end + function rhs!(du, u, t, mesh::Union{ParallelP4estMesh{3}, ParallelT8codeMesh{3}}, equations, boundary_conditions, source_terms::Source,