Python and Other Scripts

Enhance and supplement FRANC3D capabilities.
💡 Using AI to automate your workflows? You can use our AI Prompt Guide for optimized system instructions, copy-paste recipes, and structural context templates to use with ChatGPT, Claude, etc when writing your PyF3D scripts.

Script Library

Python, APDL, and shell scripts are provided below as examples; they will need to be edited or modified for your site. If you need assistance with the FRANC3D Python interface, send us email.

The command line and Python interface are described in the FRANC3D V9.2 Command Language & Python Extensions manual.

Tutorials 9 and 15 both use Python scripts. Appendix B of the FRANC3D/ANSYS Tutorial shows how to use Python to edit the output file from FRANC3D prior to FE analysis. Section 15 of the Users Guide shows how to use Python to extend FRANC3D capabilities.

FRANC3D Automation

Automating crack insertion, crack growth, and FRANC3D data operations.

5 scripts
01

Insert & Grow a Crack — ABAQUS

PythonABAQUS

Automates insertion and growth of a single crack in a cube using ABAQUS as the FEA code.

python.exe cube_crack_insert_grow.py
02

Insert & Grow Cracks — ANSYS

PythonANSYS

Automates insertion and growth of a family of single cracks in a cube using ANSYS as the FEA code.

python.exe insert_grow_loop.py
03

3D Vector Class

PythonFRANC3D

Python class for 3D vectors used in various Python scripts. Vec3D.pyd, bundled with FRANC3D, can also be used.

Vec3D.py
04

SIF History Extraction

PythonFRANC3D

Extracts SIFs from a .fcg file at the nearest next point to create a SIF history.

python.exe path.py -nearest_path 0.5 manu_s10.fcg

FEA Pre/Post Processing

Utilities for preparing and extracting data from finite-element models.

6 scripts
06

ABAQUS Contact Results

PythonABAQUS

Extracts ABAQUS contact results for fretting analysis. A .dtp file is created using the ABAQUS Python interface.

ABAQUS Python interface → .dtp
07

ANSYS Contact Results

APDLANSYS

Extracts ANSYS contact results for fretting. A .dtp file is created using the ANSYS APDL interface; run in the ANSYS GUI.

ANSYS APDL → .dtp
09

Edit ABAQUS .inp File

PythonABAQUS

Edits an ABAQUS .inp file before analysis.

python.exe editAbaqusInp.py file_name.inp
10

Edit ANSYS .cdb File

PythonANSYS

Edits an ANSYS .cdb file before analysis.

python.exe editAnsysCdb.py file_name.cdb
11

Nastran Displacement Extraction

PythonNASTRAN

Extracts template node displacements using .fdb and .pch files.

python.exe NastranPchToDtp.py -fdb fn.fdb -pch fn.pch -dtp fn.dtp
15

ABAQUS Stress → DTP

PythonABAQUS

Extracts stress from an ABAQUS odb file to a .dtp file. This script is generated by FRANC3D when using an odb file for crack face tractions.

ABAQUS .odb → .dtp

File & Data Conversion

Scripts for moving FRANC3D and SIF data into other formats.

2 scripts
08

CRK → STL Converter

PythonFRANC3D

Converts a FRANC3D .crk file to an .stl file.

python.exe f3d_crk_to_stl.py < crack.crk > crack.stl
14

SIF Data → Excel

PythonExcel

Writes .sif file data into an Excel file. Uses a surface crack in a cube with 5 load steps and 6 crack growth steps; uses save_sifs.py and sifs_excel.py.

save_sifs.py + sifs_excel.py

Batch & Cluster Execution

Shell-script templates for running FEA codes from FRANC3D and on clusters.

2 scripts
12

SGE Cluster Submission

BashLinux / SGE

Template for a bash shell script to submit to an SGE cluster. Replace the ANSYS executable command in FRANC3D with the shell script name.

FRANC3D → shell script → SGE
13

Run ABAQUS from FRANC3D

BashABAQUS

Bash shell script to execute ABAQUS from FRANC3D. Replace the ABAQUS executable command in FRANC3D with the shell script name.

FRANC3D → shell script → ABAQUS