mirror of
https://github.com/JuliaFEM/JuliaFEM.jl.git
synced 2026-09-12 06:22:00 +00:00
parse_section() fixed to ignore parameters order
This commit is contained in:
@@ -161,10 +161,11 @@ function parse_section(model, lines, key, idx_start, idx_end, ::Type{Val{:SURFAC
|
||||
info("Parsing surface")
|
||||
#definition = uppercase(lines[idx_start])
|
||||
definition = lines[idx_start]
|
||||
has_set_def = match(r"TYPE=([\w\_\-]+),.*NAME=([\w\_\-]+)", definition)
|
||||
#has_set_def = match(r"TYPE=([\w\_\-]+),.*NAME=([\w\_\-]+)", definition)
|
||||
has_set_def = Dict(map(y -> lowercase(y[1]) => y[2], map(x -> split(x, "="), matchall(r"([\w\_\-]+[ ]*=[ ]*[\w\_\-]+)", definition))))
|
||||
has_set_def != nothing || return
|
||||
set_type = Symbol(has_set_def[1])
|
||||
set_name = Symbol(has_set_def[2])
|
||||
set_type = Symbol(has_set_def["type"])
|
||||
set_name = Symbol(has_set_def["name"])
|
||||
data = Vector{Tuple{Int64, Symbol}}()
|
||||
for line in lines[idx_start + 1: idx_end]
|
||||
empty_or_comment_line(line) && continue
|
||||
|
||||
@@ -46,6 +46,7 @@ end
|
||||
@test haskey(mesh.node_sets, :SYM12)
|
||||
@test haskey(mesh.element_sets, :CUBE)
|
||||
@test haskey(mesh.surfaces, :LOAD)
|
||||
@test haskey(mesh.surfaces, :ORDER)
|
||||
@test length(mesh.surfaces[:LOAD]) == 2
|
||||
@test mesh.surfaces[:LOAD][1] == (16, :S1)
|
||||
@test mesh.surface_types[:LOAD] == :ELEMENT
|
||||
|
||||
Vendored
+3
@@ -40,6 +40,9 @@
|
||||
*SURFACE, TYPE=ELEMENT, NAME=LOAD
|
||||
16, S1
|
||||
8, S1
|
||||
*SURFACE, NAME=ORDER , TYPE=ELEMENT
|
||||
16, S1
|
||||
8, S1
|
||||
*STEP
|
||||
*STATIC
|
||||
*BOUNDARY
|
||||
|
||||
Reference in New Issue
Block a user