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 available for your system, build from source

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.1.0.tar.gz (16.8 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.1.0-py3-none-win_amd64.whl (4.8 MB view details)

Uploaded Python 3Windows x86-64

nastran95-0.1.0-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.1.0.tar.gz.

File metadata

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

File hashes

Hashes for nastran95-0.1.0.tar.gz
Algorithm Hash digest
SHA256 46d5fde4e60f35a58321fa2e0f3f1c63b234655469d812ecd64406419b2329ec
MD5 c4c5550177082cdf91163cb9e2cf8a05
BLAKE2b-256 b2a5adcbe81592449a3dec47beadbb2257be8f07b0525f7d6110ced2fbfb5936

See more details on using hashes here.

Provenance

The following attestation bundles were made for nastran95-0.1.0.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.1.0-py3-none-win_amd64.whl.

File metadata

  • Download URL: nastran95-0.1.0-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.1.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 f192bc61b0bf52274654efc68aec0036c5835f475dc7b73640760fbd99609a44
MD5 dacfabc80e3b31f002c6a9813cfe29db
BLAKE2b-256 923209f2d9266a173bbb85ebc8ec14299f318a74ca8eecccd4d74e46e5f450a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for nastran95-0.1.0-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.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for nastran95-0.1.0-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c6219b8d530101ed4f03a8fe7abe5e691b62daa4c61e03429ff6d7f4d30b1605
MD5 9690b85b7324f87fd0d92f0ae76ee513
BLAKE2b-256 e815552069ba181abc7c381aa16079fda40aa70aa6d2b8e4b8a72f956effcf59

See more details on using hashes here.

Provenance

The following attestation bundles were made for nastran95-0.1.0-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