SkillAgentSearch skills...

PyNastran

A Python-based interface tool for Nastran's file formats

Install / Use

/learn @SteveDoyle2/PyNastran
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Main/dev: Documentation Status Linux Status Coverage Status

See the Installation Instructions for instructions on installing pyNastran.

<!--- [![Discord](https://img.shields.io/badge/help_forum-discourse-blue.svg)](https://discord.gg/s8RfSkZDHA) .. |DiscourseBadge| image:: https://img.shields.io/badge/help_forum-discourse-blue.svg .. _DiscourseBadge: https://discourse.matplotlib.org --->

v1.4.1

Download GUI (latest is from 2024/3/25)

Also, check out the:

for more detailed information.

Blogs

Code of Conduct

Everyone interacting in the setuptools project’s codebase, issue trackers, chat room/Discord, and mailing lists is expected to follow the Code of Conduct.

<!--- [![Windows Status](https://ci.appveyor.com/api/projects/status/1qau107h43mbgghi/branch/main?svg=true)](https://ci.appveyor.com/project/SteveDoyle2/pynastran) [![codecov](https://codecov.io/gh/SteveDoyle2/pyNastran/branch/main/graph/badge.svg)](https://codecov.io/gh/SteveDoyle2/pyNastran) [![Coverage Status](https://img.shields.io/coveralls/SteveDoyle2/pyNastran/main.svg)](https://coveralls.io/github/SteveDoyle2/pyNastran?branch=main) ---> <!--- <!--- [![Build status](https://ci.appveyor.com/api/projects/status/1qau107h43mbgghi/branch/main?svg=true)](https://ci.appveyor.com/project/SteveDoyle2/pynastran/branch/main) [![Build status](https://ci.appveyor.com/api/projects/status/1qau107h43mbgghi?svg=true)](https://ci.appveyor.com/project/SteveDoyle2/pynastran) [![Build Status](https://travis-ci.org/SteveDoyle2/pyNastran.png)](https://travis-ci.org/SteveDoyle2/pyNastran) [![Coverage Status](https://coveralls.io/repos/github/SteveDoyle2/pyNastran/badge.svg?branch=main)](https://coveralls.io/github/SteveDoyle2/pyNastran?branch=main) [![Requirements Status](https://img.shields.io/requires/github/SteveDoyle2/pyNastran/main.svg)](https://requires.io/github/SteveDoyle2/pyNastran/requirements/?branch=main) | --->

Overview

pyNastran is an interface library to the various Nastran file formats (BDF, OP2, OP4). Using the BDF interface, you can read/edit/write Nastran geometry without worrying about field formatting. Many checks are also performed to verify that your model is correct. Using the OP2 interface, you can read large result files quickly and efficiently. Additionally, you can also extract a subset of the result data and write OP2/F06 result files. For a more detailed list of features, see:

Using the pyNastran GUI, you can read in Nastran models and quickly view results for a model. While it's no FEMAP/Patran, it can replace many tasks that would otherwise require a commercial program.

GUI

News

<!--- I yet again went down a bit of rabbit hole to improve the speed of the BDF, but this time I'm much happier with the results. Still, getting back to parity takes a lot of time and it's not quite there. It does simplify MSC HDF5 integration, so once I've added methods for updating more complicated objects (e.g., PBARL, PCOMP, RBE3), HDF5 will be next. If you want to test it out, it's not included with the official release, but is found in ``pyNastran.dev.bdf_vectorized3``, so not my first attempt :) This should be hidden... ### v1.5.0 has NOT been released (2024/3/25) BDF: - removed axisymmetric cards deprecated in NX (AXIC, AXIF, CCONEAX, PCONEAX, PRESAX, TEMPAX, ...) - added ```bdf run_jobs filename dirname --test``` - added F06: - added gui for flutter post-processing OP2: - added NX trim/flutter tables - added kinetic energy --->

v1.4.1 has been released (2024/3/25)

This is a mainly a bug fix release. There's also a couple of new acoustic cards and MSC's STRESSA table that were added to fix some errors.

The force/bending moment diagrams have also been improved:

  • Loads popup
  • Visuals to indicate the location of the cutting planes
  • Element ids may also be explicitly limited now
  • You can pick the plot x-axis (global x/y/z vs. distance)

See pyNastran release notes for details on the other changes.

v1.4.0 has been released (2024/2/29)

It's been a while since the update, but I've had a more time lately. MSC also provided a copy of MSC Nastran free of charge to help support the project, so modern MSC Nastran support is much better.

Finally, the GUI has received a lot of work recently including:

  • Better results selector. Individual displacment and SPC/MPC/Load Vector components are selectable. For solid, plate, and composite stress/strain, nodal or centroidal stress may be shown and various blending methods including nodal averaging is now supported.
  • Grid Point Forces are supported in the GUI. They take some getting used to but you can march along a vector and output the section loads in any arbitrary coordinate system.
  • Preferences are also now exposed in a json file (vs the registry) and if you find a bug in the new results, you can flip a flag to use the old objects.
  • A recent files history to speed up model loading and a whole bunch of other bug fixes.

Programmatics:

  • Supports Python 3.9 - 3.12 (later versions of Python requires downloading from github)
  • GUI is compatible with VTK 9 and PyQt5/PySide2
  • improved testing of old versions of packages
  • much improve NX 64-bit and OptiStruct support

BDF:

  • fixed CAERO1 paneling bug
  • 427 cards supported (up from 405)

OP2:

  • 20 new results
  • vectorized op2 writing
  • model.cquad4_stress is now found in model.op2_results.stress.cquad4_stress. Same goes for other stress, strain, force, and strain_energy components. This will hopefully make things a bit easier find.

GUI:

  • grid point forces / section cuts / shear-moment torque plotter
  • more dynamic stress/strain results allow for simpler menus
  • transient/complex fringe only animations now supported
  • recent files support
  • greatly expanded preferences menu; many more preferences are saved
  • new icons

See pyNastran release notes for details on the other changes.

v1.3.4 has been released (2022/5/30)

This is a bug fix release mainly to address dependency changes:

Programmatics:

  • supports Python 3.7-3.10
  • support for nptyping 1.1.1-2.0 (removed as a required dependency)
  • support for h5py >3.0
  • GUI is compatible with PyQt5/6 and PySide2/6 and VTK 7-9

There are also at least 33 bugs fixed and a few features added from the 1.4 release (e.g., pathlib support, subcase limiting in the flutter F06 parser).

See pyNastran release notes for details on the other changes.

v1.3.3 (2020/6/28)

See v1.3.3 for information regarding enhancements.

pyNastran v1.3.2 has been released (2020/4/8)

See v1.3.2 for information regarding enhancements.

v1.3.2-v1.3.0 (2020/4/8)

This result has been superseded by 1.3.2. The PyPi page was fixed.

v1.2.1 (2019/5/24)

I keep saying to myself there's not much to add, but Nastran is huge. Beyond HDF5 support in the BDF, I'm a huge fan of the new ability to keep track of which include file a card came from and write it as a separate file. It's limited in usefulness, but very handy in certain cases. There's a new (still preliminary) superelement capability. I'm far from a superelement expert, but it's probably useful.

The OP2 reader now supports SORT2 along with much improved random results reading. If you're using 60+ GB OP2s, you probably have had issues with RAM usage in the past. With the new ability to dump the OP2 directly to HDF5, this should not be an as much of an issue. It's not 100% implemented, so let me know if you

Related Skills

View on GitHub
GitHub Stars448
CategoryDevelopment
Updated2h ago
Forks170

Languages

Python

Security Score

85/100

Audited on Apr 6, 2026

No findings