Skip to main content

socket-bridge

Connect to Abaqus CAE via socket bridge for curing simulation. Invoke when user needs to use socket bridge, connect to Abaqus, or execute Python in Abaqus kernel.

Informations de source

Dépôt
Cai-aa/CAE-Agent-Hub
Dernière activité de la source
28 septembre 2026 à 07:48
Langue détectée de SKILL.md
anglais
Étoiles
1 241
Forks
159

Options d'installation

Le prompt qui vérifie d'abord la source est sélectionné par défaut. Vous pouvez passer à une commande directe ou télécharger une copie locale.

Vérifiez les fichiers source

Lisez SKILL.md et les fichiers associés affichés par SkillsMP avant de décider de l'installer.

Affichage de SKILL.md

SKILL.md
Instructions source · Aperçu en lecture seule
name
socket-bridge
description
Connect to Abaqus CAE via socket bridge for curing simulation. Invoke when user needs to use socket bridge, connect to Abaqus, or execute Python in Abaqus kernel.
# Socket Bridge Connection ## Description Connect to Abaqus CAE via socket bridge for curing simulation. Invoke when user needs to use socket bridge, connect to Abaqus, or execute Python in Abaqus kernel. ## Content ### Socket Bridge Overview The socket bridge provides a TCP connection to Abaqus CAE at `127.0.0.1:48152`, allowing remote execution of Python code in the Abaqus kernel. ### Prerequisites - Abaqus CAE must be open and running - The socket bridge plugin must be active in Abaqus ### Connection Check Use the `check_abaqus_connection` MCP tool to verify the bridge status before executing any commands. ### Available MCP Tools | Tool | Description | |------|-------------| | `check_abaqus_connection` | Verify bridge connection status | | `run_python` | Execute Python code in Abaqus kernel | | `submit_job` | Submit a job and wait for completion | | `monitor_job_status` | Check .sta/.msg file diagnostics | | `inspect_odb` | Read ODB results and field outputs | | `set_workdir` | Set the working directory | | `list_jobs` | List existing jobs in the session | ### run_python Usage When using `run_python`, set the `result` variable to return data back to the caller: ```python # Example: get list of steps result = [] for step_name in odb.steps.keys(): result.append(step_name) ``` ### Abaqus Python Environment Quirks The Abaqus Python environment has several important quirks to be aware of: #### Python Version - Abaqus 2020+ uses Python 2.7 based environment - Do not use Python 3 specific syntax #### Unicode Issues - `print()` statements with unicode may cause errors - Use `result = ...` to return data instead of printing #### Imports - Must import constants: `from abaqusConstants import *` - This provides access to all Abaqus constants (OFF, ON, RUNNING, etc.) #### String Formatting - Use the `%` operator for string formatting - Do NOT use `.format()` or f-strings (not supported in Python 2.7) ```python # Correct text = '%d nodes found' % node_count # Incorrect (will fail) text = '{} nodes found'.format(node_count) text = f'{node_count} nodes found' ``` #### Dictionary Keys - Plain strings work reliably as dictionary keys - Unicode keys may fail in some operations ### Standard Workflow 1. **Check connection:** Use `check_abaqus_connection` to verify bridge is active 2. **Set working directory:** Use `set_workdir` to configure the work directory 3. **Create jobs:** Use `run_python` to create jobs from input files 4. **Submit jobs:** Use `submit_job` or `run_python` with `submit()` 5. **Monitor:** Use `monitor_job_status` to check for errors or convergence issues 6. **Copy ODB:** Copy the ODB file from scratch to work directory 7. **Extract data:** Use `inspect_odb` or `run_python` to read results
Voir sur GitHub