<< Main program of MMC >> More...
#include "mmc_host.h"
Functions | |
int | main (int argc, char **argv) |
<< Main program of MMC >>
int main | ( | int | argc, |
char ** | argv | ||
) |
In this unit, we first launch a master thread and initialize the necessary data structures. This include the command line options (cfg), tetrahedral mesh (mesh) and the ray-tracer precomputed data (tracer).
cfg: structure to store all simulation parameters
mesh: structure to store mesh information
tracer: structure to store
To start an MMC simulation, we first create a simulation configuration, initialize all elements to its default settings, and then set user-specified settings via command line or input files.
In the second step, we pre-compute all needed mesh and ray-tracing data and get ready for launching photon simulations.
The core simulation loop is executed in the mmc_run_mp() function where multiple threads are executed to simulate all photons.
Once all photon simulations are complete, we clean up all allocated memory and finish the execution.