https://github.com/festim-dev/foam2dolfinx
A repository to handle the conversion of OpenFOAM data to dolfinx functions
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
Repository
A repository to handle the conversion of OpenFOAM data to dolfinx functions
Basic Info
Statistics
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
foam2dolfinx
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
- Repositories: 2
- Profile: https://github.com/festim-dev
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
Top Committers
| Name | 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)
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
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
Rankings
Maintainers (1)
Dependencies
- actions/checkout v4 composite
- codecov/codecov-action v5 composite
- conda-incubator/setup-miniconda v3 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- fenics-dolfinx ==0.9.0
- pyvista *
- actions/checkout v4 composite
- codecov/codecov-action v5 composite