https://github.com/festim-dev/foam2dolfinx

A repository to handle the conversion of OpenFOAM data to dolfinx functions

https://github.com/festim-dev/foam2dolfinx

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 6 committers (16.7%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary

Keywords from Contributors

labels
Last synced: 6 months ago · JSON representation

Repository

A repository to handle the conversion of OpenFOAM data to dolfinx functions

Basic Info
  • Host: GitHub
  • Owner: festim-dev
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 31 MB
Statistics
  • Stars: 4
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created about 1 year ago · Last pushed 7 months ago
Metadata Files
Readme License

README.md

foam2dolfinx

CI Code style: Ruff

foam2dolfinx is a tool for converting OpenFOAM output files to functions that can be used within dolfinx.

[!NOTE]
This small package was inspired by Stefano Riva's ROSE-pyforce repository.

Installation

bash conda create -n foam2dolfinx-env conda activate foam2dolfinx-env conda install -c conda-forge fenics-dolfinx=0.9.0 mpich pyvista Once in the created in environment: bash python -m pip install foam2dolfinx

Example usage

Standard case

```python from foam2dolfinx import OpenFOAMReader from pyvista import examples

use foam data from the examples in pyvista

foamexample = examples.downloadcavity(load=False)

instantiate reader:

myreader = OpenFOAMReader(filename=foamexample, cell_type=10)

read velocity field at t=2.5s

vel = myofreader.createdolfinxfunction(t=2.5, name="U") ```

[!NOTE]
Currently only domains with a unique cell type across the domain are supported. Furthermore, only vtk type cells 10 - tetrahedron and 12 - hexhedron are supported.

Multiple fields

Consider a case where in the same file there is both a temperature and velocity field to read at

```python from foam2dolfinx import OpenFOAMReader

instantiate reader:

myreader = OpenFOAMReader(filename="mylocal_file.foam")

read velocity and temperature fields at t=1s

vel = myofreader.createdolfinxfunction(t=1.0, name="U") T = myofreader.createdolfinxfunction(t=1.0, name="T") ```

Multiple subdomains

```python from foam2dolfinx import OpenFOAMReader

instantiate reader:

myreader = OpenFOAMReader(filename="mylocal_file.foam")

read velocity and temperature fields at t=1s

vel1 = myofreader.createdolfinxfunction(t=3.0, name="U", subdomain="sub1") vel2 = myofreader.createdolfinxfunction(t=3.0, name="U", subdomain="sub2") ```

Tips and tricks

If you are unaware of the time values with data within the OpenFOAM data, you can check with the time_values function within the 'reader' attribute of the 'OpenFOAMReader' class:

```python from foam2dolfinx import OpenFOAMReader

instantiate reader:

myreader = OpenFOAMReader(filename="mylocal_file.foam")

find the time values

print(myreader.reader.timevalues) This should return a list of floats with the time values in the file: [1.0, 2.0, 3.0] ```

Owner

  • Name: festim-dev
  • Login: festim-dev
  • Kind: organization

GitHub Events

Total
  • Watch event: 3
  • Delete event: 12
  • Issue comment event: 13
  • Public event: 1
  • Push event: 40
  • Pull request review comment event: 7
  • Pull request review event: 7
  • Pull request event: 29
  • Create event: 14
Last Year
  • Watch event: 3
  • Delete event: 12
  • Issue comment event: 13
  • Public event: 1
  • Push event: 40
  • Pull request review comment event: 7
  • Pull request review event: 7
  • Pull request event: 29
  • Create event: 14

Committers

Last synced: 6 months ago

All Time
  • Total Commits: 74
  • Total Committers: 6
  • Avg Commits per committer: 12.333
  • Development Distribution Score (DDS): 0.324
Past Year
  • Commits: 74
  • Committers: 6
  • Avg Commits per committer: 12.333
  • Development Distribution Score (DDS): 0.324
Top Committers
Name Email Commits
jhdark d****5@m****u 50
RemDelaporteMathurin r****n@g****m 11
dependabot[bot] 4****]@u****m 6
jhdark j****5@g****m 4
James Dark 6****k@u****m 2
Rémi Delaporte-Mathurin 4****n@u****m 1
Committer Domains (Top 20 + Academic)
mit.edu: 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 0
  • Total pull requests: 16
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Total issue authors: 0
  • Total pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.38
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 0
  • Pull requests: 16
  • Average time to close issues: N/A
  • Average time to close pull requests: 1 day
  • Issue authors: 0
  • Pull request authors: 3
  • Average comments per issue: 0
  • Average comments per pull request: 0.38
  • Merged pull requests: 8
  • Bot issues: 0
  • Bot pull requests: 5
Top Authors
Issue Authors
Pull Request Authors
  • jhdark (6)
  • dependabot[bot] (5)
  • RemDelaporteMathurin (5)
Top Labels
Issue Labels
Pull Request Labels
dependencies (5) github_actions (5)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
pypi.org: foam2dolfinx

Convert OpenFOAM files to dolfinx functions

  • Homepage: https://github.com/festim-dev/foam2dolfinx
  • Documentation: https://foam2dolfinx.readthedocs.io/
  • License: MIT License Copyright (c) 2025 festim-dev Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  • Latest release: 1.0
    published 7 months ago
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 8.5%
Stargazers count: 24.9%
Average: 28.0%
Forks count: 30.9%
Dependent repos count: 47.8%
Maintainers (1)
Last synced: 7 months ago

Dependencies

.github/workflows/ci_conda.yml actions
  • actions/checkout v4 composite
  • codecov/codecov-action v5 composite
  • conda-incubator/setup-miniconda v3 composite
.github/workflows/code_formatting.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
pyproject.toml pypi
  • fenics-dolfinx ==0.9.0
  • pyvista *
.github/workflows/ci_docker.yml actions
  • actions/checkout v4 composite
  • codecov/codecov-action v5 composite