The contexts.py module#
Summary#
Get general simulation workflow guidelines for Mechanical. |
|
Get geometry import guidelines for Mechanical. |
|
Get material definition guidelines for Mechanical. |
|
Get mesh generation guidelines for Mechanical. |
|
Get analysis setup guidelines for Mechanical. |
|
Get boundary condition and load guidelines for Mechanical. |
|
Get solution phase guidelines for Mechanical. |
|
Get postprocessing guidelines for Mechanical. |
|
Get named selection guidelines for Mechanical. |
|
Get general rules and best practices for Mechanical workflows. |
|
Get Mechanical simulation guidelines for a specific topic. |
Description#
Context tools for PyMechanical-MCP.
This module defines MCP tools that provide context and guidance for PyMechanical and Ansys Mechanical workflows. These tools return context information that can be accessed by the LLM to get help with various aspects of Mechanical simulations.
Module detail#
- contexts.get_guidelines_for_workflow_overview() str#
Get general simulation workflow guidelines for Mechanical.
Use this tool when explaining or generating PyMechanical or Ansys Mechanical workflows.
- Returns:
strOverview of the general simulation process for all Mechanical analysis types.
- contexts.get_guidelines_for_geometry_import() str#
Get geometry import guidelines for Mechanical.
Use this tool when explaining or generating geometry import operations.
- Returns:
strGuidelines for importing a geometry in Mechanical.
- contexts.get_guidelines_for_materials() str#
Get material definition guidelines for Mechanical.
Use this tool when explaining or generating material definitions.
- Returns:
strGuidelines for defining and assigning materials in Mechanical.
- contexts.get_guidelines_for_meshing() str#
Get mesh generation guidelines for Mechanical.
Use this tool when explaining or generating mesh operations.
- Returns:
strGuidelines for generating meshes in Mechanical.
- contexts.get_guidelines_for_analysis_setup() str#
Get analysis setup guidelines for Mechanical.
Use this tool when setting up structural, modal, or thermal analyses.
- Returns:
strGuidelines for setting up analyses in Mechanical.
- contexts.get_guidelines_for_boundary_conditions() str#
Get boundary condition and load guidelines for Mechanical.
Use this tool when applying supports, constraints, and loads.
- Returns:
strGuidelines for applying boundary conditions and loads in Mechanical.
- contexts.get_guidelines_for_solution() str#
Get solution phase guidelines for Mechanical.
Use this tool when running solutions in Mechanical.
- Returns:
strGuidelines for solving analyses in Mechanical.
- contexts.get_guidelines_for_postprocessing() str#
Get postprocessing guidelines for Mechanical.
Use this tool when extracting and visualizing results.
- Returns:
strGuidelines for postprocessing in Mechanical.
- contexts.get_guidelines_for_named_selections() str#
Get named selection guidelines for Mechanical.
Use this tool when working with named selections.
- Returns:
strGuidelines for creating and using named selections in Mechanical.
- contexts.get_guidelines_for_general_rules() str#
Get general rules and best practices for Mechanical workflows.
Use this tool when working with Mechanical simulations.
- Returns:
strGeneral rules and best practices for Mechanical simulations.
- contexts.get_guidelines_for(content: GuidelinesContent) str#
Get Mechanical simulation guidelines for a specific topic.
Use this tool before writing PyMechanical or Ansys Mechanical scripting code to retrieve the relevant guidelines for the workflow step you are about to implement. Call it once per topic needed. You should call it before every code-generation task.
- Parameters:
- content
str The guideline topic to retrieve. options are:
"workflow": Mechanical simulation workflow overview."geometry": Geometry import (CAD files, units, and scoping)."materials": Material assignment and engineering data."meshing": Mesh controls, sizing, and quality."analysis_setup": Analysis system creation (such as static structural, modal, or thermal)."boundary_conditions": Supports, constraints, loads (forces, pressures, and temperatures)."solution": Solver configuration and execution."postprocessing": Result objects, evaluation, and exports."named_selections": Creating and using named selections."general": General Mechanical rules and best practices.
- content
- Returns:
strGuideline text for the requested topic.
- contexts.GuidelinesContent#