votca 2026-dev
Loading...
Searching...
No Matches
votca::xtp::ToFSimulation Class Reference

Many independent time-of-flight KMC runs on a ToFGraph and their statistics. More...

#include <tofsimulation.h>

Collaboration diagram for votca::xtp::ToFSimulation:

Classes

struct  Settings
struct  RunData
struct  Statistic
struct  Result

Public Member Functions

 ToFSimulation (const ToFGraph &graph, const Settings &settings)
 static rates of the graph, exponential waiting times
 ToFSimulation (const ToFGraph &graph, const Settings &settings, const TimeDependentRates &rates, WaitingTimeStrategy &strategy)
const std::string & StrategyName () const
Result Simulate () const

Static Public Member Functions

static Statistic Analyze (std::vector< double > samples)

Private Member Functions

RunData SingleRun (Index run, std::vector< double > &current, std::vector< double > &arrivals, double &before, double &after) const
Index Bin (double t) const
void Setup ()

Private Attributes

const ToFGraph & graph_
Settings settings_
std::unique_ptr< StaticRates > own_rates_
std::unique_ptr< WaitingTimeStrategy > own_strategy_
std::unique_ptr< KMCEngine > engine_
std::string strategy_name_
std::vector< double > edges_

Detailed Description

Many independent time-of-flight KMC runs on a ToFGraph and their statistics.

Per run: the time until the first carrier reaches a sink ("first") and the mean transit time per absorbed carrier, transit = absorption - injection time ("transit"); with all carriers injected at t = 0 these are the observables of GraphRandomWalk. Censored runs (stopped by a limit) are counted and left out of the means, which biases them low; the caller should report them.

Transient current (Ramo-Shockley): every accepted hop contributes its displacement along the transport normal, binned on a logarithmic time axis and normalized by L x injected carriers x bin width, so that its integral is the mean displacement per injected carrier in units of L (about 1 for complete collection). The collected fraction is the number of absorptions up to the end of each bin per injected carrier.

Runs are done in blocks in parallel (OpenMP); per-run data are reduced in run order, so results do not depend on the number of threads.

Definition at line 60 of file tofsimulation.h.

Constructor & Destructor Documentation

◆ ToFSimulation() [1/2]

votca::xtp::ToFSimulation::ToFSimulation ( const ToFGraph & graph,
const Settings & settings )

static rates of the graph, exponential waiting times

Definition at line 74 of file tofsimulation.cc.

◆ ToFSimulation() [2/2]

votca::xtp::ToFSimulation::ToFSimulation ( const ToFGraph & graph,
const Settings & settings,
const TimeDependentRates & rates,
WaitingTimeStrategy & strategy )

any rates and waiting-time strategy; calls strategy.Prepare(rates); rates and strategy must outlive the simulation

Definition at line 85 of file tofsimulation.cc.

Member Function Documentation

◆ Analyze()

ToFSimulation::Statistic votca::xtp::ToFSimulation::Analyze ( std::vector< double > samples)
static

Definition at line 172 of file tofsimulation.cc.

◆ Bin()

Index votca::xtp::ToFSimulation::Bin ( double t) const
private

Definition at line 124 of file tofsimulation.cc.

◆ Setup()

void votca::xtp::ToFSimulation::Setup ( )
private

Definition at line 99 of file tofsimulation.cc.

◆ Simulate()

ToFSimulation::Result votca::xtp::ToFSimulation::Simulate ( ) const

Definition at line 193 of file tofsimulation.cc.

◆ SingleRun()

ToFSimulation::RunData votca::xtp::ToFSimulation::SingleRun ( Index run,
std::vector< double > & current,
std::vector< double > & arrivals,
double & before,
double & after ) const
private

Definition at line 136 of file tofsimulation.cc.

◆ StrategyName()

const std::string & votca::xtp::ToFSimulation::StrategyName ( ) const
inline

Definition at line 113 of file tofsimulation.h.

Member Data Documentation

◆ edges_

std::vector<double> votca::xtp::ToFSimulation::edges_
private

Definition at line 133 of file tofsimulation.h.

◆ engine_

std::unique_ptr<KMCEngine> votca::xtp::ToFSimulation::engine_
private

Definition at line 131 of file tofsimulation.h.

◆ graph_

const ToFGraph& votca::xtp::ToFSimulation::graph_
private

Definition at line 127 of file tofsimulation.h.

◆ own_rates_

std::unique_ptr<StaticRates> votca::xtp::ToFSimulation::own_rates_
private

Definition at line 129 of file tofsimulation.h.

◆ own_strategy_

std::unique_ptr<WaitingTimeStrategy> votca::xtp::ToFSimulation::own_strategy_
private

Definition at line 130 of file tofsimulation.h.

◆ settings_

Settings votca::xtp::ToFSimulation::settings_
private

Definition at line 128 of file tofsimulation.h.

◆ strategy_name_

std::string votca::xtp::ToFSimulation::strategy_name_
private

Definition at line 132 of file tofsimulation.h.


The documentation for this class was generated from the following files: