Using Ansys Scripting with pyMAPDL, pyDPF-Post, and More – Part 3: Creating Your Own Finite Element Solutions With Python

Ansys Scripting - PADT - Your own FE Solver
Categories:

Verifying A Stiffness Matrix from Ansys Mechanical in Ansys Scripting with python

The most popular posts in 2022 were Part 1 and Part 2 of Alex’s Grishin’s “Using Ansys Scripting with pyMAPDL, pyDPF-Post, and More” series. And he is starting 2023 off with Part 3, where he gets into looking at and solving a stiffness matrix in python.

Ansys Scripting - PADT - Your own FE Solver, Figure 1

In Part 1, he shared how to:

  1. Build models in Ansys Mechanical
  2. Programmatically control solving the model in Ansys MAPDL
  3. Extract the stiffness matrix and load vectors
  4. Post-process the displacement and stress solution in Python

In Part 2 of his series, he goes through the following steps:

  1. Build models in Ansys Mechanical
  2. Programmatically control solving the model in Python
  3. Look at the Degree of Freedom ordering in the Ansys solver
  4. Post-process the displacement and stress solution in Python

In this post, Part 3, he covers:

  1. How to export the stiffness matrix and loads from an Ansys Mechanical model
  2. Reading the matrix into python
  3. Verify the matrix with your own Finite Element (FE) solver
  4. Looks at the ill-conditioned nature of the test problem matrix he discovered in Part 2.
  5. How to create stress and displacement plots

The point of this last bit of scripting is to provide a tool that lets you double-check and better understand the stiffness matrix and solution from the Ansys solvers using your own FE code. But at the same time, it does show you how to do your own FEA solver in python, which is pretty cool.

The tutorial uses the same NAFEMS challenge problem and the same Ansys mechanical model.

Here is the PDF for the tutorial:

Here is a zip file with all the scripts:

Here is a zip file with the Ansys Mechanical Database:

Ansys Scripting - PADT - Your own FE Solver, Figure 2

We hope that you find these three tutorials useful and can use them to explore your own applications using Ansys scripting or to understand the math behind FEA better. And don’t forget, if you are interested in having PADT help you with Ansys scripting, contact us and let’s talk.

Ansys Scripting - PADT - Your own FE Solver, Figure 3
Categories

Get Your Ansys Products & Support from the Engineers who Contribute to this Blog.

Technical Expertise to Enable your Additive Manufacturing Success.

PADT’s Pulse Newsletter

Keep up to date on what is going on at PADT by subscribing to our newsletter.


By submitting this form, you are consenting to receive marketing emails from: . You can revoke your consent to receive emails at any time by using the SafeUnsubscribe® link, found at the bottom of every email. Emails are serviced by Constant Contact

Share this post:

Upcoming Events

04/24/2024

Experience Stratasys Truck Tour: Houston, TX

05/07/2024

Experience Stratasys Truck Tour: Albuquerque, NM

05/07/2024

Dynamic Simulation for Rocket Propellant Systems! - Webinar

05/08/2024

Fluent Materials Processing Updates in Ansys 2024 R1 - Webinar

05/13/2024

Experience Stratasys Truck Tour: Tempe, AZ

05/14/2024

Simulation World 2024

05/15/2024

Simulation World 2024

05/16/2024

Simulation World 2024

05/22/2024

Optics Updates in Ansys 2024 R1 - Webinar

06/12/2024

Connect Updates in Ansys 2024 R1 - Webinar

06/26/2024

Structures Updates in Ansys 2024 R1 (3) - Webinar

06/27/2024

E-Mobility and Clean Energy Summit

07/10/2024

Fluids Updates in Ansys 2024 R1 - Webinar

08/05/2024

2024 CEO Leadership Retreat

10/23/2024

PADT30 | Nerdtoberfest 2024

Search in PADT site

Contact Us

Most of our customers receive their support over the phone or via email. Customers who are close by can also set up a face-to-face appointment with one of our engineers.

For most locations, simply contact us: