Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring committed Jan 5, 2024
1 parent 244f75f commit 8f0e184
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions src/meshes/p4est_mesh.jl
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,13 @@ function parse_node_sets(meshfile, boundary_symbols)
nodes_dict[current_symbol] = current_nodes
end

# Read only boundary node sets
if current_symbol boundary_symbols
if current_symbol in boundary_symbols
# New nodeset
current_symbol = Symbol(split(line, "=")[2])
current_nodes = Int64[]
else # Read only boundary node sets
current_symbol = nothing
end

# New nodeset
current_symbol = Symbol(split(line, "=")[2])
current_nodes = Int64[]
elseif current_symbol !== nothing # Read only if there was already a nodeset specified
# There is always a trailing comma, remove the corresponding empty string
append!(current_nodes, parse.(Int64, split(line, ",")[1:end-1]))
Expand All @@ -586,14 +585,7 @@ function parse_node_sets(meshfile, boundary_symbols)
nodes_dict[current_symbol] = current_nodes
end
end
#=
# Remove all nodesets that are not boundaries
for key in keys(nodes_dict)
if key ∉ boundary_symbols
delete!(nodes_dict, key)
end
end
=#

return nodes_dict
end

Expand Down

0 comments on commit 8f0e184

Please sign in to comment.