Skip to content

hertzforge.io.femap

femap

Read Femap neutral files (.neu): geometry and normal modes. Neutral files are not written.

The neutral file is Femap's text interchange format: blocks bracketed by -1 lines, each opening with its numeric ID. The layouts here were checked against real files, a Femap 2020 model export (neutral version 11.1) and a results file written by a translator (version 5.0).

What is read:

  • 403, nodes: one line per node with the id, definition and output coordinate systems, layer, color, six permanent constraints, x, y, z and type. Coordinates are stored in the definition system, so a node with a nonzero definition system would need block 405 (coordinate systems), whose record layout no sample file has shown. Such a node is refused by name instead of being placed in the wrong position. Scalar nodes (type 1) are skipped, as everywhere else in this package.
  • 404, elements: a fixed seven-line record in the version checked, a header (14 fields, topology fifth), nodes 1-10, nodes 11-20, orientation, two offset lines and a trailing list line. Every line's field count is checked, and a mismatch is refused with the neutral version named, because a version that changed the record would otherwise be misread without an error. Rigid, MultiList, Contact and Weld elements add list records that break the fixed record length, so they are refused by name; skipping them is not safe when the record length changes.
  • 450, output sets, with 451 or 1051, output data vectors: only normal-modes sets (analysis type 2) become shapes. The set's value is the frequency in Hz, and the nodal translation vectors (2, 3, 4) and rotation vectors (6, 7, 8) become the ShapeSet's columns. Other analyses' displacement vectors and all stress and strain vectors are skipped, since this path is for correlating mode shapes. 451 lists one id, value pair per line; 1051 packs runs of first, last, values...; both end at a -1. The ShapeSet is marked unscaled, because the neutral file records min/max statistics but not the normalization, and its damping is zero.

A file with both returns a dict keyed 'geometry' and 'shapes'; a file with one returns it directly; a file with neither is refused. A neutral file has no units, so length_unit declares the unit of the positions, as for a bulk deck or a universal file without a dataset 164.

Functions:

Name Description
sniff

True for a .neu file whose first six lines hold a -1 line

load

Read a neutral file's nodes, elements and normal-modes output.

Functions:

sniff

sniff(path: str | PathLike) -> bool

True for a .neu file whose first six lines hold a -1 line followed by a numeric block ID.

Gambit writes .neu files too, and they open with words, so the suffix alone would claim them.

load

load(path: str | PathLike, length_unit: str | None = None, **_unused: Any) -> Any

Read a neutral file's nodes, elements and normal-modes output.

Returns a Geometry, a ShapeSet, or a dict keyed 'geometry' and 'shapes' when the file has both. length_unit declares the unit of the positions, since the file has none. Raises ValueError for a file with neither, and for the records the module docstring lists as refused.