How giftbte-developer/giftbte works
Based on your project’s file structure and README, GiftBTE is a high-performance, MPI-parallelized simulation tool written in C++ that numerically solves the phonon Boltzmann transport equation for submicron heat conduction. The design emphasizes modularity with clearly separated components for different physical models (steady-state vs. transient, Fourier-based solvers, etc.), a rich set of example cases (located under bin/examples), a detailed materials database, and interfaces to external mesh generators and simulation packages.
Main Components
• Core Solver Modules:
• Simulation Engines: modules like BTEAngle, BTEBand, BTEBoundaryCondition, BTEMesh, StaticBTESynthetic, StaticFourier, TransientBTE, and TransientFourier.
• Utility components (e.g., utility functions in src/utility and includes/utility).
• Input/Preprocessing:
• Material data and mesh generators (see “bin/mesh_generator”, “bin/input”, “bin/materials”, and “includes” directories).
• Configuration and control files used by various examples (located in bin/examples/…/input folders).
• External Interfaces:
• Interaction with external tools such as ShengBTE, ALAMODE, COMSOL, GMSH, and Paraview.
• MPI parallelization interface (the project expects an MPI-ready environment).
• Build & Deployment:
• CMakeLists.txt and cmake-modules folder designate build configuration.
• Binary output folder (“bin”) with example executables.
• Post-processing:
• Scripts and MATLAB/plotting utilities (e.g., plot_temperature.m, plot_heatflux_contour.m) for visualizing simulation results.
Relationships and Interactions
• Flow from Input to Simulation:
• Input components (control files, geometry, phonon properties, material databases) feed into mesh generation and preprocessing.
• The preprocessor passes data to the core solver modules that solve the phonon BTE.
• Solver Execution:
• External Dependencies:
• Connectors linking GiftBTE with external simulation/visualization tools and mesh generators.
• Build and Deployment:
• A pipeline showing how CMake configuration compiles various modules and produces the final executables, which then run simulations based on provided example input cases.
Architectural Patterns and Design Principles
• Modular Design – Each simulation aspect (angle resolution, band calculation, boundary conditions, etc.) is implemented in its own directory (both in includes and src). Highlight these as separate modules.
• Separation of Concerns – Demonstrate how input-handling, core simulation, and output/visualization are clearly separated.
• Parallel Processing – Indicate that MPI is used; mark simulation modules as operating in a distributed environment.
• Interfacing with Third-party Tools – Show connectors that link GiftBTE to tools such as COMSOL, GMSH, and Paraview.
Be Detailed and Methodical
• Separation between configuration (e.g., CMake) and runtime components (e.g., MPI-run simulation executables).
• Nuanced data flow – for instance, showing that the “materials” library is used by both preprocessing and solver modules.
• Annotations where necessary that indicate dependencies on external libraries such as MPI and Eigen.