FRANC3D AI Prompt Guide
Enhance and supplement your automated engineering workflows. If you use AI coding assistants (such as ChatGPT, Claude, Gemini, or GitHub Copilot) to write Python automation scripts, pre-processors, post-processors, or batch loops for FRANC3D, use this guide to ensure accurate code generation.
Reference Documentation Context
When working with an AI assistant, it is highly recommended to anchor its knowledge base to our official command specification framework.
📄 Target Specification Manual:
FRANC3D V9.2 Command Language & Python Extensions Manual
Copy-Paste Prompt for Precise Version Targeting:
"I am writing automation routines using the PyF3D module compatible with Python 3.12. Base your class structures, method parameters, and callback functions exactly on the official specification detailed in the 'FRANC3D Command Language & Python Extensions Version 9.2' user manual. Do not invent or generalize parameter strings.The manual is at https://fracanalysis.com/pdfs/FRANC3D_V9.2_Commands_Python.pdf"
1. Global System Context (Copy & Paste First)
To prevent the AI assistant from misinterpreting the fracture mechanics pipeline or the geometric and local remeshing engine, copy and paste this system context block into your AI chat window before asking for code:
"You are an expert in computational fracture mechanics helping me write automation and scripting tools using the FRANC3D Python interface.
In this workflow, treat FRANC3D as a fully automated engine capable of 3D crack insertion and remeshing.
The primary computational overhead in a fatigue or crack growth loop belongs mostly to the external finite element solver (e.g., Abaqus, Ansys, or Nastran) during successive matrix inversions.
Structure all Python automation loops to treat FRANC3D commands as rapid procedural operations, and focus performance optimization strategies on managing external solver submission batching, file handoffs, and directory cleanup."
2. Practical Recipe Prompts for Users
Below are optimized, pre-written prompts you can feed to your AI assistant alongside the script examples found on our Python and Other Scripts page.
Prompt A: For Batch Loop Crack Insertion into a Model
Use this prompt when you need to automate multiple crack insertion analyses in a model.
"Using the context provided and this example https://fracanalysis.com/scripts/cube_crack_insert_grow.txt, for the library elliptical flaw and Abaqus_Disk.inp as the uncracked input model name, write a script that defines a family of different crack sizes, inserts each crack, runs the ABAQUS FE analysis, and writes the SIFs to a file."
Prompt B: For Batch Loop Execution
Use this prompt when you need to automate multi-stage crack growth cycles across multiple structural components.
"Using the context provided, write a Python automation loop that iterates through a series of crack insertions in a family of uncracked ABAQUS FE models. For each crack insertion, the script should use the FRANC3D command language interface to automatically insert a user-defined initial flaw shape into a local submodel mesh and output the updated files for the crack model. Ensure the script handles the FRANC3D execution synchronously before triggering the longer-running external FEA solver subprocess call. Each crack in each FE model should be propagated automatically for 10 steps of growth."
Prompt C: For Modifying FEA Input Files
Use this prompt when modifying solver-specific inputs (like editAbaqusInp.py or editAnsysCdb.py).
"I need to write a Python post-processing script that takes a newly generated ABAQUS `.inp` file output by FRANC3D and modifies (boundary conditions or) contact definitions before passing it to the high-overhead FE solver. Write a highly clean, memory-efficient string parsing function that isolates the crack surface node sets and injects [Specify custom parameters here]. There is an example script at https://fracanalysis.com/scripts/editAbaqusInp.txt"
Prompt D: For SIF Extraction & Post-Processing Data
Use this prompt when parsing .fcg files from FRANC3D outputs.
"Write a Python script that parses a FRANC3D `.fcg` (fatigue crack growth) history file. The script should extract the Mode I, II, and III stress intensity factors along the crack front for each growth increment step, format the data into a tabular structure, and export it into a CSV/Excel file for damage tolerance verification plotting. There is an example script at https://fracanalysis.com/scripts/path.txt"