visualdynamics.io.nastran¶
nastran
¶
Nastran bulk data (.bdf/.dat/.nas) — geometry, read and written.
The bulk deck is the lingua franca of the FEM world this tool's measurements get correlated against, and its card formats are public knowledge documented in every Nastran vendor's reference guide and decades of literature. This reader is written from those card layouts; no other tool's source was consulted.
What is read is the geometry: GRID points with their definition and displacement systems, CORD2R/C/S coordinate systems (chained references resolved), the connection elements the vocabulary knows, and PLOTEL — Nastran's own display-only line — as tracelines. What is deliberately not read, and why:
- Properties, materials, loads, constraints, control decks — a bulk file describes an analysis; only its mesh is geometry. These are skipped by card name, silently, the way a UNV reader skips the datasets it was not asked about.
- Rigid elements (RBE2/RBE3/RBAR/RROD) and MPCs are constraints wearing element names — they carry no mesh and are skipped.
- CORD1R/C/S (systems defined by grid points) refuse loudly: a guessed frame places every node in it wrongly, and the cards are rare enough that a refusal names the fix (redefine as CORD2).
- Any other
C-prefixed connection card refuses loudly with its name, because an element silently dropped is a mesh that lies.
A deck is unitless by construction, so imports arrive raw and
length_unit= declares — exactly the universal-file-without-164
convention.
Writing is the mirror: coordinate systems as CORD2, grids as
large-field GRID* (full precision — small-field's eight characters
are why so many decks in the wild have five-digit coordinates),
elements on their own cards with PID 1 throughout, and tracelines as
PLOTEL chains. Properties are an analyst's statement about the
structure, not the geometry's to invent, so the written deck is
interchange geometry: it meshes viewers and preprocessors, and it
would need PSHELL/PSOLID cards added before Nastran itself would run
it — the docstring of save says so rather than leaving it to be
discovered.
Functions:
| Name | Description |
|---|---|
save |
Write a geometry as a bulk deck. |
Classes¶
Functions:¶
save
¶
save(geometry: Geometry, path: str | PathLike, unit_system: Any = None) -> None
Write a geometry as a bulk deck.
Interchange geometry, not a runnable analysis: elements carry PID 1 and no PSHELL/PSOLID/MAT cards are written, because properties are the analyst's statement about the structure and inventing them here would put made-up stiffness in a real deck. A point mass is the exception that is no invention: a CONM2 carries the mass its element group was given, when it was given one, and 0.0 otherwise. Springs and supports likewise: a group of springs goes out as a CELAS2 per element and direction with its stiffness, and a ground group as SPC1 cards of its components (2026-10-08). Grids go out large-field for full precision. Drawn lines become PLOTEL chains — Nastran's own display-only line. Values are written in SI, the geometry's storage.
Source code in src/visualdynamics/io/nastran.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | |