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 : dict

  • materials : 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. By default, each part is instantiated once in the *ASSEMBLY section.

Per-part configuration fields:

  • mesh : Mesh or HybridMesh instance

  • sets :

    • "all" → export all node and element sets (default)

    • None or [] → export no sets

    • list[str] → export only the named sets

  • eltype :

    • str → single Abaqus element type for the entire mesh

    • list[str] → per-block element types (HybridMesh only)

    • dict {elset: eltype} → per-zone element types via element sets

    If eltype is omitted, a default mapping is applied:

    HelloTriangle type

    Abaqus type

    line2

    B31

    tri3

    S3

    quad4

    S4

    tet4

    C3D4

    hex8

    C3D8

    wedge6

    C3D6

  • material : material name (str) or dict keyed by element sets

  • section : section name (str) or dict keyed by element sets

  • extra : optional raw Abaqus snippet injected at part level

Note

  • HybridMesh supports multiple element blocks. You may specify a list of Abaqus element types (one per block) or map element sets to element types.

  • If section is a single string but material is a dict, the section definition is automatically expanded per material zone.

  • All nodes are always written to a global Nall node set.

  • All elements are always written to a global Eall element set.

Assembly#

The Abaqus *ASSEMBLY section is written by default. It can be disabled when the exported parts are intended to be used without an assembly, for example when the generated input file is included in another Abaqus input file.

The assembly dictionary supports:

  • enabled : True or False (default: True); controls whether the *ASSEMBLY and *INSTANCE blocks are written.

  • extra : optional raw Abaqus snippet injected at assembly level.

When the assembly is disabled, boundary-condition targets refer directly to the exported sets rather than to instance-qualified sets.

Materials and sections#

Materials#

Material dictionary fields:

  • type : "elastic"

  • parameters : material parameters:

    • E : Young’s modulus

    • nu : Poisson’s ratio

    • rho : 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 sections

  • extra : 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 : if True, BCs in this step are written with OP=NEW and 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 : True or False (controls NLGEOM=NO/YES)

  • initial_increment : initial increment (static only)

  • min_increment : minimum increment (static only)

  • max_increment : maximum increment

  • extra : 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:

  • fixed

  • displacement

  • velocity

  • acceleration

BC dictionary fields:

  • target : dict with:

    • mesh : mesh name

    • set : node set name

  • dofs : list of DOF indices (0-based)

    • 0 = X

    • 1 = Y

    • 2 = Z

    • 3 = Rx

    • 4 = Ry

    • 5 = Rz

    Defaults to all DOFs.

  • values : single value or list matching the number of DOFs

  • amplitude : optional amplitude name

  • step : 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")