Skip to main content

pyvista-frd-reader

Read and write CalculiX FRD files with PyVista. The Python API returns a pyvista.UnstructuredGrid; the C API exposes the same parser without a Python dependency.

import pyvista_frd

mesh = pyvista_frd.read("result.frd")
mesh.plot(scalars="STRESS_Mises")

Install

pip install pyvista-frd-reader

Wheels are available for Linux, macOS, and Windows. Linux wheels require glibc 2.28 or newer. A source build requires CMake and a C++17 compiler. There is no pure-Python fallback.

Read time steps

Use FRDReader when a file contains more than one result step:

reader = pyvista_frd.FRDReader("transient.frd")
print(reader.time_values)

reader.set_active_time_point(3)
mesh = reader.read()

The reader implements PyVista’s time-reader interface. Result blocks are indexed when the file is opened and parsed when their step is first read.

Read node and element sets

Supply a companion input deck to attach boolean set masks to the result:

mesh = pyvista_frd.read("model.frd", inp_path="model.inp")
body = mesh.extract_cells(mesh.cell_data["ELSET:BODY"])
fixed = mesh.extract_points(mesh.point_data["NSET:FIXED"])

pyvista_frd.read_sets("model.inp") returns the original set IDs without an FRD file. Includes, generated ranges, and references to earlier sets are supported. See Node and element sets for naming, missing-ID behavior, and limitations.

Named surfaces

Extract faces using the companion deck’s *SURFACE definitions, with all nodal results from the active step:

reader = pyvista_frd.FRDReader("model.frd", inp_path="model.inp")
wall = reader.read_surface("WALL")
wall.plot(scalars="STRESS_Mises")
surfaces = reader.read_surfaces()  # named MultiBlock

Solid faces retain quadratic midside nodes. Shell sides, planar edges, expanded beam/shell faces, internal faces, and nodal surfaces are supported. See Named surfaces for face numbering, missing-ID handling, dataset validation, and two runnable galleries with all required result files and companion decks included in the source.

Write and convert files

pyvista_frd.write("result_ascii.frd", mesh)
pyvista_frd.write("result_binary.frd", mesh, binary=True)

# Convert the records without building a PyVista mesh.
pyvista_frd.convert("result_binary.frd", "result_ascii.frd", binary=False)

ASCII output stores six significant digits. Binary output is smaller and retains the stored floating-point values. See Writing FRD for format and round-trip details.

Supported FRD data

The reader supports the two ASCII encodings and the float32 and float64 binary encodings. It reads short and long element records, including fixed-width records whose node IDs have no separating spaces.

Supported element types are HE8, PE6, PE15, TE4, HE20, TE10, TR3, TR6, QU4, QU8, BE2, BE3, PY5, and PY13. PY5 and PY13 are the experimental CalculiX pyramid types C3D5 and C3D13.

For each six-component array whose name contains STRESS or STRAIN, the reader adds:

  • <NAME>_Mises: von Mises magnitude

  • <NAME>_sgMises: von Mises magnitude signed by the tensor trace

  • <NAME>_PS1, _PS2, and _PS3: principal values, largest first

Invalid and unsupported elements produce pyvista.InvalidMeshWarning with the source line number. Points use float64 storage. VTK cell connectivity uses 32-bit storage when it fits, otherwise 64-bit storage.

Relationship to PyVista

PyVista includes a Python FRD reader. This package provides a separate C++ implementation and does not replace pyvista.FRDReader or register itself as the handler for pyvista.read.

The conformance suite compares the two readers file by file and array by array. The current external sweep covers 1,766 files with no undocumented divergences. The principal-value comparison uses a numerical tolerance because the implementations use different eigensolvers. Binary FRD is checked against paired ASCII and binary output from CalculiX because PyVista’s reader supports ASCII only.

See Parity for the corpus, method, results, and limitations. See Divergences for the exact behavioral and numerical differences.

C API

The public header is cpp/include/pvfrd/pvfrd.h. It uses a C ABI and can be called from C, C++, or another language with a foreign-function interface.

cmake -S cpp -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
#include <pvfrd/pvfrd.h>

pvfrd_file *file = NULL;
if (pvfrd_open("mesh.frd", &file) != PVFRD_OK) { /* handle error */ }

const double *points = pvfrd_points(file);
uint64_t n_points = pvfrd_n_points(file);

pvfrd_close(file);

The shared library has no additional link dependencies. Static linking with GCC or Clang also requires -lstdc++ -lm.

Development

cmake -S cpp -B cpp/build -DPVFRD_BUILD_TESTS=ON
cmake --build cpp/build
./cpp/build/pvfrd_tests

pip install -e .[tests]
pytest

The C++ and Python suites share the fixtures in tests/fixtures. tools/mutate.py applies known parser and writer defects and verifies that the intended tests fail.

Documentation

The documentation includes installation, examples, the Python and C APIs, format notes, and verification results.

Credit

Rafal (@3rav) wrote PyVista’s original FRD reader in pyvista#8255. This package reimplements that behavior and vendors the PyVista reader as its conformance reference. Guido Dhondt and Klaus Wittig created CalculiX and its FRD format. See History and credit.

License

This project is MIT licensed. The vendored fast_float header is available under Apache-2.0, MIT, or BSL terms.

Metadata

Release files for pyvista-frd-reader 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvista-frd-reader 0.3.0
File Size Uploaded
pyvista_frd_reader-0.3.0.tar.gz 1.4 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyvista-frd-reader 0.3.0
File
pyvista_frd_reader-0.3.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
pyvista_frd_reader-0.3.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64, Linux glibc 2.24+ x86-64 Details
pyvista_frd_reader-0.3.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64, Linux glibc 2.24+ ARM64 Details
pyvista_frd_reader-0.3.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
pyvista_frd_reader-0.3.0-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details

Total release size: 2.1 MB

Release files / pyvista_frd_reader-0.3.0.tar.gz

Download URL pyvista_frd_reader-0.3.0.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
e316fa836ddc30b40e8b12f5c55eda58e86b884733978ddc052abb8a05dcb4ab
BLAKE2b-256 checksum
How to use checksums
03c7d98afd05c82ce49b7b337874cf9966345d82b1a36c1e878db8263f5fb1c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / pyvista_frd_reader-0.3.0-py3-none-win_amd64.whl

Download URL pyvista_frd_reader-0.3.0-py3-none-win_amd64.whl
Size 135.8 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
ce968c0f8ffe2b11a853706c6c3fc68b8073386f05a453fa21e337c3962253e3
BLAKE2b-256 checksum
How to use checksums
47c44f673d6924fd70b14e4f1abe77c526cbc3afc1d665f9ee26b935691fcdef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / pyvista_frd_reader-0.3.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl

Download URL pyvista_frd_reader-0.3.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Size 154.0 kB
Tags Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2cb464e9b56082e493190d7689284dfd8cf6959bd8fdc62a1255c9e667947279
BLAKE2b-256 checksum
How to use checksums
6817edf3b2371b3b914d900c74ad7bde256f1609e5004d8aedb631e8b12640db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / pyvista_frd_reader-0.3.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl

Download URL pyvista_frd_reader-0.3.0-py3-none-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
Size 140.8 kB
Tags Linux glibc 2.24+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
2535381f1a32dc9a454009b61a033682a71eb4817868cdd20317aff22e338dc1
BLAKE2b-256 checksum
How to use checksums
5638711613b7f2e7a2d9d6d9d283049d8ec48e2941eefa49e30a429de5431131
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / pyvista_frd_reader-0.3.0-py3-none-macosx_11_0_arm64.whl

Download URL pyvista_frd_reader-0.3.0-py3-none-macosx_11_0_arm64.whl
Size 123.3 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
5e42b0d491a30c47557d7b8bcec4cb49c8c132df82f61f0f68e29c3ad2190805
BLAKE2b-256 checksum
How to use checksums
bf5c8484f517dd830a0f0d639613c1033fbb1ff64d875962f22c5cf2f87cf4f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / pyvista_frd_reader-0.3.0-py3-none-macosx_10_15_x86_64.whl

Download URL pyvista_frd_reader-0.3.0-py3-none-macosx_10_15_x86_64.whl
Size 132.2 kB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
337ae6629d1257e4d583ab10745b9f18c96d9aebb1a3435a897010269259645a
BLAKE2b-256 checksum
How to use checksums
95b1b3bff9e76f5d4aa512aa7475238ceee8445c76eb98c62f66b98dc7b224ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.1

6 release files

This release

0.3.0 This release

6 release files

0.2.2

6 release files

0.2.1

6 release files

0.2.0

6 release files

0.1.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page