https://github.com/jmarrec/energyplus-cpp-demo
Using C++ to drive EnergyPlus. A fancy CLI for E+ with a terminal UI based on FTXUI
https://github.com/jmarrec/energyplus-cpp-demo
cpp cpp20 energyplus ftxui hacktoberfest
Last synced: 5 months ago
JSON representation
Using C++ to drive EnergyPlus. A fancy CLI for E+ with a terminal UI based on FTXUI
- Host: GitHub
- URL: https://github.com/jmarrec/energyplus-cpp-demo
- Owner: jmarrec
- Created: 2022-10-10T21:12:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-25T18:02:50.000Z (over 3 years ago)
- Last Synced: 2025-04-09T14:30:30.530Z (about 1 year ago)
- Topics: cpp, cpp20, energyplus, ftxui, hacktoberfest
- Language: C++
- Homepage:
- Size: 22.8 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example C++ to drive EnergyPlus
## A FTXUI-based CLI that uses the EnergyPlus C/C++ API layer to run a file, with SQL Queries built-in
This was a proof of concept / demonstration that started at the end of 2022 when I added an export of a CMake Configuration target ot EnergyPlus so one could link to EnergyPlus more easily (see [NREL/EnergyPlus#9712](https://github.com/NatLabRockies/EnergyPlus/pull/9712)) and wanted to try out [FTXUI](https://github.com/ArthurSonzogni/FTXUI))
[](https://github.com/jmarrec/EnergyPlus-Cpp-Demo/actions/workflows/build.yml)
[](https://github.com/jmarrec/EnergyPlus-Cpp-Demo/actions/workflows/clang-format-check.yml)
[](https://github.com/jmarrec/EnergyPlus-Cpp-Demo/actions/workflows/cppcheck.yml)

## Usage
This started on one of my branches that added exporting a cmake configuration target so one could link to EnergyPlus more easily (https://github.com/NatLabRockies/EnergyPlus/pull/9712) but now E+ has it out of the box since EnergyPlus v23.1.0, so you can build and link against the regular installer!
```shell
epcli -w /path/to/weather.epw -d out 1ZoneUncontrolled.idf
```
Then follow the UI.
## Building
Make sure you have conan installed: `pip install conan` (tested with >= 2, <= 3)
```shell
conan install . --output-folder=build --build=missing -c tools.cmake.cmaketoolchain:generator=Ninja -s compiler.cppstd=20 -s build_type=Release
cmake --preset conan-release -Denergyplus_DIR:PATH=/Applications/EnergyPlus-25-2-0/lib/cmake/energyplus
cmake --build --preset conan-release
./build/Products/epcli -w /path/to/weather.epw -d out 1ZoneUncontrolled.idf
```
You can copy 1ZoneUncontrolled.idf from the ExampleFiles, and add `Output:SQLite, SimpleAndTabular;` so you have access to the SQL reports