Skip to main content

OpenFOAM config file parser

Project description

File parser for OpenFOAM configuration files based on https://cfd.direct/openfoam/user-guide/v6-basic-file-format/

foamfile uses pyparsing to extract the data from the files.

example usage

from foamfile import FoamFile

with FoamFile("path/to/file") as f:
    foam_content = f.read()
    print(f.header)
    print(foam_content)

with FoamFile("path/to/file", "w", foam_class="dictionary") as f:
    f.write(foam_content)

TODO

  • Macro expansion does not work at the moment
  • Optimize parsing of directives
  • Add codeStreams
  • Add calculations
  • Add support for comments

Tested with OpenFOAM v6.

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

foamfile-0.11.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

foamfile-0.11-py3-none-any.whl (4.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page