Giter Club home page Giter Club logo

juliafem / abaqusreader.jl Goto Github PK

View Code? Open in Web Editor NEW
35.0 8.0 22.0 727 KB

AbaqusReader.jl is a parse for ABAQUS FEM models. It's capable of parsing the geometry accurately, including surface sets, node sets, and other relevant geometrical data used in FEM calculations. Other option is to parse whole model, including boundary conditions, material data and load steps.

Home Page: https://juliafem.github.io/AbaqusReader.jl/latest

License: MIT License

Julia 100.00%
abaqus parser julialang inp

abaqusreader.jl's Introduction

JuliaFEM.jl - an open source solver for both industrial and academia usage

logo

DOI License Gitter Build Status Coverage Status Stable documentation Latest documentation Issues


Everything is outdated. See other FEM options from here: https://github.com/JuliaPDE/SurveyofPDEPackages?tab=readme-ov-file#fem


JuliaFEM organization web-page: http://www.juliafem.org

The JuliaFEM project develops open-source software for reliable, scalable, distributed Finite Element Method.

The JuliaFEM software library is a framework that allows for the distributed processing of large Finite Element Models across clusters of computers using simple programming models. It is designed to scale up from single servers to thousands of machines, each offering local computation and storage. The basic design principle is: everything is nonlinear. All physics models are nonlinear from which the linearization are made as a special cases.

At the moment, users can perform the following analyses with JuliaFEM: elasticity, thermal, eigenvalue, contact mechanics, and quasi-static solutions. Typical examples in industrial applications include non-linear solid mechanics, contact mechanics, finite strains, and fluid structure interaction problems. For visualization, JuliaFEM uses ParaView which prefers XDMF file format using XML to store light data and HDF to store large data-sets, which is more or less the open-source standard.

Vision

On one hand, the vision of the JuliaFEM includes the opportunity for massive parallelization using multiple computers with MPI and threading as well as cloud computing resources in Amazon, Azure and Google Cloud services together with a company internal server. And on the other hand, the real application complexity including the simulation model complexity as well as geometric complexity. Not to forget that the reuse of the existing material models as well as the whole simulation models are considered crucial features of the JuliaFEM package.

Recreating the wheel again is definitely not anybody's goal, and thus we try to use and embrace good practices and formats as much as possible. We have implemented Abaqus / CalculiX input-file format support and maybe will in the future extend to other FEM solver formats. Using modern development environments encourages the user towards fast development time and high productivity. For developing and creating new ideas and tutorials, we have used Jupyter notebooks to make easy-to-use handouts.

The user interface for JuliaFEM is Jupyter Notebook, and Julia language itself is a real programming language. This makes it possible to use JuliaFEM as a part of a bigger solution cycle, including for example data mining, automatic geometry modifications, mesh generation, solution, and post-processing and enabling efficient optimization loops.

Installing JuliaFEM

Inside Julia REPL, type:

Pkg.add("JuliaFEM")

Initial road map

JuliaFEM current status: project planning

Version Number of degree of freedom Number of cores
0.1.0 1 000 000 10
0.2.0 10 000 000 100
1.0.0 100 000 000 1 000
2.0.0 1 000 000 000 10 000
3.0.0 10 000 000 000 100 000

We strongly believe in the test driven development as well as building on top of previous work. Thus all the new code in this project should be 100% tested. Also other people have wisdom in style as well:

The Zen of Python:

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Errors should never pass silently.

Citing

If you like using our package, please consider citing our article

@article{frondelius2017juliafem,
  title={Julia{FEM} - open source solver for both industrial and academia usage},
  volume={50}, 
  url={https://rakenteidenmekaniikka.journal.fi/article/view/64224},
  DOI={10.23998/rm.64224},
  number={3},
  journal={Rakenteiden Mekaniikka},
  author={Frondelius, Tero and Aho, Jukka},
  year={2017},
  pages={229-233}
}

Contributing

Developing JuliaFEM encourages good practices, starting from unit testing both for smaller and larger functions and continuing to full integration testing of different platforms.

Interested in participating? Please start by reading contributing.

abaqusreader.jl's People

Contributors

ahojukka5 avatar avigliotti avatar benzwick avatar carlomontec avatar femtocleaner[bot] avatar gerrygralton avatar jthesse avatar jtveiten avatar juliatagbot avatar ovainola avatar sebastianpech avatar terofrondelius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

abaqusreader.jl's Issues

No support for set names in quotes

Set names with spaces are put into quotes by abaqus. This is currently not supported by the regex matching mechanism.

Example:

*Nset, nset="Outer Coarse"

Error due to lowercase elset and nset

If the inp file contains lowercase elset such as:

*Nset, nset=setEncastre, instance=Part-1-1
3, 5, 8, 56, 57, 58, 59, 60, 61, 62, 63

it triggers an error on the regex_match function.

This can be avoided by adding the "i" flag to the regexp string (line 175 of parse_mesh.jl):

set_regex_string = Dict(:NSET => r"NSET=([\w-_]+)"i,
:ELSET => r"ELSET=([\w-_]+)"i )

Support for C3D6

Hi there, I just tried to test the AbaqusReader with a model that I am using.
Unfortunately it seems that C3D6 elements are currently not supported.

Will those elements be supported in a future release or is this project currently on hold?
Thank you!

Aware of FileIO.jl?

Similar to AsterReader.jl, I am opening an issue to make sure you are aware of the FileIO interface.

It is great to be able to just rely on something like:

using FileIO

load("filename.extension")
save("filename.extension", data)

and let the FileIO package handle the file formats.

multiple parts mesh

It seems to me that AbaqusReader.jl cannot read an inp file containing multiple parts. Is that true?

Improve performance by replacing abstract Integer with concrete Int in arrays and dicts

We might be able to improve performance by using concrete Int types instead of abstract Integer types in the following places:

test/test_parse_mesh.jl
30:    model["elements"] = Dict{Integer, Vector{Integer}}()
32:    model["element_types"] = Dict{Integer, Symbol}()

README.md
18:  "element_types" => Dict{Integer,Symbol}(Pair{Integer,Symbol}(2, :Tet4),Pair{I…
19:  "elements"      => Dict{Integer,Array{Integer,1}}(Pair{Integer,Array{Integer,…

src/create_surface_elements.jl
62:    result = Tuple{Symbol, Vector{Integer}}[]

src/parse_model.jl
18:    node_sets :: Dict{String, Vector{Integer}}
21:    element_sets :: Dict{String, Vector{Integer}}

src/parse_mesh.jl
97:    ids = Integer[]
144:    ids = Integer[]
180:    data = Integer[]
231:    indexes = Integer[]
249:    model["elements"] = Dict{Integer, Vector{Integer}}()
250:    model["element_types"] = Dict{Integer, Symbol}()

Some quick benchmarks:

julia> using BenchmarkTools

julia> a = Integer[]
0-element Array{Integer,1}

julia> @benchmark for i = 1:1000 push!(a, i^2+1) end
BenchmarkTools.Trial: 
  memory estimate:  30.56 KiB
  allocs estimate:  1956
  --------------
  minimum time:     22.861 μs (0.00% GC)
  median time:      27.172 μs (0.00% GC)
  mean time:        55.590 μs (0.00% GC)
  maximum time:     252.070 ms (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1
julia> using BenchmarkTools

julia> b = Int[]
0-element Array{Int64,1}

julia> @benchmark for i = 1:1000 push!(b, i^2+1) end
BenchmarkTools.Trial: 
  memory estimate:  15.28 KiB
  allocs estimate:  978
  --------------
  minimum time:     17.985 μs (0.00% GC)
  median time:      22.930 μs (0.00% GC)
  mean time:        25.419 μs (0.00% GC)
  maximum time:     313.297 μs (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1

The maximum time is probably most important because we usually only do this once for each array.

See Avoid containers with abstract type parameters

C3D20 not working.

Hello, I tested to read a mesh with C3D20 elements without success, having the error:

ERROR: LoadError: MethodError: no method matching element_has_type(::Type{Val{:C3D20}}) Closest candidates are: element_has_type(::Type{Val{:C3D4}}) at /home/monjaraz/.julia/packages/AbaqusReader/5egCd/src/parse_mesh.jl:8 element_has_type(::Type{Val{:C3D8}}) at /home/monjaraz/.julia/packages/AbaqusReader/5egCd/src/parse_mesh.jl:11 element_has_type(::Type{Val{:C3D10}}) at /home/monjaraz/.julia/packages/AbaqusReader/5egCd/src/parse_mesh.jl:14 ...

However, if I add the following line in parse_mesh.jl
element_has_type(::Type{Val{:C3D20}}) = :Hex20
seems to work.

I must add that I only use the mesh importer for my own code to extract data of elements and nodes, rather than for JuliaFEM. Therefore I dont know if it would break anything at JuliaFEM

Thanks!

Dont print info by default

It would be nice if there was a verbose option to turn on the info-printing but have it be quiet by default.

Bug: key "nset" not found

using AbaqusReader
mesh = abaqus_read_mesh("tet4.inp")

Results:

julia> using AbaqusReader
julia> abaqus_read_mesh("tet4.inp")
ERROR: KeyError: key "nset" not found
Stacktrace:
 [1] getindex at .\dict.jl:474 [inlined]
 [2] add_set!(::Dict{String,Dict}, ::String, ::String, ::String, ::Array{Integer,1}) at C:\Users\jahx06\.julia\v0.6\AbaqusReader\src\parse_mesh.jl:67
 [3] parse_section(::Dict{String,Dict}, ::Array{String,1}, ::Symbol, ::Int64, ::Int64, ::Type{Val{:NODE}}) at C:\Users\jahx06\.julia\v0.6\AbaqusReader\src\parse_mesh.jl:92
 [4] parse_abaqus(::IOStream) at C:\Users\jahx06\.julia\v0.6\AbaqusReader\src\parse_mesh.jl:251
 [5] open(::AbaqusReader.#parse_abaqus, ::String) at .\iostream.jl:152
 [6] abaqus_read_mesh(::String) at C:\Users\jahx06\.julia\v0.6\AbaqusReader\src\parse_mesh.jl:270

Test data included.

tet4.zip

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

mesh = aster_read_mesh(meshfile) doesn't work in my case...

Hi, I am a beginner in Julia and I am learning JuliaFEM atm.
I added the JuliaFEM and LinearAlgebra Package.
but when come to:

mesh = aster_read_mesh(meshfile)

then comes message as follows:

MethodError: no method matching get_nodes(::AsterReader.MEDFile, ::Dict{Int64,Array{String,1}}, ::String)
Closest candidates are:
get_nodes(::AsterReader.MEDFile, !Matched::Dict{Int32,Array{String,1}}, ::String) at C:\Users\21631933.julia\packages\AsterReader\LfzMD\src\read_aster_mesh.jl:119

Stacktrace:
[1] aster_read_mesh_(::AsterReader.MEDFile, ::Nothing) at C:\Users\21631933.julia\packages\AsterReader\LfzMD\src\read_aster_mesh.jl:201
[2] aster_read_mesh(::String, ::Nothing) at C:\Users\21631933.julia\packages\AsterReader\LfzMD\src\read_aster_mesh.jl:177
[3] #aster_read_mesh#121(::Bool, ::typeof(aster_read_mesh), ::String, ::Nothing) at C:\Users\21631933.julia\packages\JuliaFEM\or1RT\src\preprocess_aster_reader.jl:59
[4] aster_read_mesh(::String, ::Nothing) at C:\Users\21631933.julia\packages\JuliaFEM\or1RT\src\preprocess_aster_reader.jl:59 (repeats 2 times)
[5] top-level scope at In[11]:1

Can anyone helps me with this issue?
THANKS.

Beam elements not supported.

AbaqusReader doesn't support beam elements even though 2 node cubic beams are implemented to JuliaFEM in FEMBeam.jl. The 2 node cubic beam element in space is B33-element in Abaqus.

question, how to prevent info echoing when reading mesh

hi ahojukka5,

first of all thanks for the great work and for making it available. Can I ask how can I prevent the echo of the mesh info when reading a mesh

I have models with a large number of sets and it ends up filling the REPL of the jupyter cell,
just like :

┌ Info: Creating nset ID_L
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating elset ID_L
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating nset ID_R
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating elset ID_R
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating nset ID_T
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating elset ID_T
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating nset ID_B
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating elset ID_B
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating nset ALL
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating elset ALL
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating nset ID_SH01
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating elset ID_SH01
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
┌ Info: Creating nset ID_SH02
└ @ AbaqusReader /home/andrea/.julia/packages/AbaqusReader/C1mY0/src/parse_mesh.jl:187
...
...

thanks,
Andrea

Tag AbaqusReader.jl

  • 100 % tested
  • 100 % code coverage
  • automatically use Lint.jl to check code syntax
  • automatically generated documentation is found here
  • basically three functions, abaqus_read_mesh to read only mesh to Dict or abaqus_read_model to read entire model, while third one is to create_elements which can be used to determine correct nodes for surface of volume element

Any comments, @TeroFrondelius, @ovainola?

Element Variations

Abaqus uses a wide range of variations of the standard elements, e.g. for element type C3D10 there are also C3D10R (reduced integration), C3D10T (includes a temperature dof), C3D10H (hybrid formulation). These all have the same node layout, but use different integration schemes, or store additional temperature values. The same argument could be made for e.g. CPS3 and CPE3 (plane stress vs plane strain) as well als CAX3 (axisymmetrical 2d).

I think this is similar to issue #43, but on a more general scale (i.e. specifically adding all these elements would produce a lot of repeating lines of code). I am not aware of how AbaqusReader integrates into JuliaFEM, therefore i am unsure if the additional information beyond the mesh geometry (which could be the same 2d mesh for a plane stress and an axisymmetric analysis) is reused at some point. At least for the geometry, it may be possible to parse the element based on the start of the element string instead of explicitly repeating every variation of the same element.

Need support for area in solid section

keyword *solid section isn't parsed correctly if used for t2d2 elements when given area of truss in line below keyword

The input snippet is:

*MATERIAL,NAME=ALUM
*ELASTIC
1E7,.3
*SOLID SECTION,ELSET=EAll,MATERIAL=ALUM
.0625

When parsed, it doesn't fail when you read the model, but no area is defined

If the input is like this:

*SOLID SECTION,MATERIAL=ALUM, ELSET=EALL
.0625, 
*MATERIAL,NAME=ALUM
*ELASTIC
1E7, 
*DENSITY
7.5E-4, 

the parsing of the model will fail.

Without being too well versed in the code, it may look like the solid section needs to be closed in the second case and support that nu isn't given in the material definition.

Here is the full input file tried

**
**   Structure: truss, two elements
**   Test objective: T3D2 elements.
**
*NODE,NSET=Nall
1, 0, 0
2, 5, 5
3, 0, 10
*ELEMENT,TYPE=T2D2,ELSET=EAll
1,1,2
2,2,3
*BOUNDARY
1,1,2
3,1,2
*MATERIAL,NAME=ALUM
*ELASTIC
1E7,.3
*SOLID SECTION,ELSET=EAll,MATERIAL=ALUM
.0625
*STEP
*STATIC
*CLOAD
2,1,1.
*EL PRINT,ELSET=Eall,FREQUENCY=100
S
*NODE FILE,OUTPUT=3D
U
*EL FILE
S
*END STEP

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.