Skip to content

Commit

Permalink
Added the posibility to plot 2D surfaces in 3D
Browse files Browse the repository at this point in the history
  • Loading branch information
amrueda committed Nov 15, 2023
1 parent ecc1106 commit a969339
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/vtktools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit a969339

Please sign in to comment.