Examples#

Here are a series of examples using MAPDL with ansys-mapdl-core.

Full Examples Using PyMAPDL#

These examples demonstrate full examples using the PyMAPDL module.

MAPDL 2D Plane Stress Concentration Analysis

MAPDL 2D Plane Stress Concentration Analysis

MAPDL 2D Plane Stress Concentration Analysis
2D Pressure Vessel

2D Pressure Vessel

2D Pressure Vessel
3D Stress Concentration Analysis for a Notched Plate

3D Stress Concentration Analysis for a Notched Plate

3D Stress Concentration Analysis for a Notched Plate
Basic Thermal Analysis with pyMAPDL

Basic Thermal Analysis with pyMAPDL

Basic Thermal Analysis with pyMAPDL
Contact Element Example

Contact Element Example

Contact Element Example
Cyclic Analysis

Cyclic Analysis

Cyclic Analysis
Thermal-structural analysis of exhaust manifold

Thermal-structural analysis of exhaust manifold

Thermal-structural analysis of exhaust manifold
Plotting and Mesh Access

Plotting and Mesh Access

Plotting and Mesh Access
Structural Analysis of a Lathe Cutter

Structural Analysis of a Lathe Cutter

Structural Analysis of a Lathe Cutter
MAPDL 3D Beam Example

MAPDL 3D Beam Example

MAPDL 3D Beam Example
MAPDL 2D Beam Example

MAPDL 2D Beam Example

MAPDL 2D Beam Example
Path Operations within pyMAPDL and MAPDL

Path Operations within pyMAPDL and MAPDL

Path Operations within pyMAPDL and MAPDL
Pressure Vessel

Pressure Vessel

Pressure Vessel
PyVista Mesh Integration

PyVista Mesh Integration

PyVista Mesh Integration
Example Thermal Transient Analysis

Example Thermal Transient Analysis

Example Thermal Transient Analysis

PyMAPDL Math Examples#

These examples demonstrate using APDL Math from the PyMAPDL library.

PyMAPDL APDLMath Basic Operations

PyMAPDL APDLMath Basic Operations

PyMAPDL APDLMath Basic Operations
Using APDLMath to solve Eigenproblems

Using APDLMath to solve Eigenproblems

Using APDLMath to solve Eigenproblems
Binary MAPDL File Explorer

Binary MAPDL File Explorer

Binary MAPDL File Explorer
Compute Eigenvalues using MAPDL or SciPy

Compute Eigenvalues using MAPDL or SciPy

Compute Eigenvalues using MAPDL or SciPy
APDLMath Sparse Matrices and SciPy Sparse Matrices

APDLMath Sparse Matrices and SciPy Sparse Matrices

APDLMath Sparse Matrices and SciPy Sparse Matrices
Use APDLMath to Solve a Dense Matrix Linear System

Use APDLMath to Solve a Dense Matrix Linear System

Use APDLMath to Solve a Dense Matrix Linear System
Performing Sparse Factorization and Solve Operations

Performing Sparse Factorization and Solve Operations

Performing Sparse Factorization and Solve Operations
Manipulate APDLMath vectors or dense matrices as NumPy Arrays

Manipulate APDLMath vectors or dense matrices as NumPy Arrays

Manipulate APDLMath vectors or dense matrices as NumPy Arrays

Geometry Examples#

These examples demonstrate using PyMAPDL to create basic geometry.

Keypoints

Keypoints

Keypoints
Lines

Lines

Lines
Areas

Areas

Areas
Volumes

Volumes

Volumes
Primitives

Primitives

Primitives

Miscellaneous Examples#

These examples demonstrate miscellaneous tips and tricks for using PyMAPDL.

Adding a New Gallery Example

Adding a New Gallery Example

Adding a New Gallery Example
MAPDL Element Size Transition Example

MAPDL Element Size Transition Example

MAPDL Element Size Transition Example
Using Inline Functions (Query)

Using Inline Functions (Query)

Using Inline Functions (Query)
Generating and Extracting Rotational Displacement

Generating and Extracting Rotational Displacement

Generating and Extracting Rotational Displacement

Academic Finite Element Examples#

These examples demonstrate finite element method as applicable to Python and MAPDL while emphasising Python libaries such as matplotlib

Build a Finite Element

Build a Finite Element

Build a Finite Element

Verification Manual Examples#

This section demonstrates a range of Mechanical APDL elements and capabilities in straightforward problems which have “classical” or readily-obtainable theoretical solutions using PyMAPDL.

These problems may then serve as the basis for additional validation and qualification of Mechanical APDL capabilities for specific applications that may be of interest.

Statically Indeterminate Reaction Force Analysis

Statically Indeterminate Reaction Force Analysis

Statically Indeterminate Reaction Force Analysis
Beam Stresses and Deflections

Beam Stresses and Deflections

Beam Stresses and Deflections
Thermally Loaded Support Structure

Thermally Loaded Support Structure

Thermally Loaded Support Structure
Deflection of a Hinged Support

Deflection of a Hinged Support

Deflection of a Hinged Support
Statically Indeterminate Reaction Force Analysis

Statically Indeterminate Reaction Force Analysis

Statically Indeterminate Reaction Force Analysis
Pinched Cylinder

Pinched Cylinder

Pinched Cylinder
Plastic Compression of a Pipe Assembly

Plastic Compression of a Pipe Assembly

Plastic Compression of a Pipe Assembly
Parametric Calculation

Parametric Calculation

Parametric Calculation
Large Lateral Deflection of Unequal Stiffness Springs

Large Lateral Deflection of Unequal Stiffness Springs

Large Lateral Deflection of Unequal Stiffness Springs
Bending of a Tee-Shaped Beam

Bending of a Tee-Shaped Beam

Bending of a Tee-Shaped Beam

Gallery generated by Sphinx-Gallery

Technology Showcase Manual Examples#

This section demonstrates the broad simulation capabilities of Ansys Mechanical APDL. The problems demonstrate how to use PyMAPDL to effectively and accurately solve interdisciplinary problems from a variety of industries and engineering fields.

These examples are a work-in-progress and will be extended during the life of this project.

Name

Description

Brake Squeal Analysis

Technology showcase demonstration example 01: Brake Squeal Analysis.

Dynamic simulation of a printed circuit board assembly

Technology showcase demonstration example 20: Dynamic simulation of a printed circuit board assembly

Friction Stir Welding (FSW) Simulation

Technology showcase demonstration example 28: Friction Stir Welding (FSW) Simulation

Extended Examples#

These extended examples aim to explain other concepts such as interoperability with other programs, libraries, and features in development.

These examples are a work-in-progress and will be extended during the life of this project.

Name

Description

Cart-Pole Simulation

Demonstrates a reinforcement machine learning example using MAPDL through PyMAPDL.

Gmsh Example

Demonstrates the interoperability between PyMAPDL and the gmsh meshing library.

UPF in PyMAPDL

Demonstrates the interoperability between MAPDL user programmable functions and Python.

Download Example Files#

Each example should contain all the necessary resources to run the example. However in some cases, external files are needed. A link to those files is available at each example page. These links refers to the following GitHub repository where you can find all of them:

GitHub Example Data Repository

If you find out a missing or broken link, please open an issue in Github (PyMAPDL Issues) or email us at PyAnsys Support.