From 88a72f7bdef8398619e7ef7cacacb01feb87bb09 Mon Sep 17 00:00:00 2001 From: Tero Frondelius Date: Thu, 17 Nov 2016 19:43:20 +0200 Subject: [PATCH] Fixed abaqus_read_mesh() 1.0E+00 problem --- src/preprocess_abaqus_reader.jl | 2 +- test/test_preprocess_abaqus_reader.jl | 6 ++++++ test/testdata/cube_tet4.inp | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/preprocess_abaqus_reader.jl b/src/preprocess_abaqus_reader.jl index 34ef294..ea5a8b4 100644 --- a/src/preprocess_abaqus_reader.jl +++ b/src/preprocess_abaqus_reader.jl @@ -43,7 +43,7 @@ function parse_section(model, lines, key::Symbol, idx_start, definition = lines[idx_start] for line in lines[idx_start + 1: idx_end] if !(empty_or_comment_line(line)) - m = matchall(r"[-0-9.eE]+", line) + m = matchall(r"[-0-9.eE+]+", line) node_id = parse(Int, m[1]) coords = float(m[2:end]) model["nodes"][node_id] = coords diff --git a/test/test_preprocess_abaqus_reader.jl b/test/test_preprocess_abaqus_reader.jl index c56e664..2114792 100644 --- a/test/test_preprocess_abaqus_reader.jl +++ b/test/test_preprocess_abaqus_reader.jl @@ -55,3 +55,9 @@ end elements = create_surface_elements(mesh,:LOAD) @test get_connectivity(elements[1]) == [8,10,9] end + +@testset "parse nodes from abaqus .inp file to Mesh (NX export)" begin + fn = joinpath(Pkg.dir("JuliaFEM"), "test", "testdata","nx_export_problem.inp") + mesh = abaqus_read_mesh(fn) + @test length(mesh.nodes) == 3 +end diff --git a/test/testdata/cube_tet4.inp b/test/testdata/cube_tet4.inp index 8204138..9b88537 100644 --- a/test/testdata/cube_tet4.inp +++ b/test/testdata/cube_tet4.inp @@ -1,14 +1,14 @@ *NODE, NSET=NALL 1, 4.07417, 3.51532, 4.43035 2, 6.24583, 4.69753, 6.40067 -3, 1.0e1, 10.00000, 0.00000 +3,1.0e1,10.00000,0.00000 4, 1.0E1, 0.00000, 0.00000 5, 0.00000, 0.00000, 0.00000 6, 0.00000, 10.00000, 0.00000 7, 0.00000, 10.00000, 10.00000 8, 0.00000, 0.00000, 10.00000 -9, 100.0e-1, 10.00000, 10.00000 -10, 100.0E-1, 0.00000, 10.00000 +9, 100.0e-1,10.00000,10.00000 +10,100.0E-1,0.00000,10.00000 *ELEMENT, TYPE=C3D4, ELSET=CUBE 1, 8, 10, 1, 2 2, 4, 1, 10, 2