pyForeFire is a Python library for dealing with C++ library ForeFire. It provide numerous ForeFire bindings, written with pybind11 python library.
- NetCDF and NetCDF-Cxx libraries (can be installed with homebrew on Mac) [
https://www.unidata.ucar.edu/software/netcdf
] - ForeFire C++ library and Headers [
https://github.com/forefireAPI/firefront
]
This will build and install pyforefire package inside current Python interpreter.
FOREFIRE_DIR=path/to/forefire NETCDF_DIR=path/to/netcdf NETCDF_CXX_DIR=path/to/netcdf_cxx pip install .
This will only build pyforefire wheel inside current folder.
FOREFIRE_DIR=path/to/forefire NETCDF_DIR=path/to/netcdf NETCDF_CXX_DIR=path/to/netcdf_cxx pip wheel .
This will create pyforefire shared library inside lib folder.
cmake . -DFOREFIRE_LIB=path/to/libforefireL.dylib -DFOREFIRE_SRC_DIR=path/to/firefront/src -DNETCDF_INCLUDE_DIR=path/to/netcdf/include -DNETCDFCXX_INCLUDE_DIR=path/to/netcdf-cxx/include/
make
import pyforefire as forefire
ff = forefire.ForeFire()
sizeX = 300
sizeY = 200
myCmd = "FireDomain[sw=(0.,0.,0.);ne=(%f,%f,0.);t=0.]" % (sizeX, sizeY)
ff.execute(myCmd)
...
OR
cd test
python test.py
A test folder is included inside this repository.
Each part of the code is gracefully commented, in case you want to reproduce this example.
A fuels.ff file is also included, feel free to modify it according to your needs.