Skip to main content

NASTRAN-95 finite element analysis with Python wrapper

Project description

nastran95

NASTRAN-95, the NASA Structural Analysis System, as an executable with a Python wrapper.

Run finite element analyses from Python, with results returned as NumPy arrays.

Features

  • Two execution modes: subprocess (robust) or f2py (in-process via fork)
  • Automatic output parsing: displacements, stresses, eigenvalues → NumPy arrays
  • Full NASTRAN-95 capability: all 13 rigid format solution types
  • Simple API: nastran95.run(input_deck) → structured results
  • f2py extension: direct Fortran binding with COMMON block access
  • Compatible with pyNastran for BDF model generation

Quick Start

import nastran95

# Run a static analysis
result = nastran95.run("inp_clean/d01011a.inp")

if result.completed:
    disp = result.displacements[0]
    print(f"Max displacement: {disp.translations.max():.6e}")

See docs/getting-started.md for full documentation.

Installation

Install both the Fortran executable and the Python wrapper using pre-built wheels:

pip install nastran95

Or, if the wheels are not available for your system, build from source (below).

Building

First, build the NASTRAN-95 Fortran binary in the parent directory (requires gfortran):

cd build
make          # compiles ~1850 Fortran sources (~60 seconds)
cd ..

Then install the Python package:

uv sync

Optionally, build the f2py extension for in-process execution:

cd python
uv run python -m nastran95._fortran.build_ext

Testing

uv run pytest python/tests/ -v

Architecture

python/
├── nastran95/
│   ├── __init__.py          # Public API
│   ├── runner.py            # Subprocess & f2py runners
│   ├── parser.py            # F06 output parser
│   ├── models.py            # Result dataclasses
│   └── _fortran/            # f2py extension
│       ├── build_ext.py     # Build script
│       ├── nastran_entry.f   # Fortran wrapper subroutine
│       ├── exit_override.c   # EXIT/STOP interception via fork()
│       └── _nastran_core*.so # Built extension (after build_ext)
├── tests/
│   ├── test_parser.py       # Output parser tests
│   ├── test_runner.py       # Subprocess runner tests
│   ├── test_f2py.py         # f2py extension tests
│   └── test_pynastran_integration.py  # End-to-end with analytical verification
└── docs/
    ├── getting-started.md   # User guide
    └── api-reference.md     # API documentation

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nastran95-0.2.tar.gz (17.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

nastran95-0.2-py3-none-win_amd64.whl (4.8 MB view details)

Uploaded Python 3Windows x86-64

nastran95-0.2-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (4.1 MB view details)

Uploaded Python 3manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file nastran95-0.2.tar.gz.

File metadata

  • Download URL: nastran95-0.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nastran95-0.2.tar.gz
Algorithm Hash digest
SHA256 b208ad323adb7101e35b13da149db8fed21c31073ff7eb5c19c74aa06513cdaa
MD5 ca6172eed8a3569a045ffeb3b5af12f7
BLAKE2b-256 de0a65c5afb5ed386797f7c2f689e61881eed4b168730bbd0c88af336e633f2e

See more details on using hashes here.

Provenance

The following attestation bundles were made for nastran95-0.2.tar.gz:

Publisher: release.yml on spookylukey/NASTRAN-95

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nastran95-0.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: nastran95-0.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nastran95-0.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 3ce511a26941db8f0cddfc69aa9d350572a8a5cda28b4bfc3b20e8d6b1dd5bc7
MD5 9da7fd7cbe48be774045898c70ae5be3
BLAKE2b-256 f7d4332ca9298f3684327cccb18e209886162c77ce5888f671101bc78b607502

See more details on using hashes here.

Provenance

The following attestation bundles were made for nastran95-0.2-py3-none-win_amd64.whl:

Publisher: release.yml on spookylukey/NASTRAN-95

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nastran95-0.2-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nastran95-0.2-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3eb8d8e101de34e035a04b5bfad337eeffe3e09afe581ab0242414b89ff0207f
MD5 9ec3445aa99a9b90a03c2fc182f50b4d
BLAKE2b-256 da1666dac5419b4c46c46bd14304d41a526f96567fd2e8f23e7e432e1343b36b

See more details on using hashes here.

Provenance

The following attestation bundles were made for nastran95-0.2-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on spookylukey/NASTRAN-95

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page