MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
Functions
run_simulation.h File Reference

Contains the runSimulation function. More...

#include "source.h"
#include "physics_engine.h"
Include dependency graph for run_simulation.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void runSimulation (PhotonSource &source, PhysicsEngine &physics_engine, std::function< std::vector< std::unique_ptr< SurfaceTally > >()> surface_tally_init, std::function< std::vector< std::unique_ptr< VolumeTally > >()> volume_tally_init, int N_photons, double &run_time= *(new double))
 Helper function which runs the particle transport simulation.
 

Detailed Description

Contains the runSimulation function.

Definition in file run_simulation.h.

Function Documentation

◆ runSimulation()

void runSimulation ( PhotonSource & source,
PhysicsEngine & physics_engine,
std::function< std::vector< std::unique_ptr< SurfaceTally > >()> surface_tally_init,
std::function< std::vector< std::unique_ptr< VolumeTally > >()> volume_tally_init,
int N_photons,
double & run_time = *(new double) )

Helper function which runs the particle transport simulation.

Uses OpenMP to parallelize the simulation. Splits the number of photons among the threads.

Parameters
sourceThe photon source.
physics_engineThe physics engine.
surface_tally_initA function which returns a vector of unique pointers to surface tallies.
volume_tally_initA function which returns a vector of unique pointers to volume tallies.
N_photonsThe number of photons to simulate.
run_timeA reference to a double which stores the run time of the simulation in seconds.