changed creating elements + preprocess aster med file more general for other inputs too

This commit is contained in:
Jukka Aho
2016-06-18 12:53:01 +03:00
parent 85ccc50391
commit ca26626e48
8 changed files with 149 additions and 43 deletions
+22
View File
@@ -372,3 +372,25 @@ function parse_aster_med_file(fn::ASCIIString, mesh_name=nothing)
result["connectivity"] = conn
return result
end
function aster_read_mesh(fn::ASCIIString, mesh_name=nothing)
result = parse_aster_med_file(fn, mesh_name)
mesh = Mesh()
for (nid, ncoords) in result["nodes"]
add_node!(mesh, nid, ncoords)
end
mapping = Dict(
:SE2 => :Seg2,
:TR3 => :Tri3,
:TR6 => :Tri6,
:QU4 => :Quad4,
:HE8 => :Hex8,
:TE4 => :Tet4,
:T10 => :Tet10)
for (elid, (eltype, elset, elcon)) in result["connectivity"]
add_element!(mesh, elid, mapping[eltype], elcon)
add_element_to_element_set!(mesh, string(elset), elid)
end
return mesh
end