Skip to content

Commit 9c3da4f

Browse files
Use actual set for nodesets, threaded BC assoc (#2373)
1 parent afdb486 commit 9c3da4f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/meshes/p4est_mesh.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ function parse_elements(meshfile, n_trees, n_dims,
882882
end
883883

884884
function parse_node_sets(meshfile, boundary_symbols)
885-
nodes_dict = Dict{Symbol, Vector{Int64}}()
885+
nodes_dict = Dict{Symbol, Set{Int64}}()
886886
current_symbol = nothing
887887
current_nodes = Int64[]
888888

@@ -898,14 +898,14 @@ function parse_node_sets(meshfile, boundary_symbols)
898898
current_symbol = Symbol(split(line, "=")[2])
899899
if current_symbol in boundary_symbols
900900
# New nodeset
901-
current_nodes = Int64[]
901+
current_nodes = Set{Int64}()
902902
else # Read only boundary node sets
903903
current_symbol = nothing
904904
end
905905
elseif current_symbol !== nothing # Read only if there was already a nodeset specified
906906
try # Check if line contains nodes
907907
# There is always a trailing comma, remove the corresponding empty string
908-
append!(current_nodes, parse.(Int64, split(line, ",")[1:(end - 1)]))
908+
union!(current_nodes, parse.(Int64, split(line, ",")[1:(end - 1)]))
909909
catch # Something different, stop reading in nodes
910910
# If parsing fails, set current_symbol to nothing
911911
nodes_dict[current_symbol] = current_nodes
@@ -933,7 +933,7 @@ end
933933
function assign_boundaries_standard_abaqus!(boundary_names, n_trees,
934934
element_node_matrix, node_set_dict,
935935
::Val{2}) # 2D version
936-
for tree in 1:n_trees
936+
@threaded for tree in 1:n_trees
937937
tree_nodes = element_node_matrix[tree, :]
938938
# For node labeling, see
939939
# https://docs.software.vt.edu/abaqusv2022/English/SIMACAEELMRefMap/simaelm-r-2delem.htm#simaelm-r-2delem-t-nodedef1
@@ -974,7 +974,7 @@ end
974974
function assign_boundaries_standard_abaqus!(boundary_names, n_trees,
975975
element_node_matrix, node_set_dict,
976976
::Val{3}) # 3D version
977-
for tree in 1:n_trees
977+
@threaded for tree in 1:n_trees
978978
tree_nodes = element_node_matrix[tree, :]
979979
# For node labeling, see
980980
# https://web.mit.edu/calculix_v2.7/CalculiX/ccx_2.7/doc/ccx/node26.html

0 commit comments

Comments
 (0)