Skip to content

Commit

Permalink
Removed unused calc_node_coordinates for p4est mesh view.
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCan committed Dec 20, 2024
1 parent 84d22c8 commit b839767
Showing 1 changed file with 0 additions and 62 deletions.
62 changes: 0 additions & 62 deletions src/solvers/dgsem_p4est/containers_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,6 @@ function calc_node_coordinates!(node_coordinates,
calc_node_coordinates!(node_coordinates, mesh, basis.nodes)
end

# Interpolate tree_node_coordinates to each quadrant at the nodes of the specified basis
function calc_node_coordinates!(node_coordinates,
mesh::P4estMeshView{2},
basis::LobattoLegendreBasis)
# Hanging nodes will cause holes in the mesh if its polydeg is higher
# than the polydeg of the solver.
@assert length(basis.nodes)>=length(mesh.parent.nodes) "The solver can't have a lower polydeg than the mesh"

calc_node_coordinates!(node_coordinates, mesh, basis.nodes)
end

# Interpolate tree_node_coordinates to each quadrant at the specified nodes
function calc_node_coordinates!(node_coordinates,
mesh::P4estMesh{2, NDIMS_AMBIENT},
Expand Down Expand Up @@ -98,57 +87,6 @@ function calc_node_coordinates!(node_coordinates,
return node_coordinates
end

# Interpolate tree_node_coordinates to each quadrant at the specified nodes
function calc_node_coordinates!(node_coordinates,
mesh::P4estMeshView{2, NDIMS_AMBIENT},
nodes::AbstractVector) where {NDIMS_AMBIENT}
# We use `StrideArray`s here since these buffers are used in performance-critical
# places and the additional information passed to the compiler makes them faster
# than native `Array`s.
tmp1 = StrideArray(undef, real(mesh),
StaticInt(NDIMS_AMBIENT), static_length(nodes),
static_length(mesh.parent.nodes))
matrix1 = StrideArray(undef, real(mesh.parent),
static_length(nodes), static_length(mesh.parent.nodes))
matrix2 = similar(matrix1)
baryweights_in = barycentric_weights(mesh.parent.nodes)

# Macros from `p4est`
p4est_root_len = 1 << P4EST_MAXLEVEL
p4est_quadrant_len(l) = 1 << (P4EST_MAXLEVEL - l)

trees = unsafe_wrap_sc(p4est_tree_t, mesh.parent.p4est.trees)[mesh.cell_ids]

for tree in eachindex(trees)
offset = trees[tree].quadrants_offset
quadrants = unsafe_wrap_sc(p4est_quadrant_t, trees[tree].quadrants)

for i in eachindex(quadrants)
element = offset + i
quad = quadrants[i]

quad_length = p4est_quadrant_len(quad.level) / p4est_root_len

nodes_out_x = 2 * (quad_length * 1 / 2 * (nodes .+ 1) .+
quad.x / p4est_root_len) .- 1
nodes_out_y = 2 * (quad_length * 1 / 2 * (nodes .+ 1) .+
quad.y / p4est_root_len) .- 1
polynomial_interpolation_matrix!(matrix1, mesh.parent.nodes, nodes_out_x,
baryweights_in)
polynomial_interpolation_matrix!(matrix2, mesh.parent.nodes, nodes_out_y,
baryweights_in)

multiply_dimensionwise!(view(node_coordinates, :, :, :, element),
matrix1, matrix2,
view(mesh.parent.tree_node_coordinates, :, :, :,
tree),
tmp1)
end
end

return node_coordinates
end

# Initialize node_indices of interface container
@inline function init_interface_node_indices!(interfaces::P4estInterfaceContainer{2},
faces, orientation, interface_id)
Expand Down

0 comments on commit b839767

Please sign in to comment.