Python and Other Scripts

Enhance and supplement FRANC3D capabilites.

Overview

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

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 analsysis. Section 15 of the Users Guide shows how to use Python to extend FRANC3D capabilities.


Python script to insert and grow a crack in a cube using ABAQUS as the FEA code.

python.exe cube_crack_insert_grow.py

Download zip File

Python script to insert and grow family of cracks in a cube using ANSYS as the FEA code.

python.exe ses.py

Download zip File

Python class for 3D vectors; this is used in various Python scripts.

Vec3D.pyd, which is bundled with the FRANC3D executable can be used also.

Download Vec3D.py

Python script for SIFs at nearest next point to create a SIF history path from a fcg file.

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

Download zip File

Python script to reverse crack fronts in a .fdg file.

python.exe reverse_first6.py

Download zip File

Python script to extract ABAQUS contact results for fretting.

A .dtp file is created using the ABAQUS Python interface to extract data from the .odb file.

Download Script

ANSYS APDL script to extract ANSYS contact results for fretting

A .dtp file is created using the ANSYS APDL interface to extract data; run in the ANSYS GUI.

Download APDL

Python script to convert FRANC3D .crk file to .stl file.

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

Download Script

Python script to edit ABAQUS .inp file before analyzing.

python.exe editAbaqusInp.py file_name.inp

Download Script

Python script to edit ANSYS .cdb file before analyzing.

python.exe editAnsysCdb.py file_name.cdb

Download Script

Python script to extract template node displacements using .fdb and .pch files.

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

Download Script

Template for a bash shell script to submit to SGE cluster.

Replace the ANSYS executable command in FRANC3D with the shell script name.

Download zip File

Bash shell script to execute ABAQUS from FRANC3D

Replace the ABAQUS executable command in FRANC3D with the shell script name.

Download zip File

Python script to write .sif file data into Excel file (uses xlwt)

Uses a surface crack in a cube with 5 load steps and 6 crack growth steps. The save_sifs.py is used to save the .sif files, and the sifs_excel.py is used to put the SIF data into Excel.

Download zip File