-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from benzwick/lower-case-keywords
Parse lower/mixed case input files
- Loading branch information
Showing
3 changed files
with
103 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This file is a part of JuliaFEM. | ||
# License is MIT: see https://github.com/JuliaFEM/AbaqusReader.jl/blob/master/LICENSE | ||
|
||
using AbaqusReader: abaqus_read_model | ||
using AbaqusReader: parse_keyword | ||
|
||
datadir = first(splitext(basename(@__FILE__))) | ||
|
||
@testset "parse abaqus inp file to AbaqusModel" begin | ||
fn = joinpath(datadir, "cube_tet4_mixed_case.inp") | ||
model = abaqus_read_model(fn) | ||
|
||
@test length(model.properties) == 1 | ||
section = first(model.properties) | ||
@test section.element_set == :Cube | ||
@test section.material_name == :Mat | ||
|
||
@test haskey(model.materials, :Mat) | ||
material = model.materials[:Mat] | ||
@test isapprox(first(material.properties).E, 208.0e3) | ||
|
||
@test length(model.steps) == 1 | ||
step = first(model.steps) | ||
@test length(step.boundary_conditions) == 2 | ||
|
||
bc = step.boundary_conditions[1] | ||
@test bc.data[1] == [:Sym23, 1] | ||
@test bc.data[2] == [:Sym13, 2] | ||
|
||
load = step.boundary_conditions[2] | ||
@test load.data[1] == [:Load, :p, 1.00000] | ||
end | ||
|
||
@testset "parse keyword" begin | ||
k = parse_keyword("*SURFACE, NAME=TIE, SURFACE TO SURFACE") | ||
@test k.options[1] == ("NAME" => "TIE") | ||
@test k.options[2] == "SURFACE TO SURFACE" | ||
@test_throws(Exception, parse_keyword("*SURFACE, MOI=HEI=EI")) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
*Node, Nset=Nall | ||
1, 4.07417, 3.51532, 4.43035 | ||
2, 6.24583, 4.69753, 6.40067 | ||
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 | ||
*Element, Type=C3d4, Elset=Cube | ||
1, 8, 10, 1, 2 | ||
2, 4, 1, 10, 2 | ||
3, 3, 9, 7, 2 | ||
4, 3, 5, 4, 1 | ||
5, 8, 7, 2, 1 | ||
6, 5, 6, 8, 1 | ||
7, 7, 6, 1, 8 | ||
8, 7, 9, 8, 2 | ||
9, 5, 8, 10, 1 | ||
10, 3, 6, 5, 1 | ||
11, 4, 10, 9, 2 | ||
12, 1, 7, 2, 3 | ||
13, 3, 4, 9, 2 | ||
14, 3, 1, 4, 2 | ||
15, 4, 5, 10, 1 | ||
16, 8, 9, 10, 2 | ||
17, 3, 6, 1, 7 | ||
*Solid Section, Elset=Cube, Material=Mat | ||
*Material, Name=Mat | ||
*Elastic | ||
2.08000e+005, 3.00000e-001 | ||
*Nset, Nset=Sym12 | ||
5, 6, 3, 4, | ||
*Nset, Nset=Sym23 | ||
5, 6, 7, 8, | ||
*Nset, Nset=Sym13 | ||
5, 10, 8, 4, | ||
*Surface, Type=Element, Name=Load | ||
16, S1 | ||
8, S1 | ||
*Surface, Name=Order , Type=Element | ||
16, S1 | ||
8, S1 | ||
*Boundary | ||
Sym12, 3 | ||
*Step | ||
*Static | ||
*Boundary | ||
Sym23, 1 | ||
Sym13, 2 | ||
*Dsload | ||
Load, p, 1.00000 | ||
*Node File | ||
Coord | ||
u | ||
*Node Print | ||
Coord | ||
u | ||
*End Step |