parse_section() fixed to ignore parameters order

This commit is contained in:
Tero Frondelius
2016-10-26 22:28:49 +03:00
parent b707f98b93
commit 2b0124041c
3 changed files with 8 additions and 3 deletions
+4 -3
View File
@@ -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
+1
View File
@@ -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
+3
View File
@@ -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