FEniCS/dolfinx

Introduce enum `FileMode` for I/O file mode

Open

#4,366 opened on Aug 5, 2026

 (1 comment) (0 reactions) (0 assignees)C++ (255 forks)auto 404
good first issueio

Repository metrics

Stars
 (1,158 stars)
PR merge metrics
 (PR metrics pending)

Description

Currently the file mode in which an output file is opened is specified by a string.

with XDMFFile(mesh.comm, filename, "w", encoding=encoding) as file:
        file.write_mesh(mesh)

This should be altered to be enum based and back end independent, ref. https://github.com/FEniCS/dolfinx/pull/4177#discussion_r3608425522.

Contributor guide