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

Kinetic Monte Carlo of a fixed number of carriers with site exclusion in a periodic box (bulk transport, calculator kmcmultiple). More...

#include <bulksimulation.h>

Collaboration diagram for votca::xtp::BulkSimulation:

Classes

struct  Settings
struct  Sample
 state of run 0 at a sampling time More...
struct  RunData
struct  Result
struct  ExactResult

Public Member Functions

 BulkSimulation (const ToFGraph &graph, const Settings &settings)
 BulkSimulation (const ToFGraph &graph, const Settings &settings, const TimeDependentRates &rates, WaitingTimeStrategy &strategy)
Result Simulate () const

Static Public Member Functions

static ExactResult Exact (const ToFGraph &graph, Index direct_limit=20000, double tolerance=1e-12)
 direct sparse LU up to direct_limit sites, BiCGSTAB with ILUT above

Private Member Functions

void Check () const
RunData SingleRun (Index run, Eigen::VectorXd &occupation, std::vector< Sample > *trajectory) const

Private Attributes

const ToFGraph & graph_
Settings settings_
std::unique_ptr< TimeDependentRates > own_rates_
std::unique_ptr< WaitingTimeStrategy > own_strategy_
std::unique_ptr< KMCEngine > engine_

Detailed Description

Kinetic Monte Carlo of a fixed number of carriers with site exclusion in a periodic box (bulk transport, calculator kmcmultiple).

Each run places the carriers on distinct random injection sites at t = 0 and propagates them with KMCEngine on a bulk ToFGraph (ToFGraph::BulkOptions) until a limit (simulated time, events or wall time). Observables are taken over the window [equilibration, end of run]:

  • drift velocity: unwrapped displacement per carrier over the window;
  • diffusion tensor: the window is cut into J blocks of equal length tau (blocks <= J < 2 blocks); the increments d of all carriers over the blocks give D = Cov(d) / (2 tau), with the mean (drift) removed. This is the long-time D if tau is longer than the memory of the motion (trapping times); compare runs with different numbers of blocks. Block boundaries are found during the run by doubling tau, so the positions at the boundaries are exact also when the length of the run is set by the number of events;
  • occupation probability of every site (summed over carriers, so the sum over sites is the number of carriers).

Several runs are independent (random numbers from (seed, run)), done in parallel and reduced in run order; with more than one run the standard errors of velocity and D are taken over the runs, otherwise the velocity error comes from the block increments.

Definition at line 65 of file bulksimulation.h.

Constructor & Destructor Documentation

◆ BulkSimulation() [1/2]

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

graph must be a bulk graph; strategy is prepared for the static rates of the graph unless a prepared strategy is given

Definition at line 166 of file bulksimulation.cc.

◆ BulkSimulation() [2/2]

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

Definition at line 176 of file bulksimulation.cc.

Member Function Documentation

◆ Check()

void votca::xtp::BulkSimulation::Check ( ) const
private

Definition at line 189 of file bulksimulation.cc.

◆ Exact()

BulkSimulation::ExactResult votca::xtp::BulkSimulation::Exact ( const ToFGraph & graph,
Index direct_limit = 20000,
double tolerance = 1e-12 )
static

direct sparse LU up to direct_limit sites, BiCGSTAB with ILUT above

Definition at line 429 of file bulksimulation.cc.

◆ Simulate()

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

Definition at line 303 of file bulksimulation.cc.

◆ SingleRun()

BulkSimulation::RunData votca::xtp::BulkSimulation::SingleRun ( Index run,
Eigen::VectorXd & occupation,
std::vector< Sample > * trajectory ) const
private

Definition at line 225 of file bulksimulation.cc.

Member Data Documentation

◆ engine_

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

Definition at line 156 of file bulksimulation.h.

◆ graph_

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

Definition at line 152 of file bulksimulation.h.

◆ own_rates_

std::unique_ptr<TimeDependentRates> votca::xtp::BulkSimulation::own_rates_
private

Definition at line 154 of file bulksimulation.h.

◆ own_strategy_

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

Definition at line 155 of file bulksimulation.h.

◆ settings_

Settings votca::xtp::BulkSimulation::settings_
private

Definition at line 153 of file bulksimulation.h.


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