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.3.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.3-py3-none-win_amd64.whl (4.8 MB view details)

Uploaded Python 3Windows x86-64

nastran95-0.3-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.3.tar.gz.

File metadata

  • Download URL: nastran95-0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 07586cfc144e1b2f1fad324eea9ffb4109f5ce5f77dd8f662874a8224440b74c
MD5 710ea344adcdcfa972617ef76323064b
BLAKE2b-256 31f444bdd67db63a82126d9dedcc44e27e0619d78ef29044bdcd20eb299606b0

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: nastran95-0.3-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.3-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 4aae746fc6c8a36bbcc1ff987e7c7834c43f626b3152881d9fc408088bf61397
MD5 5f6013a9fa99f8e4e50bc2bd86dd563f
BLAKE2b-256 2cbe8122796b9b5caff0f2d0d20cb2e72a5f614211c9689192c901d752e5e917

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for nastran95-0.3-py3-none-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 607e86b6e7f31c5176e7dc1c4f46b5a02da6464e2b0b6151cea60f0c67094059
MD5 6c5db93222838a06b70391af20a22b6a
BLAKE2b-256 87a2ab90ad43599db0b0007c24c749ab33bc90d7b741fcf34594b2b6c45b2d7b

See more details on using hashes here.

Provenance

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