2015-06-25 21:17:29 +03:00
|
|
|
# This file is a part of JuliaFEM.
|
|
|
|
|
# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md
|
|
|
|
|
|
2016-06-19 20:01:37 +03:00
|
|
|
using JuliaFEM
|
|
|
|
|
using JuliaFEM.Preprocess
|
2016-07-10 04:26:21 +03:00
|
|
|
using JuliaFEM.Testing
|
2015-06-25 19:58:26 +03:00
|
|
|
|
2016-06-19 20:01:37 +03:00
|
|
|
@testset "read inp file" begin
|
2015-11-26 05:42:16 +02:00
|
|
|
model = open(parse_abaqus, Pkg.dir("JuliaFEM")*"/geometry/3d_beam/palkki.inp")
|
|
|
|
|
@test length(model["nodes"]) == 298
|
|
|
|
|
@test length(model["elements"]) == 120
|
2016-07-03 05:00:01 +03:00
|
|
|
@test length(model["elsets"]["Body1"]) == 120
|
2015-11-26 05:42:16 +02:00
|
|
|
@test length(model["nsets"]["SUPPORT"]) == 9
|
|
|
|
|
@test length(model["nsets"]["LOAD"]) == 9
|
|
|
|
|
@test length(model["nsets"]["TOP"]) == 83
|
2015-06-25 21:17:29 +03:00
|
|
|
end
|
2015-06-27 18:46:07 +03:00
|
|
|
|
2016-06-19 20:01:37 +03:00
|
|
|
@testset "test read element section" begin
|
2015-12-01 12:23:51 +02:00
|
|
|
data = """*ELEMENT, TYPE=C3D10, ELSET=BEAM
|
2015-08-22 20:55:24 +03:00
|
|
|
1, 243, 240, 191, 117, 245, 242, 244,
|
|
|
|
|
1, 2, 196
|
|
|
|
|
2, 204, 199, 175, 130, 207, 208, 209,
|
|
|
|
|
3, 4, 176
|
|
|
|
|
"""
|
2015-12-01 12:23:51 +02:00
|
|
|
data = split(data, "\n")
|
|
|
|
|
model = Dict{AbstractString, Any}()
|
|
|
|
|
model["nsets"] = Dict{AbstractString, Vector{Int}}()
|
|
|
|
|
model["elsets"] = Dict{AbstractString, Vector{Int}}()
|
|
|
|
|
model["elements"] = Dict{Integer, Any}()
|
|
|
|
|
parse_section(model, data, :ELEMENT, 1, 5, Val{:ELEMENT})
|
2015-11-26 05:42:16 +02:00
|
|
|
@test length(model["elements"]) == 2
|
2015-12-01 12:23:51 +02:00
|
|
|
@test model["elements"][1]["connectivity"] == [243, 240, 191, 117, 245, 242, 244, 1, 2, 196]
|
|
|
|
|
@test model["elements"][2]["connectivity"] == [204, 199, 175, 130, 207, 208, 209, 3, 4, 176]
|
2015-11-26 05:42:16 +02:00
|
|
|
@test model["elsets"]["BEAM"] == [1, 2]
|
2015-06-27 18:46:07 +03:00
|
|
|
end
|
2015-06-27 18:52:44 +03:00
|
|
|
|
2016-07-10 04:26:21 +03:00
|
|
|
@testset "parse nodes from abaqus .inp file to Mesh" begin
|
|
|
|
|
fn = Pkg.dir("JuliaFEM") * "/test/testdata/cube_tet4.inp"
|
|
|
|
|
mesh = abaqus_read_mesh(fn)
|
|
|
|
|
info(mesh.surfaces)
|
|
|
|
|
@test length(mesh.nodes) == 10
|
|
|
|
|
@test length(mesh.elements) == 17
|
|
|
|
|
@test haskey(mesh.elements, 1)
|
|
|
|
|
@test mesh.elements[1] == [8, 10, 1, 2]
|
|
|
|
|
@test mesh.element_types[1] == :Tet4
|
|
|
|
|
@test haskey(mesh.node_sets, :SYM12)
|
|
|
|
|
@test haskey(mesh.element_sets, :CUBE)
|
|
|
|
|
@test haskey(mesh.surfaces, :LOAD)
|
|
|
|
|
@test length(mesh.surfaces[:LOAD]) == 2
|
|
|
|
|
@test mesh.surfaces[:LOAD][1] == (16, :S1)
|
|
|
|
|
@test mesh.surface_types[:LOAD] == :ELEMENT
|
2016-07-03 21:16:03 +03:00
|
|
|
end
|