Advanced Fracture Mechanics & 3D Crack Growth Simulation
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.
"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)
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 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."
This is a ChatGPT generated script, given sufficient prompts and information, for the ABAQUS tutorial cube.
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"
Use this prompt when configuring FRANC3D to run finite element analyses on an HPC cluster.
Advanced
This prompt is designed to be adapted to each customer's scheduler, solver, software environment, and cluster policies.
Copy the prompt below into your AI assistant
“I want to configure FRANC3D to submit finite element analyses to an HPC compute cluster rather than running the FEA solver directly on the machine where FRANC3D is running.
FRANC3D will run on a cluster login node. Create a solution using shell scripts or other appropriate scripting tools that allows FRANC3D to submit an FEA analysis to the cluster scheduler and execute the solver on an allocated compute node.
The solution should follow these general requirements:
FRANC3D interface: Create a wrapper script that can be configured as the FEA solver executable in FRANC3D. The wrapper must accept and interpret the command-line arguments supplied by FRANC3D, including the analysis job name and any solver-specific options.
Cluster submission: Submit the FEA analysis using the scheduler appropriate for my environment, which may be SLURM, PBS, SGE, LSF, or another system. Do not assume a particular scheduler or invent scheduler commands.
Compute-node execution: Create a separate job script that executes the FEA solver on the allocated compute node. Account for resource allocation, solver environment, licensing requirements, and any necessary module loading.
Synchronous execution: The wrapper must wait until the submitted FEA analysis has finished before returning control to FRANC3D. Do not assume that submitting a job means that it has completed. Properly detect successful completion, solver errors, scheduler failures, and job termination.
Post-processing: After the FEA analysis completes successfully, execute the required post-processing routines to extract the results needed by FRANC3D. For example, an ABAQUS Python script may read the ODB file and generate the FRANC3D .dtp results file. Post-processing may run on the login node or a compute node, depending on software availability, licensing, and cluster configuration. Ensure all required result files are available to FRANC3D before the wrapper exits.
File management: Ensure solver input files, output files, and post-processing files are accessible between login and compute nodes. Account for shared filesystems, working directories, file transfers, and cleanup of temporary files.
Error handling: Return an appropriate exit status to FRANC3D if the solver fails, the scheduler terminates the job, or post-processing fails. Do not allow FRANC3D to continue using incomplete or invalid results.
Maintainability: Keep scheduler-specific settings, resource requirements (CPU count, memory, wall time, etc.), solver configuration, and file locations easy to modify without requiring changes to the main wrapper logic.
Before writing the scripts, ask me about my HPC environment, including the scheduler, operating system, FEA solver and version, solver installation, licensing configuration, available filesystems, and resource requirements. Do not assume these details.
Design the solution so that FRANC3D can continue using its normal analysis workflow without requiring modifications to FRANC3D itself or its Python automation routines. The cluster submission mechanism should be transparent to FRANC3D, behaving like a synchronous local FEA solver execution.”
Example implementations may use a particular solver and scheduler. Treat them as starting points, not as requirements for every HPC system.