From a969339c8f9dc2a3c8578af46ff728730a4d468d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Rueda-Ram=C3=ADrez?= Date: Wed, 15 Nov 2023 15:27:34 +0100 Subject: [PATCH] Added the posibility to plot 2D surfaces in 3D --- src/vtktools.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vtktools.jl b/src/vtktools.jl index a1700aa..74f7178 100644 --- a/src/vtktools.jl +++ b/src/vtktools.jl @@ -234,8 +234,9 @@ end function calc_node_coordinates(mesh::P4estMesh, nodes, n_visnodes) # Extract number of spatial dimensions ndims_ = ndims(mesh) + ndims_spa = size(mesh.tree_node_coordinates,1) - node_coordinates = Array{Float64, ndims_+2}(undef, ndims_, + node_coordinates = Array{Float64, ndims_+2}(undef, ndims_spa, ntuple(_ -> n_visnodes, ndims_)..., Trixi.ncells(mesh)) @@ -580,7 +581,7 @@ function calc_vtk_points_cells(node_coordinates::AbstractArray{<:Any,4}) linear_indices = LinearIndices(size_[2:end]) # Use lagrange nodes as VTK points - vtk_points = reshape(node_coordinates, (2, n_points)) + vtk_points = reshape(node_coordinates, (size(node_coordinates, 1), n_points)) vtk_cells = Vector{MeshCell}(undef, n_elements) # Create cell for each element