Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.33 KB

README.md

File metadata and controls

60 lines (44 loc) · 1.33 KB

AbaAccess.jl

A simple module with one function MeshObtain to get mesh information, including nodes, elements, nodesets and elsets from an .inp file.

Documents

Read an .inp file

example

NodeDict,ElemDict,NSetDict,ElSetDict=MeshObtain(InpName);

The information of nodes,elements,nsets and elsets will be stored in dictionarys.

Attention: both nset and elset now just support defined by nodes and elements id. And keyword *part and *assembly are not support yet.

Write an .inp file

example

# open a file
FileName = "test.inp"
fID = open(FileName,"w");

# write nodes
NodesWrite!(fID,NodeDict);

# write elements
ElemType = "CPE4";    # any type you need
ElementsWrite!(fID,ElemDict;ElemType=ElemType);

# write nset
NSetWrite!(fID,NSetDict);

# write elset 
ElSetWrite!(fID,ElSetDict);

# close the file
close(fID);

Meanwhile, an optional function is also provided to output the mesh information easily:

# give a file name and out put it
FileName = "test2.inp";
LazyMeshWrite(NodeDict,ElemDict,NSetDict,ElSetDict;ElemType=ElemType,FileName=FileName);

Alternatively, the definition of element can also by given element ID array

ElementsWrite!(fID,ElemDict,ElemIDArray;ElemType=ElemType);

Installation

pkg> add https://github.com/bplcn/AbaAccess.jl.git