forefire 2.5.0__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 (212) hide show
  1. forefire-2.5.0/.dockerignore +44 -0
  2. forefire-2.5.0/.gitattributes +12 -0
  3. forefire-2.5.0/.gitignore +61 -0
  4. forefire-2.5.0/.readthedocs.yaml +22 -0
  5. forefire-2.5.0/CITATION.cff +62 -0
  6. forefire-2.5.0/CMakeLists.txt +373 -0
  7. forefire-2.5.0/CODE_OF_CONDUCT.md +132 -0
  8. forefire-2.5.0/CONTRIBUTING.md +104 -0
  9. forefire-2.5.0/Dockerfile +113 -0
  10. forefire-2.5.0/FUELCOVER.md +88 -0
  11. forefire-2.5.0/LICENSE +674 -0
  12. forefire-2.5.0/PKG-INFO +232 -0
  13. forefire-2.5.0/README.md +206 -0
  14. forefire-2.5.0/TESTING.md +41 -0
  15. forefire-2.5.0/app/forefire/AdvancedLineEditor.cpp +254 -0
  16. forefire-2.5.0/app/forefire/AdvancedLineEditor.hpp +36 -0
  17. forefire-2.5.0/app/forefire/ForeFire.cpp +198 -0
  18. forefire-2.5.0/app/forefire/commands.md +214 -0
  19. forefire-2.5.0/bindings/java/JLibForeFire.cpp +218 -0
  20. forefire-2.5.0/bindings/java/JLibForeFire.h +64 -0
  21. forefire-2.5.0/bindings/python/README.md +203 -0
  22. forefire-2.5.0/bindings/python/src/pyforefire/__init__.py +6 -0
  23. forefire-2.5.0/bindings/python/src/pyforefire/_cli.py +33 -0
  24. forefire-2.5.0/bindings/python/src/pyforefire/_pyforefire.cpp +400 -0
  25. forefire-2.5.0/bindings/python/src/pyforefire/_pyforefire.h +60 -0
  26. forefire-2.5.0/bindings/python/src/pyforefire/helpers.py +679 -0
  27. forefire-2.5.0/cmake-build.sh +16 -0
  28. forefire-2.5.0/install-forefire-osx.sh +86 -0
  29. forefire-2.5.0/install-forefire.sh +79 -0
  30. forefire-2.5.0/pyproject.toml +110 -0
  31. forefire-2.5.0/src/ArrayDataLayer.h +565 -0
  32. forefire-2.5.0/src/BurningMap.cpp +144 -0
  33. forefire-2.5.0/src/BurningMap.h +80 -0
  34. forefire-2.5.0/src/BurningMapLayer.h +182 -0
  35. forefire-2.5.0/src/BurningRatioLayer.h +194 -0
  36. forefire-2.5.0/src/CLibForeFire.cpp +739 -0
  37. forefire-2.5.0/src/CLibForeFire.h +72 -0
  38. forefire-2.5.0/src/Command.cpp +3751 -0
  39. forefire-2.5.0/src/Command.h +302 -0
  40. forefire-2.5.0/src/DataBroker.cpp +1645 -0
  41. forefire-2.5.0/src/DataBroker.h +306 -0
  42. forefire-2.5.0/src/DataLayer.h +83 -0
  43. forefire-2.5.0/src/EventCommand.cpp +47 -0
  44. forefire-2.5.0/src/EventCommand.h +50 -0
  45. forefire-2.5.0/src/FDCell.cpp +437 -0
  46. forefire-2.5.0/src/FDCell.h +155 -0
  47. forefire-2.5.0/src/FFArrays.h +405 -0
  48. forefire-2.5.0/src/FFEvent.cpp +144 -0
  49. forefire-2.5.0/src/FFEvent.h +59 -0
  50. forefire-2.5.0/src/FFPoint.cpp +221 -0
  51. forefire-2.5.0/src/FFPoint.h +126 -0
  52. forefire-2.5.0/src/FFVector.cpp +176 -0
  53. forefire-2.5.0/src/FFVector.h +110 -0
  54. forefire-2.5.0/src/FireDomain.cpp +3620 -0
  55. forefire-2.5.0/src/FireDomain.h +641 -0
  56. forefire-2.5.0/src/FireFront.cpp +1146 -0
  57. forefire-2.5.0/src/FireFront.h +185 -0
  58. forefire-2.5.0/src/FireFrontData.cpp +92 -0
  59. forefire-2.5.0/src/FireFrontData.h +51 -0
  60. forefire-2.5.0/src/FireNode.cpp +762 -0
  61. forefire-2.5.0/src/FireNode.h +300 -0
  62. forefire-2.5.0/src/FireNodeData.cpp +70 -0
  63. forefire-2.5.0/src/FireNodeData.h +52 -0
  64. forefire-2.5.0/src/FluxLayer.h +434 -0
  65. forefire-2.5.0/src/FluxModel.cpp +33 -0
  66. forefire-2.5.0/src/FluxModel.h +37 -0
  67. forefire-2.5.0/src/ForeFireAtom.h +125 -0
  68. forefire-2.5.0/src/ForeFireModel.cpp +40 -0
  69. forefire-2.5.0/src/ForeFireModel.h +57 -0
  70. forefire-2.5.0/src/FuelDataLayer.h +335 -0
  71. forefire-2.5.0/src/GradientDataLayer.h +155 -0
  72. forefire-2.5.0/src/HttpCommandServer.hpp +327 -0
  73. forefire-2.5.0/src/MultiplicativeLayer.h +190 -0
  74. forefire-2.5.0/src/NCXYZTDataLayer.h +552 -0
  75. forefire-2.5.0/src/ParallelData.cpp +43 -0
  76. forefire-2.5.0/src/ParallelData.h +36 -0
  77. forefire-2.5.0/src/ParallelException.cpp +34 -0
  78. forefire-2.5.0/src/ParallelException.h +48 -0
  79. forefire-2.5.0/src/PropagationModel.cpp +32 -0
  80. forefire-2.5.0/src/PropagationModel.h +37 -0
  81. forefire-2.5.0/src/PropagativeLayer.h +286 -0
  82. forefire-2.5.0/src/RosLayer.h +180 -0
  83. forefire-2.5.0/src/SimulationParameters.cpp +753 -0
  84. forefire-2.5.0/src/SimulationParameters.h +86 -0
  85. forefire-2.5.0/src/Simulator.cpp +63 -0
  86. forefire-2.5.0/src/Simulator.h +55 -0
  87. forefire-2.5.0/src/StringRepresentation.cpp +385 -0
  88. forefire-2.5.0/src/StringRepresentation.h +70 -0
  89. forefire-2.5.0/src/TimeGradientDataLayer.h +133 -0
  90. forefire-2.5.0/src/TimeTable.cpp +217 -0
  91. forefire-2.5.0/src/TimeTable.h +94 -0
  92. forefire-2.5.0/src/TwoTimeArrayLayer.h +369 -0
  93. forefire-2.5.0/src/Visitable.h +39 -0
  94. forefire-2.5.0/src/Visitor.h +60 -0
  95. forefire-2.5.0/src/WeatherDataLayer.h +527 -0
  96. forefire-2.5.0/src/colormap.h +2883 -0
  97. forefire-2.5.0/src/flux/BurnupHeatFluxModel.cpp +118 -0
  98. forefire-2.5.0/src/flux/CraterHeatFluxModel.cpp +173 -0
  99. forefire-2.5.0/src/flux/CraterVaporFluxModel.cpp +129 -0
  100. forefire-2.5.0/src/flux/FactorChemFluxModel.cpp +137 -0
  101. forefire-2.5.0/src/flux/ForeFireV1HeatFluxModel.cpp +172 -0
  102. forefire-2.5.0/src/flux/ForeFireV1VaporFluxModel.cpp +170 -0
  103. forefire-2.5.0/src/flux/FromObsModels.h +30 -0
  104. forefire-2.5.0/src/flux/HeatFluxBasicModel.cpp +144 -0
  105. forefire-2.5.0/src/flux/HeatFluxFromObsModel.cpp +186 -0
  106. forefire-2.5.0/src/flux/HeatFluxNominalModel.cpp +121 -0
  107. forefire-2.5.0/src/flux/LavaSO2FluxModel.cpp +134 -0
  108. forefire-2.5.0/src/flux/ScalarFluxNominalModel.cpp +122 -0
  109. forefire-2.5.0/src/flux/ScalarFromObsModel.cpp +145 -0
  110. forefire-2.5.0/src/flux/SpottingFluxBasicModel.cpp +130 -0
  111. forefire-2.5.0/src/flux/VaporFluxBasicModel.cpp +122 -0
  112. forefire-2.5.0/src/flux/VaporFluxFromObsModel.cpp +134 -0
  113. forefire-2.5.0/src/flux/VaporFluxNominalModel.cpp +121 -0
  114. forefire-2.5.0/src/include/FFConstants.h +28 -0
  115. forefire-2.5.0/src/include/Futils.h +27 -0
  116. forefire-2.5.0/src/include/Version.h +3 -0
  117. forefire-2.5.0/src/propagation/ANN.h +241 -0
  118. forefire-2.5.0/src/propagation/ANNPropagationModel.cpp +118 -0
  119. forefire-2.5.0/src/propagation/BMapLoggerForANNTraining.cpp +116 -0
  120. forefire-2.5.0/src/propagation/Balbi2015.cpp +212 -0
  121. forefire-2.5.0/src/propagation/Balbi2020.cpp +276 -0
  122. forefire-2.5.0/src/propagation/BalbiNov2011.cpp +221 -0
  123. forefire-2.5.0/src/propagation/BalbiNov2011Curv.cpp +208 -0
  124. forefire-2.5.0/src/propagation/BalbiNov2011TMdMl.cpp +229 -0
  125. forefire-2.5.0/src/propagation/BalbiUnsteady.cpp +218 -0
  126. forefire-2.5.0/src/propagation/CurvatureDrivenPropagationModel.cpp +84 -0
  127. forefire-2.5.0/src/propagation/FarsitePropagationModel.cpp +488 -0
  128. forefire-2.5.0/src/propagation/FrontDepthDrivenPropagationModel.cpp +79 -0
  129. forefire-2.5.0/src/propagation/IsotropicFuelPropagationModel.cpp +72 -0
  130. forefire-2.5.0/src/propagation/IsotropicIsospeed.cpp +91 -0
  131. forefire-2.5.0/src/propagation/LavaPropagationModel.cpp +140 -0
  132. forefire-2.5.0/src/propagation/Rothermel.cpp +256 -0
  133. forefire-2.5.0/src/propagation/RothermelAndrews2018.cpp +174 -0
  134. forefire-2.5.0/src/propagation/SamplePropagationModel.cpp +71 -0
  135. forefire-2.5.0/src/propagation/TroisPourcent.cpp +72 -0
  136. forefire-2.5.0/src/propagation/TroisPourcent.h +52 -0
  137. forefire-2.5.0/src/propagation/WindDrivenPropagationModel.cpp +75 -0
  138. forefire-2.5.0/src/stb_image_write.h +1724 -0
  139. forefire-2.5.0/tests/python/test_wheel.py +96 -0
  140. forefire-2.5.0/tools/3nestFFCASE/000_ARCH/2MHGETECMWFBC +43 -0
  141. forefire-2.5.0/tools/3nestFFCASE/000_ARCH/FFMNH.yml +122 -0
  142. forefire-2.5.0/tools/3nestFFCASE/000_ARCH/GETECMWFBC +43 -0
  143. forefire-2.5.0/tools/3nestFFCASE/000_ARCH/JOBARCHIVE +36 -0
  144. forefire-2.5.0/tools/3nestFFCASE/001_pgd/MAKE_PGD +136 -0
  145. forefire-2.5.0/tools/3nestFFCASE/001_pgd/RUN_PGD +39 -0
  146. forefire-2.5.0/tools/3nestFFCASE/001_pgd/cleanDir +7 -0
  147. forefire-2.5.0/tools/3nestFFCASE/002_real/MAKE_PREAL +42 -0
  148. forefire-2.5.0/tools/3nestFFCASE/002_real/RUN_REAL +37 -0
  149. forefire-2.5.0/tools/3nestFFCASE/002_real/cleanDir +7 -0
  150. forefire-2.5.0/tools/3nestFFCASE/003_run/MAKE_RUN1 +68 -0
  151. forefire-2.5.0/tools/3nestFFCASE/003_run/RUN_MESONH_120p +31 -0
  152. forefire-2.5.0/tools/3nestFFCASE/003_run/cleanDir +9 -0
  153. forefire-2.5.0/tools/3nestFFCASE/004_SpawnReal/MAKE_SPAWNREAL +48 -0
  154. forefire-2.5.0/tools/3nestFFCASE/004_SpawnReal/RUN_SPAWN_REAL +31 -0
  155. forefire-2.5.0/tools/3nestFFCASE/004_SpawnReal/cleanDir +10 -0
  156. forefire-2.5.0/tools/3nestFFCASE/005_SpawnReal/MAKE_SPAWNREAL23 +46 -0
  157. forefire-2.5.0/tools/3nestFFCASE/005_SpawnReal/RUN_SPAWN_REAL +31 -0
  158. forefire-2.5.0/tools/3nestFFCASE/005_SpawnReal/cleanDir +10 -0
  159. forefire-2.5.0/tools/3nestFFCASE/006_runff/ForeFire/Params.ff +11 -0
  160. forefire-2.5.0/tools/3nestFFCASE/006_runff/ForeFire/fuels.ff +16 -0
  161. forefire-2.5.0/tools/3nestFFCASE/006_runff/ForeFire/run.ff +17 -0
  162. forefire-2.5.0/tools/3nestFFCASE/006_runff/MAKE_RUNFF +149 -0
  163. forefire-2.5.0/tools/3nestFFCASE/006_runff/RUN_MNH_100p +50 -0
  164. forefire-2.5.0/tools/3nestFFCASE/006_runff/cleanDir +23 -0
  165. forefire-2.5.0/tools/3nestFFCASE/006_runff/sbatchRunVtkFilesM1 +36 -0
  166. forefire-2.5.0/tools/3nestFFCASE/006_runff/sbatchRunVtkFilesM2 +37 -0
  167. forefire-2.5.0/tools/3nestFFCASE/006_runff/sbatchRunVtkFilesM3 +36 -0
  168. forefire-2.5.0/tools/3nestFFCASE/RESULTS/README.md +1 -0
  169. forefire-2.5.0/tools/3nestFFCASE/makeRunFromTemplate +40 -0
  170. forefire-2.5.0/tools/README.md +224 -0
  171. forefire-2.5.0/tools/TODO.md +18 -0
  172. forefire-2.5.0/tools/check_all_lfs.bash +102 -0
  173. forefire-2.5.0/tools/devops/increment-version.yml +28 -0
  174. forefire-2.5.0/tools/devops/install-netcdf-manylinux.sh +51 -0
  175. forefire-2.5.0/tools/increment-version.sh +22 -0
  176. forefire-2.5.0/tools/makeColormapH.py +220 -0
  177. forefire-2.5.0/tools/postprocessing/MNHCDF_to_FFNC_atmodataset.py +912 -0
  178. forefire-2.5.0/tools/postprocessing/__init__.py +11 -0
  179. forefire-2.5.0/tools/postprocessing/atmo_fire_plotsFrom.py +654 -0
  180. forefire-2.5.0/tools/postprocessing/bmapToVTK.py +856 -0
  181. forefire-2.5.0/tools/postprocessing/diag_arrays.py +60 -0
  182. forefire-2.5.0/tools/postprocessing/extractSurfaceInXarray.py +146 -0
  183. forefire-2.5.0/tools/postprocessing/genDomain.py +107 -0
  184. forefire-2.5.0/tools/postprocessing/pMNHFF2VTK.py +1250 -0
  185. forefire-2.5.0/tools/postprocessing/pMNHFF2vdb.py +707 -0
  186. forefire-2.5.0/tools/postprocessing/pMNHFF2vti.py +732 -0
  187. forefire-2.5.0/tools/postprocessing/sciplots.py +217 -0
  188. forefire-2.5.0/tools/postprocessing/sounding.py +343 -0
  189. forefire-2.5.0/tools/preflight/verify-lfs.sh +45 -0
  190. forefire-2.5.0/tools/preprocessing/PGD2Init.py +84 -0
  191. forefire-2.5.0/tools/preprocessing/PRE_IDEA1.pattern +41 -0
  192. forefire-2.5.0/tools/preprocessing/READMEscripts.md +104 -0
  193. forefire-2.5.0/tools/preprocessing/clickImageToLocation.py +157 -0
  194. forefire-2.5.0/tools/preprocessing/extract_from_eu_land_cover.py +695 -0
  195. forefire-2.5.0/tools/preprocessing/ffToGeoJson.py +971 -0
  196. forefire-2.5.0/tools/preprocessing/fireObs2ATime.py +124 -0
  197. forefire-2.5.0/tools/preprocessing/genPrepIdeal.py +58 -0
  198. forefire-2.5.0/tools/preprocessing/geo_to_kml.py +224 -0
  199. forefire-2.5.0/tools/preprocessing/getBGFromCFCase.py +147 -0
  200. forefire-2.5.0/tools/preprocessing/indexRVB.html +173 -0
  201. forefire-2.5.0/tools/preprocessing/kmlDomain.py +102 -0
  202. forefire-2.5.0/tools/preprocessing/learnFuelTifPng.py +263 -0
  203. forefire-2.5.0/tools/preprocessing/lidar2fuel.py +977 -0
  204. forefire-2.5.0/tools/preprocessing/pngs2bmap.py +190 -0
  205. forefire-2.5.0/tools/preprocessing/prealCF2Case.py +229 -0
  206. forefire-2.5.0/tools/preprocessing/satImage2fuel.py +347 -0
  207. forefire-2.5.0/tools/preprocessing/tifToPngFuel.py +53 -0
  208. forefire-2.5.0/tools/preprocessing/upDirHDR.py +295 -0
  209. forefire-2.5.0/tools/processing/plotFireFiles.py +19 -0
  210. forefire-2.5.0/tools/processing/plotcontour.py +401 -0
  211. forefire-2.5.0/tools/runANN/ANNTest.cpp +84 -0
  212. forefire-2.5.0/tools/sampleUses.py +356 -0
@@ -0,0 +1,44 @@
1
+ # ignore .git and .cache folders
2
+ .git
3
+ .cache
4
+ .gitignore
5
+
6
+ # Local build artifacts
7
+ build/
8
+ bin/
9
+ lib/
10
+
11
+ # ignore test files
12
+ *.json
13
+ *.geojson
14
+
15
+ # Docker files (usually not needed inside the image)
16
+ Dockerfile
17
+ .dockerignore
18
+
19
+ # Python virtual environments and cache
20
+ .venv/
21
+ venv/
22
+ docs
23
+ __pycache__/
24
+ *.pyc
25
+ *.pyo
26
+
27
+ # Documentation build output
28
+ docs/build/
29
+ docs/doxygen/html/
30
+ docs/doxygen/xml/
31
+
32
+ # IDE configuration files
33
+ .vscode/
34
+ .idea/
35
+ *.suo
36
+ *.user
37
+
38
+ # OS generated files
39
+ .DS_Store
40
+ Thumbs.db
41
+
42
+ # Log files / temporary files
43
+ *.log
44
+ *.tmp
@@ -0,0 +1,12 @@
1
+
2
+ # handles large files via git-lfs
3
+ *.ref filter=lfs diff=lfs merge=lfs -text
4
+
5
+ # handles lf and crlf for those using git on windows with wsl
6
+ * text=auto
7
+ *.sh text eol=lf
8
+ *.bash text eol=lf
9
+ *.csv text eol=lf
10
+
11
+ # makes ipynb extension not detectable by linguist
12
+ *.ipynb linguist-detectable=false
@@ -0,0 +1,61 @@
1
+ #Ignoring files and folders by github
2
+
3
+ #build directories
4
+ bin
5
+ build
6
+ lib
7
+ sconsbuild
8
+ local
9
+ tools/cache
10
+ tools/cmaps
11
+ bindings/python/src/pyforefire.egg-info
12
+ paper/jats
13
+ #python packaging
14
+ dist
15
+ wheelhouse
16
+ *.egg-info
17
+ #python
18
+ __pycache__
19
+ venv
20
+ # compilation files
21
+ *.dblite
22
+ *.o
23
+ *.so
24
+
25
+ # editors
26
+ .vscode
27
+
28
+ #mac files
29
+ **/.DS_Store
30
+
31
+ # jupyter notebooks checkpoints
32
+ .ipynb_checkpoints
33
+
34
+ #docs
35
+ docs/doxygen/xml
36
+ docs/doxygen/html
37
+
38
+ # build
39
+ # Do not ignore CMakeLists.txt here: it is tracked, and ignoring it makes
40
+ # packaging tools drop it from the sdist.
41
+ build.sh
42
+
43
+ #tools
44
+ tools/postprocessing/loadInParaview.py
45
+ tests/config_firecast_local.bash
46
+ tools/config_firecast_local.bash
47
+ tools/ai
48
+ changeLicense.py
49
+ httpConnectInfo.txt
50
+
51
+ #tests
52
+ tests/python/FF_FS4roslog.csv
53
+ tests/python/ros_computation.py
54
+ tests/python/ros_sampling.py
55
+ tests/python/test_logdb.csv
56
+ tests/runff/altitude.png
57
+ tests/runff/httpConnectInfo.txt
58
+ tests/python/log.txt
59
+ tests/python/runROS.bash
60
+ simulation_result.geojson
61
+ paper/paper.pdf
@@ -0,0 +1,22 @@
1
+ # Read the Docs configuration file
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+ version: 2
4
+
5
+ build:
6
+ os: ubuntu-24.04
7
+ tools:
8
+ python: "3.10"
9
+ apt_packages:
10
+ - doxygen
11
+
12
+ jobs:
13
+ pre_build: # Run doxygen first, assuming Doxyfile is in docs/doxygen
14
+ - "doxygen docs/doxygen/Doxyfile"
15
+
16
+ sphinx:
17
+ configuration: docs/source/conf.py
18
+
19
+
20
+ python:
21
+ install:
22
+ - requirements: docs/source/requirements.txt
@@ -0,0 +1,62 @@
1
+ cff-version: "1.2.0"
2
+ authors:
3
+ - family-names: Filippi
4
+ given-names: Jean-Baptiste
5
+ orcid: "https://orcid.org/0000-0002-6244-0648"
6
+ - family-names: Baggio
7
+ given-names: Roberta
8
+ orcid: "https://orcid.org/0000-0003-1531-0530"
9
+ - family-names: Paugam
10
+ given-names: Ronan
11
+ orcid: "https://orcid.org/0000-0001-6429-6910"
12
+ - family-names: Bosseur
13
+ given-names: Frédéric
14
+ orcid: "https://orcid.org/0000-0002-8108-0887"
15
+ - family-names: Leblanc
16
+ given-names: Antonio
17
+ orcid: "https://orcid.org/0009-0001-9043-2039"
18
+ - family-names: Alonso-Pinar
19
+ given-names: Alberto
20
+ orcid: "https://orcid.org/0009-0009-2051-9700"
21
+ contact:
22
+ - family-names: Filippi
23
+ given-names: Jean-Baptiste
24
+ orcid: "https://orcid.org/0000-0002-6244-0648"
25
+ doi: 10.5281/zenodo.17742375
26
+ message: If you use this software, please cite our article in the
27
+ Journal of Open Source Software.
28
+ preferred-citation:
29
+ authors:
30
+ - family-names: Filippi
31
+ given-names: Jean-Baptiste
32
+ orcid: "https://orcid.org/0000-0002-6244-0648"
33
+ - family-names: Baggio
34
+ given-names: Roberta
35
+ orcid: "https://orcid.org/0000-0003-1531-0530"
36
+ - family-names: Paugam
37
+ given-names: Ronan
38
+ orcid: "https://orcid.org/0000-0001-6429-6910"
39
+ - family-names: Bosseur
40
+ given-names: Frédéric
41
+ orcid: "https://orcid.org/0000-0002-8108-0887"
42
+ - family-names: Leblanc
43
+ given-names: Antonio
44
+ orcid: "https://orcid.org/0009-0001-9043-2039"
45
+ - family-names: Alonso-Pinar
46
+ given-names: Alberto
47
+ orcid: "https://orcid.org/0009-0009-2051-9700"
48
+ date-published: 2025-12-05
49
+ doi: 10.21105/joss.08680
50
+ issn: 2475-9066
51
+ issue: 116
52
+ journal: Journal of Open Source Software
53
+ publisher:
54
+ name: Open Journals
55
+ start: 8680
56
+ title: "ForeFire: A Modular, Scriptable C++ Simulation Engine and
57
+ Library for Wildland-Fire Spread"
58
+ type: article
59
+ url: "https://joss.theoj.org/papers/10.21105/joss.08680"
60
+ volume: 10
61
+ title: "ForeFire: A Modular, Scriptable C++ Simulation Engine and
62
+ Library for Wildland-Fire Spread"
@@ -0,0 +1,373 @@
1
+ cmake_minimum_required(VERSION 3.15)
2
+
3
+ # ----------------------------------
4
+ # Version (single source of truth: src/include/Version.h)
5
+ # ----------------------------------
6
+ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/src/include/Version.h" _ff_version_header)
7
+ string(REGEX MATCH "ff_version[ \t]*=[ \t]*\"v?([0-9]+\\.[0-9]+\\.[0-9]+)\"" _ff_version_match "${_ff_version_header}")
8
+ if(NOT _ff_version_match)
9
+ message(FATAL_ERROR "Could not parse ff_version from src/include/Version.h")
10
+ endif()
11
+ set(FOREFIRE_VERSION "${CMAKE_MATCH_1}")
12
+
13
+ project(forefire VERSION ${FOREFIRE_VERSION})
14
+ message(STATUS "ForeFire version: ${FOREFIRE_VERSION}")
15
+
16
+ # ----------------------------------
17
+ # Build Options
18
+ # ----------------------------------
19
+ # `SKBUILD` is defined when CMake is driven by scikit-build-core, i.e. when a
20
+ # Python wheel is being built. Wheels have to run on machines other than the
21
+ # builder, so they default to no `-march=native` (which would otherwise crash
22
+ # with SIGILL on older CPUs) and no MPI, since auto-detected MPI support is a
23
+ # build-environment accident rather than a user choice (see issue #102).
24
+ # Every default below can still be overridden explicitly, through
25
+ # `tool.scikit-build.cmake.define` or -D on the command line.
26
+ if(DEFINED SKBUILD)
27
+ set(_ff_wheel_build ON)
28
+ set(_ff_default_mpi OFF)
29
+ set(_ff_default_native OFF)
30
+ set(_ff_default_python ON)
31
+ set(_ff_default_static ON)
32
+ set(_ff_default_tools OFF)
33
+ set(_ff_default_lfs OFF)
34
+ else()
35
+ set(_ff_wheel_build OFF)
36
+ set(_ff_default_mpi ON)
37
+ set(_ff_default_native ON)
38
+ set(_ff_default_python OFF)
39
+ set(_ff_default_static OFF)
40
+ set(_ff_default_tools ON)
41
+ set(_ff_default_lfs ON)
42
+ endif()
43
+
44
+ option(FOREFIRE_ENABLE_MPI "Enable MPI coupling when MPI is available" ${_ff_default_mpi})
45
+ option(FOREFIRE_NATIVE_ARCH "Optimise for the build machine's CPU (-march=native)" ${_ff_default_native})
46
+ option(FOREFIRE_BUILD_PYTHON "Build the pyforefire Python extension module" ${_ff_default_python})
47
+ option(FOREFIRE_STATIC_CORE "Build the ForeFire core as a static library" ${_ff_default_static})
48
+ option(FOREFIRE_BUILD_TOOLS "Build the ANN_test helper executable" ${_ff_default_tools})
49
+ option(FOREFIRE_CHECK_LFS "Run the Git LFS data integrity check at configure time" ${_ff_default_lfs})
50
+
51
+ # ----------------------------------
52
+ # Set C++ Standard
53
+ # ----------------------------------
54
+ set(CMAKE_CXX_STANDARD 11)
55
+ set(CMAKE_CXX_STANDARD_REQUIRED ON)
56
+
57
+ # ----------------------------------
58
+ # MPI Detection
59
+ # ----------------------------------
60
+ if(NOT FOREFIRE_ENABLE_MPI)
61
+ message(STATUS "MPI support disabled (FOREFIRE_ENABLE_MPI=OFF)")
62
+ set(MPI_FOUND FALSE)
63
+ elseif(MPI_C_COMPILER AND MPI_CXX_COMPILER)
64
+ message(STATUS "Using manually specified MPI compilers:")
65
+ message(STATUS " MPI_C_COMPILER: ${MPI_C_COMPILER}")
66
+ message(STATUS " MPI_CXX_COMPILER: ${MPI_CXX_COMPILER}")
67
+ set(CMAKE_C_COMPILER "${MPI_C_COMPILER}")
68
+ set(CMAKE_CXX_COMPILER "${MPI_CXX_COMPILER}")
69
+
70
+ if(MPI_C_LIBRARIES)
71
+ link_directories(${MPI_C_LIBRARIES})
72
+ endif()
73
+
74
+ if(MPI_CXX_LIBRARIES)
75
+ link_directories(${MPI_CXX_LIBRARIES})
76
+ endif()
77
+
78
+ set(MPI_FOUND TRUE)
79
+ else()
80
+ find_package(MPI)
81
+ if(MPI_FOUND)
82
+ message(STATUS "MPI found via find_package")
83
+ include_directories(${MPI_INCLUDE_PATH})
84
+ else()
85
+ # Try to detect MPI installation from environment variables like MPI_HOME, MPI_ROOT, or any *MPI*ROOT*
86
+ set(_mpi_env_vars)
87
+ foreach(_var_name IN LISTS ENV)
88
+ string(TOUPPER "${_var_name}" _upper_name)
89
+ if(_upper_name MATCHES "MPI_HOME|MPI_ROOT|.*MPI.*ROOT.*")
90
+ list(APPEND _mpi_env_vars "${_var_name}")
91
+ endif()
92
+ endforeach()
93
+
94
+ set(_mpi_found_env_var "")
95
+ foreach(_mpi_env_var ${_mpi_env_vars})
96
+ if(DEFINED ENV{${_mpi_env_var}})
97
+ set(_mpi_found_env_var "${_mpi_env_var}")
98
+ break()
99
+ endif()
100
+ endforeach()
101
+
102
+ if(_mpi_found_env_var)
103
+ set(HEREMPI $ENV{${_mpi_found_env_var}})
104
+ message(STATUS "Detected MPI environment variable: ${_mpi_found_env_var} = ${HEREMPI}")
105
+ set(MPI_C_COMPILER "${HEREMPI}/bin/mpicc")
106
+ set(MPI_CXX_COMPILER "${HEREMPI}/bin/mpicxx")
107
+ set(MPI_C_LIBRARIES "${HEREMPI}/lib/release/libmpi.so")
108
+ set(MPI_CXX_LIBRARIES "${HEREMPI}/lib/libmpicxx.so")
109
+ set(MPI_INCLUDE_PATH "${HEREMPI}/include")
110
+ set(CMAKE_C_COMPILER "${MPI_C_COMPILER}")
111
+ set(CMAKE_CXX_COMPILER "${MPI_CXX_COMPILER}")
112
+ link_directories("${HEREMPI}/lib" "${HEREMPI}/lib/release")
113
+ include_directories("${MPI_INCLUDE_PATH}")
114
+ message(STATUS "Set MPI_C_COMPILER: ${MPI_C_COMPILER}")
115
+ message(STATUS "Set MPI_CXX_COMPILER: ${MPI_CXX_COMPILER}")
116
+ message(STATUS "Set MPI_C_LIBRARIES: ${MPI_C_LIBRARIES}")
117
+ message(STATUS "Set MPI_CXX_LIBRARIES: ${MPI_CXX_LIBRARIES}")
118
+ message(STATUS "Set MPI_INCLUDE_PATH: ${MPI_INCLUDE_PATH}")
119
+ set(MPI_FOUND TRUE)
120
+ else()
121
+ message(WARNING "No suitable MPI environment variable (e.g., MPI_HOME, MPI_ROOT, *MPI*ROOT*) found. Please specify MPI paths manually with -DMPI_C_COMPILER, -DMPI_CXX_COMPILER, -DMPI_C_LIBRARIES, -DMPI_CXX_LIBRARIES, -DMPI_INCLUDE_PATH.")
122
+ endif()
123
+ endif()
124
+ endif()
125
+
126
+ # ----------------------------------
127
+ # NetCDF Dependency
128
+ # ----------------------------------
129
+ # Everything that needs NetCDF links against this interface target, so the
130
+ # detection logic below lives in exactly one place.
131
+ add_library(forefire_netcdf INTERFACE)
132
+
133
+ if(DEFINED ENV{SRC_MESONH} AND DEFINED ENV{XYZ} AND DEFINED ENV{FF_STATIC})
134
+ message(STATUS "MESONH and XYZ environment variables are set. FF_STATIC too, static NetCDF.")
135
+ set(MESONH $ENV{SRC_MESONH})
136
+ set(XYZ $ENV{XYZ})
137
+ file(GLOB NETCDF_DIR "${MESONH}/src/dir_obj${XYZ}/MASTER/NETCDF-*")
138
+ if(NETCDF_DIR)
139
+ list(GET NETCDF_DIR 0 NETCDF_HOME)
140
+ message(STATUS "Detected NETCDF_HOME: ${NETCDF_HOME}")
141
+ else()
142
+ message(FATAL_ERROR "No NETCDF-* directory found under ${MESONH}/src/dir_obj${XYZ}/MASTER/")
143
+ endif()
144
+ find_package(ZLIB REQUIRED)
145
+ message(STATUS "ZLIB found: ${ZLIB_LIBRARIES}")
146
+ set(NETCDF_LIB "${NETCDF_HOME}/lib64/libnetcdf.a")
147
+ set(NETCDF_CXX_LIB "${NETCDF_HOME}/lib64/libnetcdf_c++4.a")
148
+ set(HDF5_LIB "${NETCDF_HOME}/lib64/libhdf5.a")
149
+ set(HDF5_HL_LIB "${NETCDF_HOME}/lib64/libhdf5_hl.a")
150
+ set(SZIP_LIB "${NETCDF_HOME}/lib64/libsz.a")
151
+ set(AEC_LIB "${NETCDF_HOME}/lib64/libaec.a")
152
+ foreach(lib IN LISTS NETCDF_LIB NETCDF_CXX_LIB HDF5_LIB HDF5_HL_LIB SZIP_LIB AEC_LIB)
153
+ if(NOT EXISTS ${lib})
154
+ message(FATAL_ERROR "Required static library not found: ${lib}")
155
+ endif()
156
+ endforeach()
157
+ target_include_directories(forefire_netcdf INTERFACE "${NETCDF_HOME}/include")
158
+ target_link_libraries(forefire_netcdf INTERFACE
159
+ ${NETCDF_LIB}
160
+ ${NETCDF_CXX_LIB}
161
+ ${HDF5_HL_LIB}
162
+ ${HDF5_LIB}
163
+ ${SZIP_LIB}
164
+ ${AEC_LIB}
165
+ ${ZLIB_LIBRARIES}
166
+ )
167
+ set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
168
+ else()
169
+ # NETCDF_HOME / NETCDF_CXX_HOME may come from the environment or from
170
+ # -DNETCDF_HOME=... on the command line; both are only hints, system paths
171
+ # are searched as well.
172
+ if(NOT NETCDF_HOME AND DEFINED ENV{NETCDF_HOME})
173
+ set(NETCDF_HOME $ENV{NETCDF_HOME})
174
+ endif()
175
+ if(NOT NETCDF_CXX_HOME AND DEFINED ENV{NETCDF_CXX_HOME})
176
+ set(NETCDF_CXX_HOME $ENV{NETCDF_CXX_HOME})
177
+ endif()
178
+ set(_netcdf_hints ${NETCDF_HOME} ${NETCDF_CXX_HOME})
179
+
180
+ find_path(NETCDF_INCLUDE_DIR NAMES netcdf.h HINTS ${_netcdf_hints} PATH_SUFFIXES include)
181
+ find_library(NETCDF_LIBRARY NAMES netcdf HINTS ${_netcdf_hints} PATH_SUFFIXES lib lib64)
182
+ # The legacy C++4 API ships the umbrella header `netcdf` (no extension)
183
+ # next to ncFile.h, and is named netcdf_c++4 everywhere except Homebrew,
184
+ # which calls it netcdf-cxx4 (older bottles: netcdf-cxx).
185
+ find_path(NETCDF_CXX_INCLUDE_DIR NAMES ncFile.h HINTS ${_netcdf_hints} PATH_SUFFIXES include)
186
+ find_library(NETCDF_CXX_LIBRARY NAMES netcdf_c++4 netcdf-cxx4 netcdf-cxx HINTS ${_netcdf_hints} PATH_SUFFIXES lib lib64)
187
+
188
+ foreach(_var NETCDF_INCLUDE_DIR NETCDF_LIBRARY NETCDF_CXX_INCLUDE_DIR NETCDF_CXX_LIBRARY)
189
+ if(NOT ${_var})
190
+ message(FATAL_ERROR
191
+ "NetCDF not found (${_var} is missing).\n"
192
+ "ForeFire needs both the NetCDF C library and the legacy C++4 API:\n"
193
+ " Debian/Ubuntu: apt install libnetcdf-dev libnetcdf-c++4-dev\n"
194
+ " Fedora/RHEL: dnf install netcdf-devel netcdf-cxx4-devel\n"
195
+ " macOS: brew install netcdf netcdf-cxx\n"
196
+ "Set -DNETCDF_HOME=... (and -DNETCDF_CXX_HOME=... if the C++ API "
197
+ "lives elsewhere) to point at a custom installation.")
198
+ endif()
199
+ endforeach()
200
+
201
+ message(STATUS "NetCDF C: ${NETCDF_LIBRARY} (headers: ${NETCDF_INCLUDE_DIR})")
202
+ message(STATUS "NetCDF C++: ${NETCDF_CXX_LIBRARY} (headers: ${NETCDF_CXX_INCLUDE_DIR})")
203
+ target_include_directories(forefire_netcdf INTERFACE ${NETCDF_CXX_INCLUDE_DIR} ${NETCDF_INCLUDE_DIR})
204
+ target_link_libraries(forefire_netcdf INTERFACE ${NETCDF_CXX_LIBRARY} ${NETCDF_LIBRARY})
205
+ endif()
206
+
207
+ if(MPI_FOUND)
208
+ target_link_libraries(forefire_netcdf INTERFACE ${MPI_LIBRARIES})
209
+ endif()
210
+
211
+ # ----------------------------------
212
+ # Compiler Flags
213
+ # ----------------------------------
214
+ if(MPI_FOUND)
215
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -DMPI_COUPLING")
216
+ else()
217
+ # uncomment if want to debug
218
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
219
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -flto -fomit-frame-pointer -finline-functions -funroll-loops -ftree-vectorize -fno-strict-aliasing")
220
+ if(FOREFIRE_NATIVE_ARCH)
221
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
222
+ endif()
223
+ endif()
224
+
225
+ # ----------------------------------
226
+ # Output Directories
227
+ # ----------------------------------
228
+ # Wheel builds must not write into the source tree; CMake's defaults (relative
229
+ # to the build directory) are what scikit-build-core expects.
230
+ if(NOT _ff_wheel_build)
231
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
232
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib")
233
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib")
234
+ message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY: ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
235
+ message(STATUS "CMAKE_LIBRARY_OUTPUT_DIRECTORY: ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
236
+ endif()
237
+ message(STATUS "CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
238
+
239
+ # ----------------------------------
240
+ # Source Files
241
+ # ----------------------------------
242
+ file(GLOB_RECURSE SRC_FILES src/*.cpp)
243
+
244
+ # ----------------------------------
245
+ # Core Library Target
246
+ # ----------------------------------
247
+ if(FOREFIRE_STATIC_CORE)
248
+ # OBJECT, not STATIC: every propagation and flux model registers itself
249
+ # through a static initialiser that nothing references by name (see
250
+ # FireDomain::registerPropagationModelInstantiator). Out of a static
251
+ # archive the linker discards those objects and the models silently
252
+ # disappear at runtime; object libraries are always linked whole.
253
+ add_library(forefireL OBJECT ${SRC_FILES})
254
+ set_target_properties(forefireL PROPERTIES POSITION_INDEPENDENT_CODE ON)
255
+ else()
256
+ add_library(forefireL SHARED ${SRC_FILES})
257
+ endif()
258
+ target_include_directories(forefireL PUBLIC
259
+ "${CMAKE_CURRENT_SOURCE_DIR}/src"
260
+ "${CMAKE_CURRENT_SOURCE_DIR}/src/include")
261
+ # Threads is explicit because a static core does not drag libpthread in for
262
+ # its consumers the way the shared library does.
263
+ find_package(Threads REQUIRED)
264
+ target_link_libraries(forefireL PUBLIC forefire_netcdf Threads::Threads)
265
+
266
+ # ----------------------------------
267
+ # Test Executable
268
+ # ----------------------------------
269
+ if(FOREFIRE_BUILD_TOOLS)
270
+ add_executable(ANN_test tools/runANN/ANNTest.cpp)
271
+ target_link_libraries(ANN_test PRIVATE forefire_netcdf)
272
+ endif()
273
+
274
+ # ----------------------------------
275
+ # Main Project Executable
276
+ # ----------------------------------
277
+ add_executable(forefire app/forefire/ForeFire.cpp app/forefire/AdvancedLineEditor.cpp)
278
+ target_link_libraries(forefire PRIVATE forefireL)
279
+
280
+ # ----------------------------------
281
+ # Python Extension Module
282
+ # ----------------------------------
283
+ if(FOREFIRE_BUILD_PYTHON)
284
+ find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
285
+ find_package(pybind11 CONFIG REQUIRED)
286
+
287
+ pybind11_add_module(_pyforefire bindings/python/src/pyforefire/_pyforefire.cpp)
288
+ target_link_libraries(_pyforefire PRIVATE forefireL)
289
+ install(TARGETS _pyforefire DESTINATION pyforefire)
290
+
291
+ # Ship the command line interpreter so that `pip install forefire` also
292
+ # provides a working `forefire` command.
293
+ #
294
+ # It goes *inside* the package, next to _pyforefire, rather than into
295
+ # SKBUILD_SCRIPTS_DIR. auditwheel and delocate point a relocated binary at
296
+ # the vendored libraries using a path relative to the binary itself, and
297
+ # only a binary inside the package keeps that path valid: pip installs
298
+ # `.data/scripts/` into `<env>/bin` but the package into
299
+ # `<env>/lib/pythonX.Y/site-packages/`, so a reference from one to the
300
+ # other cannot survive installation. delocate produced exactly that broken
301
+ # path on macOS. `pyforefire._cli` is the entry point that execs it.
302
+ if(_ff_wheel_build)
303
+ install(TARGETS forefire RUNTIME DESTINATION pyforefire)
304
+ endif()
305
+ endif()
306
+
307
+ # ----------------------------------
308
+ # CPack Configuration for DMG (macOS)
309
+ # ----------------------------------
310
+ if(NOT _ff_wheel_build)
311
+ include(InstallRequiredSystemLibraries)
312
+ set(CPACK_PACKAGE_NAME "forefire")
313
+ set(CPACK_PACKAGE_VENDOR "CNRS - University of Corsica")
314
+ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Forefire - a wildfire solver")
315
+ set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
316
+ set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
317
+ set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
318
+ set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
319
+ set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE") # Adjust as necessary
320
+
321
+ # Specify installation directories
322
+ install(TARGETS forefire RUNTIME DESTINATION bin)
323
+ if(NOT FOREFIRE_STATIC_CORE)
324
+ # With a static core there is no libforefireL to install: it is linked
325
+ # straight into the executables.
326
+ install(TARGETS forefireL
327
+ LIBRARY DESTINATION lib
328
+ ARCHIVE DESTINATION lib)
329
+ endif()
330
+ if(FOREFIRE_BUILD_TOOLS)
331
+ install(TARGETS ANN_test RUNTIME DESTINATION bin)
332
+ endif()
333
+
334
+ # For macOS DMG packaging using the DragNDrop generator:
335
+ if(APPLE)
336
+ set(CPACK_GENERATOR "DragNDrop")
337
+ set(CPACK_DMG_VOLUME_NAME "forefire_${PROJECT_VERSION}")
338
+ # Optionally, customize DMG settings (background, icon, etc.)
339
+ endif()
340
+
341
+ include(CPack)
342
+ endif()
343
+
344
+ # ----------------------------------
345
+ # LFS Data Integrity Check
346
+ # ----------------------------------
347
+ if(FOREFIRE_CHECK_LFS)
348
+ message(STATUS "Running Git LFS data integrity check...")
349
+
350
+ execute_process(
351
+ COMMAND bash tools/check_all_lfs.bash
352
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
353
+ RESULT_VARIABLE LFS_CHECK_RESULT
354
+ OUTPUT_VARIABLE LFS_CHECK_OUTPUT
355
+ ERROR_VARIABLE LFS_CHECK_ERROR
356
+ )
357
+
358
+ if(LFS_CHECK_RESULT EQUAL 0)
359
+ message(STATUS "✅ LFS data check passed successfully.")
360
+ else()
361
+ message(WARNING "
362
+ ************************************************************
363
+ ⚠️ WARNING: Git LFS data integrity check failed!
364
+ You will NOT be able to run built-in examples until LFS data
365
+ files are correctly downloaded or restored.
366
+ ------------------------------------------------------------
367
+ Command output:
368
+ ${LFS_CHECK_OUTPUT}
369
+ ${LFS_CHECK_ERROR}
370
+ ************************************************************
371
+ ")
372
+ endif()
373
+ endif()