pybFoam 0.1.10__tar.gz → 0.1.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (299) hide show
  1. {pybfoam-0.1.10 → pybfoam-0.1.11}/.github/workflows/ci.yaml +24 -3
  2. {pybfoam-0.1.10 → pybfoam-0.1.11}/.gitignore +7 -1
  3. pybfoam-0.1.11/.pre-commit-config.yaml +36 -0
  4. {pybfoam-0.1.10 → pybfoam-0.1.11}/CHANGELOG.md +8 -1
  5. {pybfoam-0.1.10 → pybfoam-0.1.11}/CMakeLists.txt +1 -1
  6. pybfoam-0.1.11/CMakePresets.json +143 -0
  7. {pybfoam-0.1.10 → pybfoam-0.1.11}/PKG-INFO +14 -17
  8. {pybfoam-0.1.10 → pybfoam-0.1.11}/README.md +9 -11
  9. {pybfoam-0.1.10 → pybfoam-0.1.11}/benchmark/benchmark_expression_complex.py +23 -13
  10. {pybfoam-0.1.10 → pybfoam-0.1.11}/benchmark/benchmark_expression_vec_add.py +25 -17
  11. {pybfoam-0.1.10 → pybfoam-0.1.11}/benchmark/benchmark_expression_vec_add_4.py +27 -18
  12. {pybfoam-0.1.10 → pybfoam-0.1.11}/cmake/Dependencies.cmake +1 -1
  13. {pybfoam-0.1.10 → pybfoam-0.1.11}/cmake/FindOpenFOAM.cmake +32 -32
  14. pybfoam-0.1.11/conftest.py +10 -0
  15. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/conf.py +1 -1
  16. pybfoam-0.1.11/examples/case/read_dict.py +16 -0
  17. pybfoam-0.1.11/examples/case/read_fields.py +19 -0
  18. pybfoam-0.1.11/examples/fields_and_numpy.py +28 -0
  19. {pybfoam-0.1.10 → pybfoam-0.1.11}/pyproject.toml +29 -9
  20. pybfoam-0.1.11/scripts/clean_stubs.py +160 -0
  21. {pybfoam-0.1.10 → pybfoam-0.1.11}/scripts/generate_stubs.sh +16 -1
  22. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/CMakeLists.txt +2 -1
  23. pybfoam-0.1.11/src/pybFoam/__init__.py +242 -0
  24. pybfoam-0.1.11/src/pybFoam/__init__.pyi +121 -0
  25. pybfoam-0.1.11/src/pybFoam/_version.py +1 -0
  26. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/_version.pyi +2 -1
  27. pybfoam-0.1.10/src/pybFoam/fvc.pyi → pybfoam-0.1.11/src/pybFoam/fvc/__init__.pyi +4 -1
  28. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvc/bind_fvc.cpp +2 -2
  29. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvc/bind_fvc.hpp +1 -1
  30. pybfoam-0.1.11/src/pybFoam/fvc/fvc.pyi +433 -0
  31. pybfoam-0.1.10/src/pybFoam/fvm.pyi → pybfoam-0.1.11/src/pybFoam/fvm/__init__.pyi +4 -1
  32. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvm/bind_fvm.cpp +1 -1
  33. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvm/bind_fvm.hpp +1 -1
  34. pybfoam-0.1.11/src/pybFoam/fvm/fvm.pyi +292 -0
  35. pybfoam-0.1.11/src/pybFoam/io/__init__.py +0 -0
  36. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/io/model_base.py +8 -8
  37. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/io/system.py +22 -5
  38. pybfoam-0.1.11/src/pybFoam/meshing/CMakeLists.txt +104 -0
  39. pybfoam-0.1.11/src/pybFoam/meshing/__init__.pyi +83 -0
  40. pybfoam-0.1.11/src/pybFoam/meshing/bind_blockmesh.cpp +226 -0
  41. pybfoam-0.1.11/src/pybFoam/meshing/bind_blockmesh.hpp +63 -0
  42. pybfoam-0.1.11/src/pybFoam/meshing/bind_checkmesh.cpp +652 -0
  43. pybfoam-0.1.11/src/pybFoam/meshing/bind_checkmesh.hpp +32 -0
  44. pybfoam-0.1.11/src/pybFoam/meshing/bind_snappy.cpp +510 -0
  45. pybfoam-0.1.11/src/pybFoam/meshing/bind_snappy.hpp +43 -0
  46. pybfoam-0.1.11/src/pybFoam/meshing/mesh_generation.C +49 -0
  47. pybfoam-0.1.11/src/pybFoam/meshing/mesh_utils.C +112 -0
  48. pybfoam-0.1.11/src/pybFoam/meshing/mesh_utils.H +85 -0
  49. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/CMakeLists.txt +6 -2
  50. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_cfdTools.cpp +3 -3
  51. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_cfdTools.hpp +1 -1
  52. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_control.cpp +0 -2
  53. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_control.hpp +1 -1
  54. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_dict.hpp +2 -2
  55. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_dimensioned.cpp +4 -4
  56. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_dimensioned.hpp +1 -1
  57. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_fields.cpp +23 -9
  58. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_fields.hpp +1 -1
  59. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_fvMatrix.hpp +1 -1
  60. pybfoam-0.1.11/src/pybFoam/pybFoam_core/bind_fvmesh.cpp +189 -0
  61. pybfoam-0.1.11/src/pybFoam/pybFoam_core/bind_fvmesh.hpp +51 -0
  62. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_geo_fields.cpp +3 -3
  63. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_geo_fields.hpp +4 -4
  64. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_io.cpp +1 -1
  65. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_io.hpp +1 -1
  66. pybfoam-0.1.11/src/pybFoam/pybFoam_core/bind_polymesh.cpp +269 -0
  67. pybfoam-0.1.11/src/pybFoam/pybFoam_core/bind_polymesh.hpp +77 -0
  68. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_primitives.cpp +4 -4
  69. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_primitives.hpp +1 -1
  70. pybfoam-0.1.10/src/pybFoam/pybFoam_core/bind_mesh.cpp → pybfoam-0.1.11/src/pybFoam/pybFoam_core/bind_time.cpp +4 -76
  71. pybfoam-0.1.10/src/pybFoam/pybFoam_core/bind_mesh.hpp → pybfoam-0.1.11/src/pybFoam/pybFoam_core/bind_time.hpp +17 -19
  72. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/pybFoam.cpp +6 -2
  73. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core.pyi +274 -46
  74. pybfoam-0.1.10/src/pybFoam/runTimeTables.pyi → pybfoam-0.1.11/src/pybFoam/runTimeTables/__init__.pyi +1 -0
  75. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/runTimeTables/foam_runTimeTables.C +2 -2
  76. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/runTimeTables/foam_runTimeTables.H +2 -2
  77. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/runTimeTables/runTimeTables.C +1 -1
  78. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/__init__.py +21 -23
  79. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/bind_sampling.cpp +22 -22
  80. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/sampling.cpp +1 -1
  81. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/set_configs.py +59 -43
  82. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/surface_configs.py +46 -20
  83. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/utils.py +12 -12
  84. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling_bindings.pyi +4 -1
  85. pybfoam-0.1.10/src/pybFoam/thermo.pyi → pybfoam-0.1.11/src/pybFoam/thermo/__init__.pyi +2 -0
  86. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/thermo/bind_thermo.hpp +1 -1
  87. pybfoam-0.1.10/src/pybFoam/turbulence.pyi → pybfoam-0.1.11/src/pybFoam/turbulence/__init__.pyi +4 -1
  88. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/turbulence/bind_turbulence.cpp +3 -3
  89. {pybfoam-0.1.10/tests/elbow → pybfoam-0.1.11/tests/cavity}/icoFoam.py +31 -15
  90. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/system/fvSolution +2 -2
  91. {pybfoam-0.1.10/tests/cavity → pybfoam-0.1.11/tests/elbow}/icoFoam.py +31 -15
  92. pybfoam-0.1.11/tests/io/TestDict.json +69 -0
  93. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/test_controlDict.py +11 -11
  94. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/test_fvSchemes.py +20 -13
  95. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/test_fvSolution.py +6 -4
  96. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/test_parse_ofdict.py +32 -29
  97. pybfoam-0.1.11/tests/meshing/__init__.py +0 -0
  98. pybfoam-0.1.11/tests/meshing/conftest.py +219 -0
  99. pybfoam-0.1.11/tests/meshing/cube/0/U +41 -0
  100. pybfoam-0.1.11/tests/meshing/cube/0/p +40 -0
  101. pybfoam-0.1.11/tests/meshing/cube/constant/transportProperties +20 -0
  102. pybfoam-0.1.11/tests/meshing/cube/log.checkmesh +109 -0
  103. pybfoam-0.1.11/tests/meshing/cube/system/PDRblockMeshDict +61 -0
  104. pybfoam-0.1.11/tests/meshing/cube/system/blockMeshDict +72 -0
  105. pybfoam-0.1.11/tests/meshing/cube/system/controlDict +48 -0
  106. pybfoam-0.1.11/tests/meshing/cube/system/decomposeParDict +27 -0
  107. pybfoam-0.1.11/tests/meshing/cube/system/fvSchemes +50 -0
  108. pybfoam-0.1.11/tests/meshing/cube/system/fvSolution +51 -0
  109. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/U +51 -0
  110. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/include/fixedInlet +15 -0
  111. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/include/frontBackUpperPatches +19 -0
  112. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/include/initialConditions +14 -0
  113. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/k +53 -0
  114. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/nut +63 -0
  115. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/omega +52 -0
  116. pybfoam-0.1.11/tests/meshing/motorBike/0.orig/p +52 -0
  117. pybfoam-0.1.11/tests/meshing/motorBike/Allclean +8 -0
  118. pybfoam-0.1.11/tests/meshing/motorBike/Allrun +54 -0
  119. pybfoam-0.1.11/tests/meshing/motorBike/Allrun.pre +19 -0
  120. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike.extendedFeatureEdgeMesh +0 -0
  121. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_concaveFeaturePts.obj +509 -0
  122. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_convexFeaturePts.obj +586 -0
  123. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_edgeDirections.obj +62601 -0
  124. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_edgeMesh.obj +41543 -0
  125. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_externalEdges.obj +21516 -0
  126. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_flatEdges.obj +285 -0
  127. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_internalEdges.obj +32742 -0
  128. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_mixedFeaturePts.obj +1197 -0
  129. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_mixedFeaturePtsStructure.obj +10560 -0
  130. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_multipleEdges.obj +7911 -0
  131. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_openEdges.obj +147 -0
  132. pybfoam-0.1.11/tests/meshing/motorBike/constant/extendedFeatureEdgeMesh/motorBike_regionEdges.obj +26034 -0
  133. pybfoam-0.1.11/tests/meshing/motorBike/constant/transportProperties +22 -0
  134. pybfoam-0.1.11/tests/meshing/motorBike/constant/triSurface/motorBike.eMesh +0 -0
  135. pybfoam-0.1.11/tests/meshing/motorBike/constant/triSurface/motorBike.obj.gz +0 -0
  136. pybfoam-0.1.11/tests/meshing/motorBike/constant/turbulenceProperties +29 -0
  137. pybfoam-0.1.11/tests/meshing/motorBike/std_log.txt +3618 -0
  138. pybfoam-0.1.11/tests/meshing/motorBike/system/blockMeshDict +86 -0
  139. pybfoam-0.1.11/tests/meshing/motorBike/system/controlDict +57 -0
  140. pybfoam-0.1.11/tests/meshing/motorBike/system/cuttingPlane +33 -0
  141. pybfoam-0.1.11/tests/meshing/motorBike/system/decomposeParDict-random +22 -0
  142. pybfoam-0.1.11/tests/meshing/motorBike/system/decomposeParDict.6 +27 -0
  143. pybfoam-0.1.11/tests/meshing/motorBike/system/ensightWrite +23 -0
  144. pybfoam-0.1.11/tests/meshing/motorBike/system/finite-area/faMeshDefinition +30 -0
  145. pybfoam-0.1.11/tests/meshing/motorBike/system/finite-area/faSchemes +32 -0
  146. pybfoam-0.1.11/tests/meshing/motorBike/system/finite-area/faSolution +19 -0
  147. pybfoam-0.1.11/tests/meshing/motorBike/system/forceCoeffs +54 -0
  148. pybfoam-0.1.11/tests/meshing/motorBike/system/fvSchemes +62 -0
  149. pybfoam-0.1.11/tests/meshing/motorBike/system/fvSolution +87 -0
  150. pybfoam-0.1.11/tests/meshing/motorBike/system/meshQualityDict +24 -0
  151. pybfoam-0.1.11/tests/meshing/motorBike/system/profiling +9 -0
  152. pybfoam-0.1.11/tests/meshing/motorBike/system/snappyHexMeshDict +326 -0
  153. pybfoam-0.1.11/tests/meshing/motorBike/system/streamLines +55 -0
  154. pybfoam-0.1.11/tests/meshing/motorBike/system/surfaceFeatureExtractDict +45 -0
  155. pybfoam-0.1.11/tests/meshing/motorBike/system/topoSetDict +31 -0
  156. pybfoam-0.1.11/tests/meshing/motorBike/system/wallBoundedStreamLines +95 -0
  157. pybfoam-0.1.11/tests/meshing/sphere_simple/Allclean +8 -0
  158. pybfoam-0.1.11/tests/meshing/sphere_simple/Allrun +12 -0
  159. pybfoam-0.1.11/tests/meshing/sphere_simple/Allrun.pre +12 -0
  160. pybfoam-0.1.11/tests/meshing/sphere_simple/sphere_simple.foam +0 -0
  161. pybfoam-0.1.11/tests/meshing/sphere_simple/system/blockMeshDict +57 -0
  162. pybfoam-0.1.11/tests/meshing/sphere_simple/system/controlDict +47 -0
  163. pybfoam-0.1.11/tests/meshing/sphere_simple/system/fvSchemes +48 -0
  164. pybfoam-0.1.11/tests/meshing/sphere_simple/system/fvSolution +33 -0
  165. pybfoam-0.1.11/tests/meshing/sphere_simple/system/meshQualityDict +37 -0
  166. pybfoam-0.1.11/tests/meshing/sphere_simple/system/snappyHexMeshDict +115 -0
  167. pybfoam-0.1.11/tests/meshing/test_blockmesh_cube.py +164 -0
  168. pybfoam-0.1.11/tests/meshing/test_checkmesh.py +330 -0
  169. pybfoam-0.1.11/tests/meshing/test_snappy_motorbike.py +144 -0
  170. pybfoam-0.1.11/tests/meshing/test_snappy_sphere.py +151 -0
  171. pybfoam-0.1.11/tests/pybind/0/U +54 -0
  172. pybfoam-0.1.11/tests/pybind/0/alpha.water +49 -0
  173. pybfoam-0.1.11/tests/pybind/0/p_rgh +52 -0
  174. pybfoam-0.1.11/tests/pybind/Allclean +10 -0
  175. pybfoam-0.1.11/tests/pybind/Allrun +14 -0
  176. pybfoam-0.1.11/tests/pybind/Allrun-parallel +16 -0
  177. pybfoam-0.1.11/tests/pybind/constant/dynamicMeshDict +21 -0
  178. pybfoam-0.1.11/tests/pybind/constant/g +22 -0
  179. pybfoam-0.1.11/tests/pybind/constant/transportProperties +38 -0
  180. pybfoam-0.1.11/tests/pybind/constant/turbulenceProperties +21 -0
  181. pybfoam-0.1.11/tests/pybind/system/TestDict +43 -0
  182. pybfoam-0.1.11/tests/pybind/system/blockMeshDict +114 -0
  183. pybfoam-0.1.11/tests/pybind/system/controlDict +81 -0
  184. pybfoam-0.1.11/tests/pybind/system/decomposeParDict +27 -0
  185. pybfoam-0.1.11/tests/pybind/system/fvSchemes +59 -0
  186. pybfoam-0.1.11/tests/pybind/system/fvSolution +80 -0
  187. pybfoam-0.1.11/tests/pybind/system/setFieldsDict +36 -0
  188. pybfoam-0.1.11/tests/pybind/test_dict.py +48 -0
  189. pybfoam-0.1.11/tests/pybind/test_dimensioned.py +254 -0
  190. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/test_field_tmp_interop.py +41 -42
  191. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/test_fvc.py +26 -20
  192. pybfoam-0.1.11/tests/pybind/test_fvm.py +32 -0
  193. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/test_geoFields.py +63 -61
  194. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/test_primitives.py +85 -85
  195. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/test_set_sampling.py +157 -186
  196. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/test_surface_sampling.py +111 -126
  197. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/test_uniform_fields.py +19 -14
  198. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/test_sampling_models.py +16 -14
  199. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/test_sampling_set_configs.py +40 -89
  200. pybfoam-0.1.10/CMakePresets.json +0 -143
  201. pybfoam-0.1.10/conftest.py +0 -9
  202. pybfoam-0.1.10/scripts/clean_stubs.py +0 -166
  203. pybfoam-0.1.10/src/pybFoam/__init__.py +0 -112
  204. pybfoam-0.1.10/src/pybFoam/__init__.pyi +0 -109
  205. pybfoam-0.1.10/src/pybFoam/_version.py +0 -1
  206. pybfoam-0.1.10/src/pybFoam/fvc/__init__.pyi +0 -2
  207. pybfoam-0.1.10/src/pybFoam/fvm/__init__.pyi +0 -2
  208. pybfoam-0.1.10/src/pybFoam/io/__init__.py +0 -1
  209. pybfoam-0.1.10/src/pybFoam/runTimeTables/__init__.pyi +0 -2
  210. pybfoam-0.1.10/src/pybFoam/thermo/__init__.pyi +0 -2
  211. pybfoam-0.1.10/src/pybFoam/turbulence/__init__.pyi +0 -2
  212. pybfoam-0.1.10/tests/io/TestDict.json +0 -13
  213. pybfoam-0.1.10/tests/pybind/test_dict.py +0 -46
  214. pybfoam-0.1.10/tests/pybind/test_dimensioned.py +0 -416
  215. pybfoam-0.1.10/tests/pybind/test_fvm.py +0 -21
  216. {pybfoam-0.1.10 → pybfoam-0.1.11}/.github/workflows/pages.yaml +0 -0
  217. {pybfoam-0.1.10 → pybfoam-0.1.11}/.github/workflows/release.yaml +0 -0
  218. {pybfoam-0.1.10 → pybfoam-0.1.11}/LICENSE +0 -0
  219. {pybfoam-0.1.10 → pybfoam-0.1.11}/benchmark/bench_complex.png +0 -0
  220. {pybfoam-0.1.10 → pybfoam-0.1.11}/benchmark/bench_vec_add.png +0 -0
  221. {pybfoam-0.1.10 → pybfoam-0.1.11}/benchmark/bench_vec_add_4.png +0 -0
  222. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/Makefile +0 -0
  223. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/README.md +0 -0
  224. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/api.rst +0 -0
  225. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/changelog.rst +0 -0
  226. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/contributing.rst +0 -0
  227. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/index.rst +0 -0
  228. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/installation.rst +0 -0
  229. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/introduction.rst +0 -0
  230. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/make.bat +0 -0
  231. {pybfoam-0.1.10 → pybfoam-0.1.11}/docs/usage.rst +0 -0
  232. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/0.orig/U +0 -0
  233. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/0.orig/alpha.water +0 -0
  234. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/0.orig/p_rgh +0 -0
  235. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/Allclean +0 -0
  236. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/Allrun +0 -0
  237. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/Allrun-parallel +0 -0
  238. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/constant/dynamicMeshDict +0 -0
  239. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/constant/g +0 -0
  240. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/constant/transportProperties +0 -0
  241. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/constant/turbulenceProperties +0 -0
  242. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/system/TestDict +0 -0
  243. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/system/blockMeshDict +0 -0
  244. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/system/controlDict +0 -0
  245. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/system/decomposeParDict +0 -0
  246. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/system/fvSchemes +0 -0
  247. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/system/fvSolution +0 -0
  248. {pybfoam-0.1.10/tests/pybind → pybfoam-0.1.11/examples/case}/system/setFieldsDict +0 -0
  249. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvc/CMakeLists.txt +0 -0
  250. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvc/fvc.cpp +0 -0
  251. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvm/CMakeLists.txt +0 -0
  252. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/fvm/fvm.cpp +0 -0
  253. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/py.typed +0 -0
  254. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_dict.cpp +0 -0
  255. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/pybFoam_core/bind_fvMatrix.cpp +0 -0
  256. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/runTimeTables/CMakeLists.txt +0 -0
  257. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/CMakeLists.txt +0 -0
  258. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/sampling/bind_sampling.hpp +0 -0
  259. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/thermo/CMakeLists.txt +0 -0
  260. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/thermo/bind_thermo.cpp +0 -0
  261. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/thermo/thermo.cpp +0 -0
  262. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/turbulence/CMakeLists.txt +0 -0
  263. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/turbulence/bind_turbulence.hpp +0 -0
  264. {pybfoam-0.1.10 → pybfoam-0.1.11}/src/pybFoam/turbulence/turbulence.cpp +0 -0
  265. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/0.orig/U +0 -0
  266. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/0.orig/nu +0 -0
  267. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/0.orig/p +0 -0
  268. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/Allclean +0 -0
  269. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/Allrun +0 -0
  270. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/constant/transportProperties +0 -0
  271. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/log2 +0 -0
  272. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/system/PDRblockMeshDict +0 -0
  273. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/system/blockMeshDict +0 -0
  274. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/system/controlDict +0 -0
  275. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/system/decomposeParDict +0 -0
  276. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/cavity/system/fvSchemes +0 -0
  277. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/0.orig/U +0 -0
  278. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/0.orig/nu +0 -0
  279. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/0.orig/p +0 -0
  280. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/Allclean +0 -0
  281. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/Allrun +0 -0
  282. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/constant/transportProperties +0 -0
  283. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/system/controlDict +0 -0
  284. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/system/foamDataToFluentDict +0 -0
  285. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/system/fvSchemes +0 -0
  286. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/elbow/system/fvSolution +0 -0
  287. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/TestDict +0 -0
  288. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/TestDict.yaml +0 -0
  289. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/controlDict +0 -0
  290. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/fvSchemes +0 -0
  291. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/io/fvSolution +0 -0
  292. {pybfoam-0.1.10/tests/pybind/0 → pybfoam-0.1.11/tests/pybind/0.orig}/U +0 -0
  293. {pybfoam-0.1.10/tests/pybind/0 → pybfoam-0.1.11/tests/pybind/0.orig}/alpha.water +0 -0
  294. {pybfoam-0.1.10/tests/pybind/0 → pybfoam-0.1.11/tests/pybind/0.orig}/p_rgh +0 -0
  295. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/constant/polyMesh/boundary +0 -0
  296. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/constant/polyMesh/faces +0 -0
  297. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/constant/polyMesh/neighbour +0 -0
  298. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/constant/polyMesh/owner +0 -0
  299. {pybfoam-0.1.10 → pybfoam-0.1.11}/tests/pybind/constant/polyMesh/points +0 -0
@@ -12,7 +12,7 @@ jobs:
12
12
  runs-on: ubuntu-24.04 # may use an older version to test
13
13
  strategy:
14
14
  matrix:
15
- openfoam-version: [2406, 2412, 2506]
15
+ openfoam-version: [2312, 2406, 2412, 2506, 2512]
16
16
  fail-fast: false
17
17
  name: Test with OpenFOAM ${{ matrix.openfoam-version }}
18
18
  steps:
@@ -37,6 +37,27 @@ jobs:
37
37
  run: |
38
38
  pytest
39
39
 
40
- - name: run type checking
40
+ pre-commit-checks:
41
+ name: Pre-commit checks
42
+ runs-on: ubuntu-24.04
43
+ steps:
44
+ - uses: actions/checkout@v5
45
+
46
+ - name: Set up OpenFOAM
47
+ uses: gerlero/setup-openfoam@v1
48
+ with:
49
+ openfoam-version: 2506
50
+
51
+ - name: Set up Python
52
+ uses: actions/setup-python@v5
53
+ with:
54
+ python-version: '3.11'
55
+
56
+ - name: Install dependencies
57
+ run: |
58
+ python -m pip install --upgrade pip
59
+ pip install .[dev]
60
+
61
+ - name: Run pre-commit on all files
41
62
  run: |
42
- mypy
63
+ pre-commit run --all-files --color always --verbose
@@ -136,4 +136,10 @@ __pycache__
136
136
  dist/
137
137
  build/
138
138
  _skbuild/
139
- docs/_build
139
+ docs/_build
140
+
141
+ # meshing polyMesh
142
+
143
+ tests/meshing/motorBike/constant/polyMesh
144
+ tests/meshing/sphere_simple/constant/polyMesh
145
+ tests/meshing/cube/constant/polyMesh
@@ -0,0 +1,36 @@
1
+ # Pre-commit configuration for pybFoam
2
+ # See https://pre-commit.com for more information
3
+
4
+ repos:
5
+ - repo: https://github.com/pre-commit/pre-commit-hooks
6
+ rev: v6.0.0
7
+ hooks:
8
+ - id: check-yaml
9
+ - id: end-of-file-fixer
10
+ - id: trailing-whitespace
11
+ - id: pretty-format-json
12
+ args: [--autofix, --no-sort-keys]
13
+
14
+ # Local hooks using poe commands
15
+ - repo: local
16
+ hooks:
17
+ - id: format
18
+ name: Ruff Format
19
+ entry: poe format
20
+ language: system
21
+ types: [python]
22
+ pass_filenames: false
23
+
24
+ - id: lint
25
+ name: Ruff Lint
26
+ entry: poe lint
27
+ language: system
28
+ types: [python]
29
+ pass_filenames: false
30
+
31
+ - id: type-check
32
+ name: Mypy Type Check
33
+ entry: poe type_check
34
+ language: system
35
+ types: [python]
36
+ pass_filenames: false
@@ -1,7 +1,14 @@
1
1
  # Changelog
2
2
 
3
3
 
4
- ## [0.1.6]
4
+ ## [0.1.11]
5
+
6
+ ## Added
7
+
8
+ * blockmesh bindings
9
+ * snappy hex mesh bindings
10
+ * check mesh bindings
11
+
5
12
 
6
13
  ### Added
7
14
  - Initial implementation of sampling module with pybind11 bindings
@@ -5,7 +5,7 @@ if(POLICY CMP0169)
5
5
  cmake_policy(SET CMP0169 OLD)
6
6
  endif()
7
7
 
8
- project(pybFoam VERSION 0.1.10 LANGUAGES CXX)
8
+ project(pybFoam VERSION 0.1.11 LANGUAGES CXX)
9
9
 
10
10
  # Set C++ standard
11
11
  set(CMAKE_CXX_STANDARD 17)
@@ -0,0 +1,143 @@
1
+ {
2
+ "version": 3,
3
+ "configurePresets": [
4
+ {
5
+ "name": "default",
6
+ "displayName": "Default Config",
7
+ "description": "Default build configuration for pybFoam",
8
+ "generator": "Unix Makefiles",
9
+ "binaryDir": "${sourceDir}/build",
10
+ "cacheVariables": {
11
+ "CMAKE_BUILD_TYPE": "Release",
12
+ "CMAKE_CXX_COMPILER": "g++",
13
+ "CMAKE_C_COMPILER": "gcc",
14
+ "CPM_SOURCE_CACHE": "$env{HOME}/.cache/CPM",
15
+ "CPM_USE_LOCAL_PACKAGES": "ON"
16
+ },
17
+ "condition": {
18
+ "type": "notEquals",
19
+ "lhs": "$env{FOAM_SRC}",
20
+ "rhs": ""
21
+ }
22
+ },
23
+ {
24
+ "name": "debug",
25
+ "displayName": "Debug Config",
26
+ "description": "Debug build configuration for pybFoam",
27
+ "inherits": "default",
28
+ "cacheVariables": {
29
+ "CMAKE_BUILD_TYPE": "Debug",
30
+ "CMAKE_CXX_FLAGS": "-g -O0 -DDEBUG"
31
+ }
32
+ },
33
+ {
34
+ "name": "release",
35
+ "displayName": "Release Config",
36
+ "description": "Release build configuration for pybFoam",
37
+ "inherits": "default",
38
+ "cacheVariables": {
39
+ "CMAKE_BUILD_TYPE": "Release",
40
+ "CMAKE_CXX_FLAGS": "-O3 -DNDEBUG"
41
+ }
42
+ },
43
+ {
44
+ "name": "relwithdebinfo",
45
+ "displayName": "Release with Debug Info",
46
+ "description": "Release build with debug information for pybFoam",
47
+ "inherits": "default",
48
+ "cacheVariables": {
49
+ "CMAKE_BUILD_TYPE": "RelWithDebInfo",
50
+ "CMAKE_CXX_FLAGS": "-O2 -g"
51
+ }
52
+ },
53
+ {
54
+ "name": "ninja",
55
+ "displayName": "Ninja Build",
56
+ "description": "Fast build using Ninja generator",
57
+ "inherits": "default",
58
+ "generator": "Ninja",
59
+ "cacheVariables": {
60
+ "CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
61
+ }
62
+ },
63
+ {
64
+ "name": "clang",
65
+ "displayName": "Clang Build",
66
+ "description": "Build with Clang compiler",
67
+ "inherits": "default",
68
+ "cacheVariables": {
69
+ "CMAKE_CXX_COMPILER": "clang++",
70
+ "CMAKE_C_COMPILER": "clang"
71
+ }
72
+ },
73
+ {
74
+ "name": "offline",
75
+ "displayName": "Offline Build",
76
+ "description": "Build without downloading dependencies",
77
+ "inherits": "default",
78
+ "cacheVariables": {
79
+ "CPM_USE_LOCAL_PACKAGES": "ON",
80
+ "CPM_LOCAL_PACKAGES_ONLY": "ON"
81
+ }
82
+ },
83
+ {
84
+ "name": "no-cache",
85
+ "displayName": "No Cache Build",
86
+ "description": "Build without using CPM cache",
87
+ "inherits": "default",
88
+ "cacheVariables": {
89
+ "CPM_SOURCE_CACHE": ""
90
+ }
91
+ }
92
+ ],
93
+ "buildPresets": [
94
+ {
95
+ "name": "default",
96
+ "configurePreset": "default",
97
+ "displayName": "Default Build",
98
+ "description": "Build with default settings"
99
+ },
100
+ {
101
+ "name": "debug",
102
+ "configurePreset": "debug",
103
+ "displayName": "Debug Build",
104
+ "description": "Build in debug mode"
105
+ },
106
+ {
107
+ "name": "release",
108
+ "configurePreset": "release",
109
+ "displayName": "Release Build",
110
+ "description": "Build in release mode"
111
+ },
112
+ {
113
+ "name": "ninja",
114
+ "configurePreset": "ninja",
115
+ "displayName": "Ninja Build",
116
+ "description": "Fast build using Ninja"
117
+ },
118
+ {
119
+ "name": "parallel",
120
+ "configurePreset": "default",
121
+ "displayName": "Parallel Build",
122
+ "description": "Build with maximum parallelism",
123
+ "jobs": 0
124
+ }
125
+ ],
126
+ "testPresets": [
127
+ {
128
+ "name": "default",
129
+ "configurePreset": "default",
130
+ "displayName": "Default Test",
131
+ "description": "Run all tests"
132
+ },
133
+ {
134
+ "name": "verbose",
135
+ "configurePreset": "default",
136
+ "displayName": "Verbose Test",
137
+ "description": "Run tests with verbose output",
138
+ "output": {
139
+ "verbosity": "verbose"
140
+ }
141
+ }
142
+ ]
143
+ }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pybFoam
3
- Version: 0.1.10
3
+ Version: 0.1.11
4
4
  Summary: python bindings for OpenFOAM
5
5
  Keywords: OpenFOAM,simulation,CFD
6
6
  Author-Email: Henning Scheufler <henning.scheufler@web.de>
@@ -12,7 +12,6 @@ Classifier: Intended Audience :: Science/Research
12
12
  Classifier: Natural Language :: English
13
13
  Classifier: Programming Language :: C++
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
- Classifier: Programming Language :: Python :: 3.8
16
15
  Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
@@ -21,7 +20,7 @@ Classifier: Topic :: Scientific/Engineering
21
20
  Project-URL: Homepage, https://github.com/HenningScheufler/pybFoam
22
21
  Project-URL: Repository, https://github.com/HenningScheufler/pybFoam.git
23
22
  Project-URL: Issues, https://github.com/HenningScheufler/pybFoam/issues
24
- Requires-Python: >=3.8
23
+ Requires-Python: >=3.9
25
24
  Requires-Dist: numpy>=1.20
26
25
  Requires-Dist: pybind11>=2.6.0
27
26
  Requires-Dist: pydantic
@@ -30,14 +29,14 @@ Provides-Extra: dev
30
29
  Requires-Dist: pytest>=6.0; extra == "dev"
31
30
  Requires-Dist: pytest-cov; extra == "dev"
32
31
  Requires-Dist: pytest-xdist; extra == "dev"
33
- Requires-Dist: black; extra == "dev"
34
- Requires-Dist: flake8; extra == "dev"
35
- Requires-Dist: isort; extra == "dev"
32
+ Requires-Dist: ruff>=0.14.2; extra == "dev"
36
33
  Requires-Dist: mypy; extra == "dev"
37
34
  Requires-Dist: cmake>=3.18; extra == "dev"
38
35
  Requires-Dist: pybind11-stubgen>=2.5; extra == "dev"
39
36
  Requires-Dist: mypy; extra == "dev"
40
37
  Requires-Dist: types-PyYAML; extra == "dev"
38
+ Requires-Dist: poethepoet>=0.37.0; extra == "dev"
39
+ Requires-Dist: pre-commit; extra == "dev"
41
40
  Provides-Extra: docs
42
41
  Requires-Dist: sphinx>=4.0; extra == "docs"
43
42
  Requires-Dist: sphinx-sitemap; extra == "docs"
@@ -74,10 +73,10 @@ Currently in the pre-alpha release state.
74
73
 
75
74
  ## Requirements
76
75
 
77
- - **OpenFOAM**: v2012 or higher (sourced and installed)
78
- - **Python**: 3.8 or higher
76
+ - **OpenFOAM**: v2312 or higher (sourced and installed)
77
+ - **Python**: 3.9 or higher
79
78
  - **CMake**: 3.18 or higher
80
- - **C++ Compiler**: C++17 compatible (GCC 7+, Clang 5+)
79
+ - **C++ Compiler**: C++17 compatible (TBD)
81
80
  - **Build tools**: pybind11, scikit-build-core
82
81
  - **Python packages**: numpy, pydantic
83
82
 
@@ -137,20 +136,20 @@ This script:
137
136
  import pybFoam as pf
138
137
 
139
138
  # Create OpenFOAM time and mesh
140
- time = pf.createTime()
139
+ time = pf.Time(".", ".")
141
140
  mesh = pf.fvMesh(time)
142
141
 
143
142
  # Access fields
144
- p = pf.volScalarField.read_field(mesh, "p")
143
+ p_rgh = pf.volScalarField.read_field(mesh, "p_rgh")
145
144
  U = pf.volVectorField.read_field(mesh, "U")
146
145
 
147
146
  # Compute gradients using finite volume calculus
148
- grad_p = pf.fvc.grad(p)
147
+ grad_p = pf.fvc.grad(p_rgh)
149
148
  div_U = pf.fvc.div(U)
150
149
 
151
150
  # Convert to NumPy arrays for analysis
152
151
  import numpy as np
153
- p_array = np.asarray(p["internalField"])
152
+ p_array = np.asarray(p_rgh["internalField"])
154
153
  print(f"Pressure range: {p_array.min():.3f} to {p_array.max():.3f}")
155
154
  ```
156
155
 
@@ -183,7 +182,7 @@ from pydantic import Field
183
182
 
184
183
  class TransportProperties(IOModelBase):
185
184
  nu: float = Field(..., description="Kinematic viscosity")
186
-
185
+
187
186
  class Config:
188
187
  foam_file_name = "transportProperties"
189
188
 
@@ -225,7 +224,7 @@ pytest tests/test_sampling_models.py # Pydantic config tests
225
224
 
226
225
  ---
227
226
 
228
- ## Documentation
227
+ ## Documentation (outdated)
229
228
 
230
229
  Full documentation is available at: [https://henningscheufler.github.io/pybFoam/](https://henningscheufler.github.io/pybFoam/index.html)
231
230
 
@@ -252,5 +251,3 @@ Full documentation is available at: [https://henningscheufler.github.io/pybFoam/
252
251
  See [LICENSE](LICENSE) file for details.
253
252
 
254
253
  ---
255
-
256
-
@@ -19,10 +19,10 @@ Currently in the pre-alpha release state.
19
19
 
20
20
  ## Requirements
21
21
 
22
- - **OpenFOAM**: v2012 or higher (sourced and installed)
23
- - **Python**: 3.8 or higher
22
+ - **OpenFOAM**: v2312 or higher (sourced and installed)
23
+ - **Python**: 3.9 or higher
24
24
  - **CMake**: 3.18 or higher
25
- - **C++ Compiler**: C++17 compatible (GCC 7+, Clang 5+)
25
+ - **C++ Compiler**: C++17 compatible (TBD)
26
26
  - **Build tools**: pybind11, scikit-build-core
27
27
  - **Python packages**: numpy, pydantic
28
28
 
@@ -82,20 +82,20 @@ This script:
82
82
  import pybFoam as pf
83
83
 
84
84
  # Create OpenFOAM time and mesh
85
- time = pf.createTime()
85
+ time = pf.Time(".", ".")
86
86
  mesh = pf.fvMesh(time)
87
87
 
88
88
  # Access fields
89
- p = pf.volScalarField.read_field(mesh, "p")
89
+ p_rgh = pf.volScalarField.read_field(mesh, "p_rgh")
90
90
  U = pf.volVectorField.read_field(mesh, "U")
91
91
 
92
92
  # Compute gradients using finite volume calculus
93
- grad_p = pf.fvc.grad(p)
93
+ grad_p = pf.fvc.grad(p_rgh)
94
94
  div_U = pf.fvc.div(U)
95
95
 
96
96
  # Convert to NumPy arrays for analysis
97
97
  import numpy as np
98
- p_array = np.asarray(p["internalField"])
98
+ p_array = np.asarray(p_rgh["internalField"])
99
99
  print(f"Pressure range: {p_array.min():.3f} to {p_array.max():.3f}")
100
100
  ```
101
101
 
@@ -128,7 +128,7 @@ from pydantic import Field
128
128
 
129
129
  class TransportProperties(IOModelBase):
130
130
  nu: float = Field(..., description="Kinematic viscosity")
131
-
131
+
132
132
  class Config:
133
133
  foam_file_name = "transportProperties"
134
134
 
@@ -170,7 +170,7 @@ pytest tests/test_sampling_models.py # Pydantic config tests
170
170
 
171
171
  ---
172
172
 
173
- ## Documentation
173
+ ## Documentation (outdated)
174
174
 
175
175
  Full documentation is available at: [https://henningscheufler.github.io/pybFoam/](https://henningscheufler.github.io/pybFoam/index.html)
176
176
 
@@ -197,5 +197,3 @@ Full documentation is available at: [https://henningscheufler.github.io/pybFoam/
197
197
  See [LICENSE](LICENSE) file for details.
198
198
 
199
199
  ---
200
-
201
-
@@ -8,28 +8,30 @@
8
8
  # )
9
9
  import os
10
10
 
11
+
11
12
  def configure_threads(n=1):
12
13
  multi_thread = True if n > 1 else False
13
14
  os.environ["XLA_FLAGS"] = (
14
- f"--xla_cpu_multi_thread_eigen={multi_thread} "
15
- f"intra_op_parallelism_threads={n}"
15
+ f"--xla_cpu_multi_thread_eigen={multi_thread} intra_op_parallelism_threads={n}"
16
16
  )
17
17
  os.environ["NPROC"] = f"{n}"
18
18
  os.environ["OMP_NUM_THREADS"] = str(n)
19
19
  os.environ["MKL_NUM_THREADS"] = str(n)
20
20
  os.environ["OPENBLAS_NUM_THREADS"] = str(n)
21
21
 
22
+
22
23
  configure_threads(1)
23
24
 
24
- from pybFoam import scalarField
25
- import numpy as np
26
25
  import timeit
27
- import time
28
- import pandas as pd
29
- import matplotlib.pyplot as plt
30
- import seaborn as sns
26
+
31
27
  import jax
32
28
  import jax.numpy as jnp
29
+ import matplotlib.pyplot as plt
30
+ import numpy as np
31
+ import pandas as pd
32
+ import seaborn as sns
33
+
34
+ from pybFoam import scalarField
33
35
 
34
36
 
35
37
  def pybfoam_expression(n_elements):
@@ -42,8 +44,10 @@ def pybfoam_expression(n_elements):
42
44
  x = a * b + c
43
45
  y = d - a * c
44
46
  return (x * y + b) / (a + 1.0)
47
+
45
48
  return run
46
49
 
50
+
47
51
  def numpy_expression(n_elements):
48
52
  a = np.full(n_elements, 1.1)
49
53
  b = np.full(n_elements, 2.2)
@@ -57,6 +61,7 @@ def numpy_expression(n_elements):
57
61
 
58
62
  return run
59
63
 
64
+
60
65
  def jax_expression(n_elements):
61
66
  a = jnp.full(n_elements, 1.1)
62
67
  b = jnp.full(n_elements, 2.2)
@@ -71,6 +76,7 @@ def jax_expression(n_elements):
71
76
 
72
77
  return run
73
78
 
79
+
74
80
  vector_add_data = {
75
81
  "n_elements": [],
76
82
  "duration": [],
@@ -78,13 +84,14 @@ vector_add_data = {
78
84
  # "jax": []
79
85
  }
80
86
 
87
+
81
88
  def add_data(n_elements, duration, method):
82
89
  vector_add_data["n_elements"].append(n_elements)
83
90
  vector_add_data["duration"].append(duration)
84
91
  vector_add_data["method"].append(method)
85
92
 
86
- for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
87
93
 
94
+ for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
88
95
  bench = pybfoam_expression(n_elements)
89
96
  n_repeat = 100
90
97
  duration = timeit.timeit(bench, number=n_repeat)
@@ -114,8 +121,10 @@ for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
114
121
 
115
122
 
116
123
  df_vector_add = pd.DataFrame(vector_add_data)
117
- df_vector_add["time_per_element [ns]"] = df_vector_add["duration"] / df_vector_add["n_elements"] * 1e9 # time per element in nanoseconds
118
- print("Vector Addition Benchmark:",df_vector_add)
124
+ df_vector_add["time_per_element [ns]"] = (
125
+ df_vector_add["duration"] / df_vector_add["n_elements"] * 1e9
126
+ ) # time per element in nanoseconds
127
+ print("Vector Addition Benchmark:", df_vector_add)
119
128
 
120
129
  # Save results to CSV
121
130
  df_vector_add.to_csv("results/benchmark_complex.csv", index=False)
@@ -143,7 +152,9 @@ with open("results/benchmark_complex.md", "w") as f:
143
152
 
144
153
  print("Results table saved to: results/benchmark_complex.md")
145
154
 
146
- sns.lineplot(data=df_vector_add, x="n_elements", y="time_per_element [ns]", hue="method", marker="o")
155
+ sns.lineplot(
156
+ data=df_vector_add, x="n_elements", y="time_per_element [ns]", hue="method", marker="o"
157
+ )
147
158
  plt.xscale("log")
148
159
  plt.yscale("log")
149
160
  plt.xlabel("Number of Elements")
@@ -165,5 +176,4 @@ for _, row in timings.iterrows():
165
176
  plt.show()
166
177
 
167
178
 
168
-
169
179
  # %%
@@ -1,27 +1,29 @@
1
1
  import os
2
2
 
3
+
3
4
  def configure_threads(n=1):
4
5
  multi_thread = True if n > 1 else False
5
6
  os.environ["XLA_FLAGS"] = (
6
- f"--xla_cpu_multi_thread_eigen={multi_thread} "
7
- f"intra_op_parallelism_threads={n}"
7
+ f"--xla_cpu_multi_thread_eigen={multi_thread} intra_op_parallelism_threads={n}"
8
8
  )
9
9
  os.environ["NPROC"] = f"{n}"
10
10
  os.environ["OMP_NUM_THREADS"] = str(n)
11
11
  os.environ["MKL_NUM_THREADS"] = str(n)
12
12
  os.environ["OPENBLAS_NUM_THREADS"] = str(n)
13
13
 
14
+
14
15
  configure_threads(1)
15
16
 
16
- from pybFoam import scalarField
17
- import numpy as np
18
- import timeit
19
17
  import time
20
- import pandas as pd
21
- import matplotlib.pyplot as plt
22
- import seaborn as sns
18
+
23
19
  import jax
24
20
  import jax.numpy as jnp
21
+ import matplotlib.pyplot as plt
22
+ import numpy as np
23
+ import pandas as pd
24
+ import seaborn as sns
25
+
26
+ from pybFoam import scalarField
25
27
 
26
28
 
27
29
  def pybfoam_vector_addition(n_elements):
@@ -33,6 +35,7 @@ def pybfoam_vector_addition(n_elements):
33
35
 
34
36
  return run
35
37
 
38
+
36
39
  def numpy_vector_addition(n_elements):
37
40
  a = np.ones(n_elements)
38
41
  b = np.full(n_elements, 2.0)
@@ -42,8 +45,8 @@ def numpy_vector_addition(n_elements):
42
45
 
43
46
  return run
44
47
 
45
- def jax_vector_addition(n_elements):
46
48
 
49
+ def jax_vector_addition(n_elements):
47
50
  a = jnp.ones(n_elements)
48
51
  b = jnp.full(n_elements, 2.0)
49
52
 
@@ -53,22 +56,24 @@ def jax_vector_addition(n_elements):
53
56
 
54
57
  return run
55
58
 
59
+
56
60
  vector_add_data = {
57
61
  "n_elements": [],
58
62
  "duration": [],
59
63
  "method": [],
60
64
  }
61
65
 
66
+
62
67
  def add_data(n_elements, duration, method):
63
68
  vector_add_data["n_elements"].append(n_elements)
64
69
  vector_add_data["duration"].append(duration)
65
70
  vector_add_data["method"].append(method)
66
71
 
67
- for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
68
72
 
73
+ for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
69
74
  bench = pybfoam_vector_addition(n_elements)
70
75
  # duration2 = timeit.timeit(bench, number=1)
71
- t0 = time.perf_counter() # lower overhead than timeit
76
+ t0 = time.perf_counter() # lower overhead than timeit
72
77
  bench()
73
78
  t1 = time.perf_counter()
74
79
  duration = t1 - t0
@@ -76,7 +81,7 @@ for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
76
81
 
77
82
  bench = numpy_vector_addition(n_elements)
78
83
  # duration = timeit.timeit(bench, number=1)
79
- t0 = time.perf_counter() # lower overhead than timeit
84
+ t0 = time.perf_counter() # lower overhead than timeit
80
85
  bench()
81
86
  t1 = time.perf_counter()
82
87
  duration = t1 - t0
@@ -86,7 +91,7 @@ for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
86
91
  # First call to compile
87
92
  bench()
88
93
  # duration = timeit.timeit(bench, number=1)
89
- t0 = time.perf_counter() # lower overhead than timeit
94
+ t0 = time.perf_counter() # lower overhead than timeit
90
95
  bench()
91
96
  t1 = time.perf_counter()
92
97
  duration = t1 - t0
@@ -94,8 +99,10 @@ for n_elements in [10, 100, 1000, 10_000, 100_000, 1_000_000, 10_000_000]:
94
99
 
95
100
 
96
101
  df_vector_add = pd.DataFrame(vector_add_data)
97
- df_vector_add["time_per_element [ns]"] = df_vector_add["duration"] / df_vector_add["n_elements"] * 1e9 # time per element in nanoseconds
98
- print("Vector Addition Benchmark:",df_vector_add)
102
+ df_vector_add["time_per_element [ns]"] = (
103
+ df_vector_add["duration"] / df_vector_add["n_elements"] * 1e9
104
+ ) # time per element in nanoseconds
105
+ print("Vector Addition Benchmark:", df_vector_add)
99
106
 
100
107
  # Save results to CSV
101
108
  df_vector_add.to_csv("results/benchmark_vec_add.csv", index=False)
@@ -119,7 +126,9 @@ with open("results/benchmark_vec_add.md", "w") as f:
119
126
 
120
127
  print("Results table saved to: results/benchmark_vec_add.md")
121
128
 
122
- sns.lineplot(data=df_vector_add, x="n_elements", y="time_per_element [ns]", hue="method", marker="o")
129
+ sns.lineplot(
130
+ data=df_vector_add, x="n_elements", y="time_per_element [ns]", hue="method", marker="o"
131
+ )
123
132
  plt.xscale("log")
124
133
  plt.yscale("log")
125
134
  plt.xlabel("Number of Elements")
@@ -136,5 +145,4 @@ for _, row in timings.iterrows():
136
145
  plt.show()
137
146
 
138
147
 
139
-
140
148
  # %%