run_fem_analysis
Run the CalculiX solver on an existing FEM analysis in FreeCAD and obtain summary results including max von Mises stress and displacements.
Instructions
Run the CalculiX solver on an existing Fem::FemAnalysis container and return summary results.
Prerequisites in the document:
A Part-derived solid (e.g. Part::Box, PartDesign::Body) acting as the geometry.
A Fem::AnalysisPython container created via
create_object.A Fem::MaterialCommon assigned to the geometry, added to the analysis.
A Fem::FemMeshGmsh referencing the geometry, added to the analysis (the mesh is generated automatically when created via
create_object).At least one Fem::ConstraintFixed and one Fem::ConstraintForce (or ConstraintPressure) bound to faces of the geometry, added to the analysis.
A SolverCcxTools is auto-created if the analysis has none.
The solver runs synchronously on the FreeCAD GUI thread and blocks all other RPC calls for its duration; do not fan out parallel requests.
Returns max von Mises stress (MPa), max/min displacement (mm), node count, and the working directory CalculiX wrote to. On failure, returns the prerequisite-check or solver error along with the working directory for triage.
Args: doc_name: Name of the FreeCAD document. analysis_name: Name of the Fem::AnalysisPython object. timeout: Seconds to wait for the solver (default 600). include_screenshot: Whether to return a screenshot of the model (default True). Set to False to save tokens when only the numeric results are needed. view_name: The view orientation of the returned screenshot (default "Isometric").
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| doc_name | Yes | ||
| view_name | No | Isometric | |
| analysis_name | Yes | ||
| include_screenshot | No |