Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Latest commit

 

History

History
67 lines (43 loc) · 1.76 KB

File metadata and controls

67 lines (43 loc) · 1.76 KB

pyForeFire

pyForeFire is now included in the main ForeFire repository at https://github.com/forefireAPI/forefire this repository is now archived and discontinued

pyForeFire is a Python library for dealing with C++ library ForeFire. It provide numerous ForeFire bindings, written with pybind11 python library.

Building pyForeFire

Prerequisite

  • 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]

Build and install wheel with Python

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 .

Build shared library using cmake [Deprecated]

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

Usage

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

Test pyForeFire

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.