Abaqus exporter#
Overview#
HelloTriangle provides functionality to export meshes and simulation setups
to Abaqus .inp files. Supported features include:
Single or multiple meshes (
Mesh/HybridMesh)Node and element sets
Materials and sections (per-part or per-zone)
Steps, boundary conditions (BCs), and amplitudes
Solver settings with increment control
Raw Abaqus snippet injection at part, material, section, assembly, model, or step level
Note
One instance per part is supported; element and node numbering is local to each part.
More advanced Abaqus features (e.g., interactions) must be provided via raw snippets.
Simulation setup dictionary#
The high-level user API is:
save_simulation(simulation_setup, "myinputfile.inp")
The simulation_setup dictionary may contain the following top-level keys:
meshes: dictmaterials: dict (optional)sections: dict (optional)assembly: dict (optional)model: dict (optional)amplitudes: dict (optional)BCs: dict (optional)steps: dict (optional)solver: dict (optional)
Meshes and parts#
Each mesh is exported as an Abaqus *PART and instantiated once in the
*ASSEMBLY.
Per-part configuration fields:
mesh:MeshorHybridMeshinstancesets:"all"→ export all node and element sets (default)Noneor[]→ export no setslist[str]→ export only the named sets
eltype:str→ single Abaqus element type for the entire meshlist[str]→ per-block element types (HybridMesh only)dict {elset: eltype}→ per-zone element types via element sets
If
eltypeis omitted, a default mapping is applied:HelloTriangle type
Abaqus type
line2B31tri3S3quad4S4tet4C3D4hex8C3D8wedge6C3D6material: material name (str) ordictkeyed by element setssection: section name (str) ordictkeyed by element setsextra: optional raw Abaqus snippet injected at part level
Note
HybridMeshsupports multiple element blocks. You may specify a list of Abaqus element types (one per block) or map element sets to element types.If
sectionis a single string butmaterialis a dict, the section definition is automatically expanded per material zone.All nodes are always written to a global
Nallnode set.All elements are always written to a global
Eallelement set.
Materials and sections#
Materials#
Material dictionary fields:
type:"elastic"parameters: material parameters:E: Young’s modulusnu: Poisson’s ratiorho: density (optional)
extra: optional raw Abaqus snippet
Only type elastic is supported for now, but other materials can be written using the extra key.
Sections#
Section dictionary fields:
type:"solid","shell", or"surface"thickness: required for shell sectionsextra: optional raw Abaqus snippet
Steps and solver#
Steps#
Each step defines a single Abaqus analysis step.
Step dictionary fields:
time: step duration (default:1.0)reset_BCs: ifTrue, BCs in this step are written withOP=NEWand all previously defined BCs are inactive.extra: optional raw Abaqus snippet injected at the end of the step
Solver#
Solver settings currently apply to all steps.
Solver dictionary fields:
type:"static"or"dynamic_explicit"linear:TrueorFalse(controlsNLGEOM=NO/YES)initial_increment: initial increment (static only)min_increment: minimum increment (static only)max_increment: maximum incrementextra: optional raw Abaqus snippet injected after the solver keyword
Increment control#
For a static solver, the following line is written:
*STATIC
initial, total_time, min, max
If a value is not provided, it is left empty and Abaqus defaults apply.
Boundary conditions#
Supported BC types:
fixeddisplacementvelocityacceleration
BC dictionary fields:
target: dict with:mesh: mesh nameset: node set name
dofs: list of DOF indices (0-based)0= X1= Y2= Z3= Rx4= Ry5= Rz
Defaults to all DOFs.
values: single value or list matching the number of DOFsamplitude: optional amplitude namestep: name of the step in which the BC is activated
Boundary conditions remain active in subsequent steps unless a later step sets
reset_BCs to True.
Amplitudes#
Tabular amplitudes are supported.
Amplitude fields:
values: list of[time, value]pairs
Amplitudes are defined using the total time (TIME=TOTAL TIME).
Example: Cantilever beam with contact#
import numpy as np
cube = shapes.rectangle(div=[10, 4], dim=[10, 1], eltype="quad4")
fixed = np.where(np.isclose(cube.coords[:, 0], 0.0))[0]
cube.add_set(fixed, name="fixed")
sphere = shapes.sphere(long_div=18, lat_div=9).translate([9.0, 0.5, 1.5])
simulation_setup = {
"meshes": {
"beam": {
"mesh": cube,
"eltype": "S4",
"material": "STEEL",
"section": "beam_shell_sec",
},
"sphere": {
"mesh": sphere,
"eltype": "SFM3D3",
"section": "surf_sec",
},
},
"materials": {
"STEEL": {
"type": "elastic",
"parameters": {"E": 210e9, "nu": 0.3, "rho": 7800},
},
},
"sections": {
"beam_shell_sec": {"type": "shell", "thickness": 0.4},
"surf_sec": {"type": "surface"},
},
"model": {
"extra": (
"*Surface Interaction, name=IntProp-1\n"
"1.,\n"
"*Surface Behavior, pressure-overclosure=HARD\n"
"*Contact\n"
"*Contact Inclusions, ALL EXTERIOR\n"
"*Contact Property Assignment\n"
" , , IntProp-1"
)
},
"BCs": {
"bc_beam_fixed": {
"type": "fixed",
"target": {"mesh": "beam", "set": "fixed"},
"step": "Step-1",
},
"bc_sphere_disp": {
"type": "displacement",
"target": {"mesh": "sphere", "set": "Nall"},
"dofs": [0, 1, 2],
"values": [0.0, 0.0, -2.0],
"step": "Step-1",
},
},
"steps": {"Step-1": {"time": 1.0}},
"solver": {
"type": "static",
"linear": False,
"initial_increment": 0.1,
"min_increment": 1e-5,
"max_increment": 0.1,
},
}
save_simulation(simulation_setup, "cantilever_contact.inp")