API Reference
Overview
AbaqusReader.jl exports the following main functions for working with ABAQUS input files:
- File-based API:
abaqus_read_mesh,abaqus_read_model(read from .inp files) - String-based API:
abaqus_parse_mesh,abaqus_parse_model(parse from string buffers) - Utilities:
create_surface_elements,abaqus_download
Index
AbaqusReader.abaqus_downloadAbaqusReader.abaqus_parse_meshAbaqusReader.abaqus_parse_modelAbaqusReader.abaqus_read_meshAbaqusReader.abaqus_read_modelAbaqusReader.create_surface_elements
Exported Functions
AbaqusReader.abaqus_read_mesh — Function
abaqus_read_mesh(fn::String) -> DictRead ABAQUS .inp file and extract mesh geometry and topology.
This function performs mesh-only parsing, extracting nodes, elements, sets, and surfaces without parsing materials, boundary conditions, or analysis steps. Use this when you only need the geometric structure of the model.
Arguments
fn::String: Path to the ABAQUS input file (.inp)
Returns
A Dict{String, Any} containing:
"nodes":Dict{Int, Vector{Float64}}- Node ID → coordinates [x, y, z]"elements":Dict{Int, Vector{Int}}- Element ID → node connectivity"element_types":Dict{Int, Symbol}- Element ID → topological type (e.g.,:Tet4,:Hex8)"element_codes":Dict{Int, Symbol}- Element ID → original ABAQUS element name (e.g.,:C3D8R,:CPS3)"node_sets":Dict{String, Vector{Int}}- Node set name → node IDs"element_sets":Dict{String, Vector{Int}}- Element set name → element IDs"surface_sets":Dict{String, Vector{Tuple{Int, Symbol}}}- Surface name → (element, face) pairs"surface_types":Dict{String, Symbol}- Surface name → surface type (e.g.,:ELEMENT)
Examples
using AbaqusReader
# Read mesh from file
mesh = abaqus_read_mesh("model.inp")
# Access node coordinates
coords = mesh["nodes"][1] # [x, y, z] for node 1
# Get element connectivity
elem_nodes = mesh["elements"][1] # Node IDs for element 1
# Get topological element type
elem_type = mesh["element_types"][1] # e.g., :Hex8
# Get original ABAQUS element code
elem_code = mesh["element_codes"][1] # e.g., :C3D8R
# Get nodes in a set
boundary_nodes = mesh["node_sets"]["BOUNDARY"]See Also
abaqus_parse_mesh: Parse mesh from string bufferabaqus_read_model: Read complete model including materials and boundary conditionscreate_surface_elements: Extract surface elements from surface definitions
Notes
- Supports 60+ ABAQUS element types (see documentation for full list)
- Returns simple dictionary structure for easy manipulation
- Much faster than
abaqus_read_modelwhen only mesh is needed - Element types are mapped to generic topology (e.g.,
C3D8R→:Hex8) - Original ABAQUS element names preserved in
element_codesfor traceability
AbaqusReader.abaqus_parse_mesh — Function
abaqus_parse_mesh(content::AbstractString) -> DictParse ABAQUS mesh from a string buffer.
This is the core parsing function that extracts mesh geometry and topology from ABAQUS input file content provided as a string. Use this when you have the content in memory or want to avoid file I/O in tests.
Arguments
content::AbstractString: ABAQUS input file content as a string
Returns
Same dictionary structure as abaqus_read_mesh:
"nodes": Node coordinates"elements": Element connectivity"element_types": Topological types"element_codes": Original ABAQUS element names"node_sets","element_sets","surface_sets": Named sets
Examples
inp_content = """
*NODE
1, 0.0, 0.0, 0.0
2, 1.0, 0.0, 0.0
*ELEMENT, TYPE=C3D8
1, 1, 2, 3, 4, 5, 6, 7, 8
"""
mesh = abaqus_parse_mesh(inp_content)See Also
abaqus_read_mesh: Read mesh from file
AbaqusReader.abaqus_read_model — Function
abaqus_read_model(fn::String) -> ModelRead complete ABAQUS model including mesh, materials, boundary conditions, and analysis steps.
This function performs complete model parsing, extracting the entire simulation definition from an ABAQUS input file. Use this when you need to reproduce or analyze the full simulation setup, not just the mesh geometry.
Arguments
fn::String: Path to the ABAQUS input file (.inp)
Returns
An AbaqusReader.Model object with fields:
path::String: Directory containing the input filename::String: Model name (basename without extension)mesh::Mesh: Mesh object containing all geometric datamesh.nodes: Node coordinatesmesh.elements: Element connectivitymesh.element_types: Element type mappingmesh.node_sets: Named node setsmesh.element_sets: Named element setsmesh.surface_sets: Surface definitions
materials::Dict: Material definitions with properties- Each material may contain elastic, density, plastic, etc.
properties::Vector: Section property assignments (linking materials to element sets)boundary_conditions::Vector: Prescribed displacements, constraints, etc.steps::Vector: Analysis steps with loads, BCs, and output requests
Examples
using AbaqusReader
# Read complete model
model = abaqus_read_model("simulation.inp")
# Access mesh (same structure as abaqus_read_mesh)
nodes = model.mesh.nodes
elements = model.mesh.elements
# Access material properties
for (name, material) in model.materials
println("Material: $name")
for prop in material.properties
if prop isa AbaqusReader.Elastic
println(" E = $(prop.E), ν = $(prop.nu)")
end
end
end
# Iterate through boundary conditions
for bc in model.boundary_conditions
println("BC type: $(bc.kind), data: $(bc.data)")
end
# Iterate through analysis steps
for step in model.steps
println("Step type: $(step.kind)")
println(" BCs: $(length(step.boundary_conditions))")
println(" Outputs: $(length(step.output_requests))")
endSee Also
abaqus_parse_model: Parse model from string bufferabaqus_read_mesh: Read only mesh geometry (faster, simpler output)create_surface_elements: Extract surface elements from model
Notes
- Slower than
abaqus_read_meshas it parses the entire model - Returns structured
Modelobject (not a simple Dict) - Parses most common ABAQUS keywords but not every possible option
- Best suited for "flat" input files; structured part/assembly files may have limited support
- Use when you need materials, BCs, loads, or analysis parameters
AbaqusReader.abaqus_parse_model — Function
abaqus_parse_model(content::AbstractString) -> ModelParse complete ABAQUS model from a string buffer.
This is the core parsing function that extracts the entire simulation definition from ABAQUS input file content provided as a string. Use this when you have the content in memory, want to avoid file I/O in tests, or are working with generated input content.
Arguments
content::AbstractString: ABAQUS input file content as a string
Returns
An AbaqusReader.Model object (same structure as abaqus_read_model)
Examples
inp_content = """
*HEADING
Test model
*NODE
1, 0.0, 0.0, 0.0
*ELEMENT, TYPE=C3D8
1, 1, 2, 3, 4, 5, 6, 7, 8
*MATERIAL, NAME=STEEL
*ELASTIC
210000.0, 0.3
"""
model = abaqus_parse_model(inp_content)
println("Materials: ", keys(model.materials))See Also
abaqus_read_model: Read model from fileabaqus_parse_mesh: Parse only mesh from string
AbaqusReader.create_surface_elements — Function
create_surface_elements(mesh::Dict, surface_name::String) -> Vector{Tuple{Symbol, Vector{Int}}}Create explicit surface elements from an implicit surface definition in an ABAQUS mesh.
ABAQUS surfaces are typically defined implicitly as (element, face) pairs. This function converts those implicit definitions into explicit surface elements with their own connectivity, which is useful for applying boundary conditions, extracting surface nodes, or visualization.
Arguments
mesh::Dict: Mesh dictionary as returned byabaqus_read_meshsurface_name::String: Name of the surface to extract (must exist inmesh["surface_sets"])
Returns
Vector{Tuple{Symbol, Vector{Int}}} where each tuple contains:
- Element type symbol (e.g.,
:Tri3,:Quad4) for the surface element - Node connectivity vector for that surface element
Examples
using AbaqusReader
# Read mesh with surface definitions
mesh = abaqus_read_mesh("model.inp")
# Check available surfaces
println("Available surfaces: ", keys(mesh["surface_sets"]))
# Create surface elements for a named surface
surface_elems = create_surface_elements(mesh, "LOAD_SURFACE")
# Extract unique nodes on the surface
surface_nodes = Set{Int}()
for (elem_type, connectivity) in surface_elems
union!(surface_nodes, connectivity)
end
println("Surface has $(length(surface_nodes)) unique nodes")
# Get coordinates of surface nodes
surface_coords = [mesh["nodes"][nid] for nid in surface_nodes]
# Apply boundary conditions to surface nodes
for node_id in surface_nodes
# Apply BC at node_id...
endSurface Element Types
Depending on the parent volume element type and face, surface elements can be:
:Tri3- 3-node triangle (from tet faces, wedge faces):Tri6- 6-node triangle (from quadratic tet faces):Quad4- 4-node quadrilateral (from hex faces, wedge faces):Quad8- 8-node quadrilateral (from quadratic hex faces)
See Also
abaqus_read_mesh: Read mesh data containing surface definitionsabaqus_read_model: Read complete model with surfaces
Notes
- Surface must exist in
mesh["surface_sets"]or an error will be thrown - The parent elements referenced in the surface definition must exist in the mesh
- Each (element, face) pair generates one surface element
- Useful for extracting boundary nodes for applying loads or boundary conditions
AbaqusReader.abaqus_download — Function
abaqus_download(model_name, env=ENV; dryrun=false) -> StringDownload an ABAQUS example model from a remote repository.
This utility function downloads example ABAQUS input files for testing and learning purposes. It requires environment variables to be set for specifying the download URL and destination.
Arguments
model_name: Name of the model file to download (e.g.,"piston_ring_2d.inp")env: Environment dictionary (defaults toENV)dryrun::Bool: Iftrue, skip actual download (for testing)
Returns
String: Full path to the downloaded file- Returns path immediately if file already exists locally
Required Environment Variables
ABAQUS_DOWNLOAD_URL: Base URL for downloading models- Example:
"https://example.com/models" - The model file will be fetched from
$ABAQUS_DOWNLOAD_URL/$model_name
- Example:
Optional Environment Variables
ABAQUS_DOWNLOAD_DIR: Directory where files will be saved- Defaults to current directory if not set
- Will create directory if it doesn't exist
Examples
using AbaqusReader
# Set up environment variables
ENV["ABAQUS_DOWNLOAD_URL"] = "https://example.com/abaqus/models"
ENV["ABAQUS_DOWNLOAD_DIR"] = "/path/to/models"
# Download a model
filepath = abaqus_download("piston_ring_2d.inp")
# Use the downloaded file
mesh = abaqus_read_mesh(filepath)Errors
Throws an error if:
ABAQUS_DOWNLOAD_URLis not set and file doesn't exist locally- Download fails (network error, file not found, etc.)
Notes
- Files are only downloaded once; subsequent calls return the existing file path
- Useful for testing, tutorials, and reproducible examples
- Check the AbaqusReader repository for available example models