Langmuir
Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LangmuirCore::World Class Reference

A class to hold all objects in a simulation. More...

#include <world.h>

Public Member Functions

 World (const QString &fileName, int cores=-1, int gpuID=-1, QObject *parent=0)
 create a world to simulate in More...
 
 World (SimulationParameters &parameters, int cores=-1, int gpuID=-1, QObject *parent=0)
 
 World (SimulationParameters &parameters, ConfigurationInfo &configInfo, int cores=-1, int gpuID=-1, QObject *parent=0)
 
 ~World ()
 destroys the entire World, and everything in it...including you. More...
 
KeyValueParserkeyValueParser ()
 get the KeyValueParser, used for parsing input files. More...
 
CheckPointercheckPointer ()
 get the CheckPointer, used for reading and writing input files. More...
 
GridelectronGrid ()
 get the Grid used, used for holding ElectronAgents More...
 
GridholeGrid ()
 get the hole Grid, used for holding HoleAgents More...
 
Potentialpotential ()
 get the Potential, a calculator used for...calculating the potential. More...
 
SimulationParametersparameters ()
 get the SimulationParameters, a struct used for holding simulation parameters. More...
 
RandomrandomNumberGenerator ()
 get the Random, used for creating random numbers More...
 
Loggerlogger ()
 get the Logger, used for writing output More...
 
OpenClHelperopencl ()
 get the OpenClHelper, used for calculating Coulomb interactions with a Graphics Card More...
 
QList< SourceAgent * > & sources ()
 get a list of all SourceAgents More...
 
QList< SourceAgent * > & eSources ()
 get a list of all ElectronSourceAgents More...
 
QList< SourceAgent * > & hSources ()
 get a list of all ElectronSourceAgents More...
 
QList< SourceAgent * > & xSources ()
 get a list of all ElectronSourceAgents More...
 
QList< DrainAgent * > & drains ()
 get a list of all DrainAgents More...
 
QList< DrainAgent * > & eDrains ()
 get a list of all ElectronSourceAgents More...
 
QList< DrainAgent * > & hDrains ()
 get a list of all ElectronSourceAgents More...
 
QList< DrainAgent * > & xDrains ()
 get a list of all ElectronSourceAgents More...
 
QList< FluxAgent * > & fluxes ()
 get a list of all FluxAgents More...
 
ElectronSourceAgentelectronSourceAgentRight ()
 get the right ElectronSourceAgent More...
 
ElectronSourceAgentelectronSourceAgentLeft ()
 get the left ElectronSourceAgent More...
 
HoleSourceAgentholeSourceAgentRight ()
 get the right HoleSourceAgent More...
 
HoleSourceAgentholeSourceAgentLeft ()
 get the left HoleSourceAgent More...
 
ExcitonSourceAgentexcitonSourceAgent ()
 get the RecombinationAgent More...
 
ElectronDrainAgentelectronDrainAgentRight ()
 get the right ElectronDrainAgent More...
 
ElectronDrainAgentelectronDrainAgentLeft ()
 get the left ElectronDrainAgent More...
 
HoleDrainAgentholeDrainAgentRight ()
 get the right HoleDrainAgent More...
 
HoleDrainAgentholeDrainAgentLeft ()
 get the left HoleDrainAgent More...
 
RecombinationAgentrecombinationAgent ()
 get the RecombinationAgent More...
 
QList< ChargeAgent * > & electrons ()
 get a list of all ElectronAgents More...
 
QList< ChargeAgent * > & holes ()
 get a list of all HoleAgents More...
 
QList< int > & defectSiteIDs ()
 get a list of all defect sites More...
 
QList< int > & trapSiteIDs ()
 get a list of all trap sites More...
 
QList< double > & trapSitePotentials ()
 get a list of all trap potentials More...
 
boost::multi_array< double, 3 > & R1 ()
 get the array of precomputed r-squared values More...
 
boost::multi_array< double, 3 > & R2 ()
 get the array of precomputed r values More...
 
boost::multi_array< double, 3 > & iR ()
 get the array of precomputed inverse-r values More...
 
boost::multi_array< double, 3 > & eR ()
 get the array of precomputed erf(r/(sqrt(2)*sigma)) More...
 
boost::multi_array< double, 3 > & sI ()
 get the self interactions More...
 
boost::multi_array< double, 3 > & couplingConstants ()
 get the coupling constants More...
 
int maxElectronAgents ()
 get the max number of ElectronAgents allowed More...
 
int maxHoleAgents ()
 get the max number of HoleAgents allowed More...
 
int maxChargeAgents ()
 get the max number of ChargeAgents allowed More...
 
int maxChargeAgentsAndChargedDefects ()
 get the max number of ChargeAgents & charged defects More...
 
int maxDefects ()
 get the max number of Defects allowed More...
 
int maxTraps ()
 get the max number of Traps allowed More...
 
int numElectronAgents ()
 get the current number of ElectronAgents More...
 
int numHoleAgents ()
 get the current number of HoleAgents More...
 
int numChargeAgents ()
 get the current number of ChargeAgents More...
 
int electronsMinusHoles ()
 The number of electrons - holes. More...
 
int holesMinusElectrons ()
 The number of holes - electrons. More...
 
bool chargesAreBalanced ()
 true when electrons and holes are balanced More...
 
int numChargeAgentsAndChargedDefects ()
 get the current number of ChargeAgents & charged defects More...
 
int numDefects ()
 get the current number of Defects More...
 
int numTraps ()
 get the current number of Traps More...
 
double reachedChargeAgents ()
 get the percent of ChargeAgents reached, of the max allowed More...
 
double reachedElectronAgents ()
 get the percent of ElectronAgents reached, of the max allowed More...
 
double reachedHoleAgents ()
 get the percent of HoleAgents reached, of the max allowed More...
 
double percentHoleAgents ()
 get the percent of HoleAgents reached, of the total grid volume More...
 
double percentElectronAgents ()
 get the percent of ElectronAgents reached, of the total grid volume More...
 
bool atMaxElectrons ()
 check if the maximum number of electrons has been reached More...
 
bool atMaxHoles ()
 check if the maximum number of holes has been reached More...
 
bool atMaxCharges ()
 check if the maximum number of charges has been reached More...
 

Private Member Functions

void placeDefects (const QList< int > &siteIDs=QList< int >())
 places defects More...
 
void placeElectrons (const QList< int > &siteIDs=QList< int >())
 places electrons More...
 
void placeHoles (const QList< int > &siteIDs=QList< int >())
 places holes More...
 
void createSources ()
 create SourceAgents More...
 
void createDrains ()
 create DrainAgents More...
 
void setFluxInfo (const QList< quint64 > &fluxInfo)
 set attempts / successes for sources / drains More...
 
void alterMaxThreads (int cores=-1)
 Change the number of cores used. More...
 
void initialize (const QString &fileName="", SimulationParameters *pparameters=NULL, ConfigurationInfo *pconfigInfo=NULL, int cores=-1, int gpuID=-1)
 initialize all objects More...
 

Private Attributes

KeyValueParserm_keyValueParser
 pointer to KeyValueParser, used for parsing key=value pairs More...
 
CheckPointerm_checkPointer
 pointer to CheckPointer, used for reading/writing input(checkpoint) files More...
 
QList< SourceAgent * > m_sources
 list of SourceAgents More...
 
QList< SourceAgent * > m_eSources
 list of ElectronSourceAgents More...
 
QList< SourceAgent * > m_hSources
 list of HoleSourceAgents More...
 
QList< SourceAgent * > m_xSources
 list of ExcitonSourceAgents More...
 
QList< DrainAgent * > m_drains
 list of DrainAgents More...
 
QList< DrainAgent * > m_eDrains
 list of ElectronSourceAgents More...
 
QList< DrainAgent * > m_hDrains
 list of HoleSourceAgents More...
 
QList< DrainAgent * > m_xDrains
 list of ExcitonSourceAgents More...
 
QList< FluxAgent * > m_fluxAgents
 list of all FluxAgents, such as SoureAgents, DrainAgents, etc. More...
 
ElectronSourceAgentm_electronSourceAgentRight
 pointer to right ElectronDrainAgent More...
 
ElectronSourceAgentm_electronSourceAgentLeft
 pointer to left ElectronDrainAgent More...
 
HoleSourceAgentm_holeSourceAgentRight
 pointer to right HoleDrainAgent More...
 
HoleSourceAgentm_holeSourceAgentLeft
 pointer to left HoleDrainAgent More...
 
ExcitonSourceAgentm_excitonSourceAgent
 pointer to ExcitonSourceAgent, used for injecting Excitons More...
 
ElectronDrainAgentm_electronDrainAgentRight
 pointer to right ElectronDrainAgent More...
 
ElectronDrainAgentm_electronDrainAgentLeft
 pointer to left ElectronDrainAgent More...
 
HoleDrainAgentm_holeDrainAgentRight
 pointer to right HoleDrainAgent More...
 
HoleDrainAgentm_holeDrainAgentLeft
 pointer to left HoleDrainAgent More...
 
RecombinationAgentm_recombinationAgent
 pointer to electron/hole RecombinationAgent, used for removing Excitons More...
 
Gridm_electronGrid
 pointer to electron Grid, used for keeping track of ElectronAgents More...
 
Gridm_holeGrid
 pointer to hole Grid, used for keeping track of HoleAgents More...
 
Randomm_rand
 pointer to Random, used for generating random numbers More...
 
Potentialm_potential
 pointer to Potential, used for calculating the potential More...
 
SimulationParametersm_parameters
 pointer to SimulationParameters More...
 
Loggerm_logger
 pointer to Logger, used for output More...
 
OpenClHelperm_ocl
 pointer to OpenClHelper, used for Graphics Card calculations More...
 
QList< ChargeAgent * > m_electrons
 list of electrons More...
 
QList< ChargeAgent * > m_holes
 list of holes More...
 
QList< int > m_defectSiteIDs
 list of defect sites More...
 
QList< int > m_trapSiteIDs
 list of trap sites More...
 
QList< double > m_trapSitePotentials
 list of trap potentials More...
 
boost::multi_array< double, 3 > m_R2
 array of precomputed r-squared values More...
 
boost::multi_array< double, 3 > m_R1
 array of precomputed r values More...
 
boost::multi_array< double, 3 > m_iR
 array of precomputed inverse-r values More...
 
boost::multi_array< double, 3 > m_eR
 array of precomputed erf(r/(s*sqrt(2)) values More...
 
boost::multi_array< double, 3 > m_sI
 self interaction, which is 1/(4 pi e e0 r), with r=1 grid unit When a charge at it's future site interacts with other charges at their current site, the charge will interact with it's own current site. So, this value needs to be subtracted off. More...
 
boost::multi_array< double, 3 > m_couplingConstants
 array of coupling constants More...
 
int m_maxElectrons
 max number of electrons More...
 
int m_maxHoles
 max number of holes More...
 
int m_maxDefects
 max number of defects More...
 
int m_maxTraps
 max number of traps More...
 

Detailed Description

A class to hold all objects in a simulation.

Constructor & Destructor Documentation

LangmuirCore::World::World ( const QString &  fileName,
int  cores = -1,
int  gpuID = -1,
QObject *  parent = 0 
)

create a world to simulate in

Parameters
fileNamethe input file name
coresnumber of CPU cores
gpuIDOpenCL GPU id
parentQObject this belongs to

Calls the initialize() function.

LangmuirCore::World::World ( SimulationParameters parameters,
int  cores = -1,
int  gpuID = -1,
QObject *  parent = 0 
)
LangmuirCore::World::World ( SimulationParameters parameters,
ConfigurationInfo configInfo,
int  cores = -1,
int  gpuID = -1,
QObject *  parent = 0 
)
LangmuirCore::World::~World ( )

destroys the entire World, and everything in it...including you.

Member Function Documentation

void LangmuirCore::World::alterMaxThreads ( int  cores = -1)
private

Change the number of cores used.

Parameters
coresthe number of cores
bool LangmuirCore::World::atMaxCharges ( )

check if the maximum number of charges has been reached

bool LangmuirCore::World::atMaxElectrons ( )

check if the maximum number of electrons has been reached

bool LangmuirCore::World::atMaxHoles ( )

check if the maximum number of holes has been reached

bool LangmuirCore::World::chargesAreBalanced ( )

true when electrons and holes are balanced

CheckPointer& LangmuirCore::World::checkPointer ( )

get the CheckPointer, used for reading and writing input files.

boost::multi_array<double,3>& LangmuirCore::World::couplingConstants ( )

get the coupling constants

void LangmuirCore::World::createDrains ( )
private

create DrainAgents

void LangmuirCore::World::createSources ( )
private

create SourceAgents

QList<int>& LangmuirCore::World::defectSiteIDs ( )

get a list of all defect sites

QList<DrainAgent*>& LangmuirCore::World::drains ( )

get a list of all DrainAgents

QList<DrainAgent*>& LangmuirCore::World::eDrains ( )

get a list of all ElectronSourceAgents

ElectronDrainAgent& LangmuirCore::World::electronDrainAgentLeft ( )

get the left ElectronDrainAgent

ElectronDrainAgent& LangmuirCore::World::electronDrainAgentRight ( )

get the right ElectronDrainAgent

Grid& LangmuirCore::World::electronGrid ( )

get the Grid used, used for holding ElectronAgents

QList<ChargeAgent*>& LangmuirCore::World::electrons ( )

get a list of all ElectronAgents

int LangmuirCore::World::electronsMinusHoles ( )

The number of electrons - holes.

ElectronSourceAgent& LangmuirCore::World::electronSourceAgentLeft ( )

get the left ElectronSourceAgent

ElectronSourceAgent& LangmuirCore::World::electronSourceAgentRight ( )

get the right ElectronSourceAgent

boost::multi_array<double,3>& LangmuirCore::World::eR ( )

get the array of precomputed erf(r/(sqrt(2)*sigma))

QList<SourceAgent*>& LangmuirCore::World::eSources ( )

get a list of all ElectronSourceAgents

ExcitonSourceAgent& LangmuirCore::World::excitonSourceAgent ( )
QList<FluxAgent*>& LangmuirCore::World::fluxes ( )

get a list of all FluxAgents

QList<DrainAgent*>& LangmuirCore::World::hDrains ( )

get a list of all ElectronSourceAgents

HoleDrainAgent& LangmuirCore::World::holeDrainAgentLeft ( )

get the left HoleDrainAgent

HoleDrainAgent& LangmuirCore::World::holeDrainAgentRight ( )

get the right HoleDrainAgent

Grid& LangmuirCore::World::holeGrid ( )

get the hole Grid, used for holding HoleAgents

QList<ChargeAgent*>& LangmuirCore::World::holes ( )

get a list of all HoleAgents

int LangmuirCore::World::holesMinusElectrons ( )

The number of holes - electrons.

HoleSourceAgent& LangmuirCore::World::holeSourceAgentLeft ( )

get the left HoleSourceAgent

HoleSourceAgent& LangmuirCore::World::holeSourceAgentRight ( )

get the right HoleSourceAgent

QList<SourceAgent*>& LangmuirCore::World::hSources ( )

get a list of all ElectronSourceAgents

void LangmuirCore::World::initialize ( const QString &  fileName = "",
SimulationParameters pparameters = NULL,
ConfigurationInfo pconfigInfo = NULL,
int  cores = -1,
int  gpuID = -1 
)
private

initialize all objects

Parameters
fileNameinput file name
pparameterspointer to a parameters object
pconfigInfopointer to a configuration info object
coresnumber of CPU cores
gpuIDOpenCL GPU id

A very long, though not all that complicated function that creates all the simulation objects. Best to read through it in the source code.

boost::multi_array<double,3>& LangmuirCore::World::iR ( )

get the array of precomputed inverse-r values

KeyValueParser& LangmuirCore::World::keyValueParser ( )

get the KeyValueParser, used for parsing input files.

Logger& LangmuirCore::World::logger ( )

get the Logger, used for writing output

int LangmuirCore::World::maxChargeAgents ( )

get the max number of ChargeAgents allowed

int LangmuirCore::World::maxChargeAgentsAndChargedDefects ( )

get the max number of ChargeAgents & charged defects

int LangmuirCore::World::maxDefects ( )

get the max number of Defects allowed

int LangmuirCore::World::maxElectronAgents ( )

get the max number of ElectronAgents allowed

int LangmuirCore::World::maxHoleAgents ( )

get the max number of HoleAgents allowed

int LangmuirCore::World::maxTraps ( )

get the max number of Traps allowed

int LangmuirCore::World::numChargeAgents ( )

get the current number of ChargeAgents

int LangmuirCore::World::numChargeAgentsAndChargedDefects ( )

get the current number of ChargeAgents & charged defects

int LangmuirCore::World::numDefects ( )

get the current number of Defects

int LangmuirCore::World::numElectronAgents ( )

get the current number of ElectronAgents

int LangmuirCore::World::numHoleAgents ( )

get the current number of HoleAgents

int LangmuirCore::World::numTraps ( )

get the current number of Traps

OpenClHelper& LangmuirCore::World::opencl ( )

get the OpenClHelper, used for calculating Coulomb interactions with a Graphics Card

SimulationParameters& LangmuirCore::World::parameters ( )

get the SimulationParameters, a struct used for holding simulation parameters.

double LangmuirCore::World::percentElectronAgents ( )

get the percent of ElectronAgents reached, of the total grid volume

double LangmuirCore::World::percentHoleAgents ( )

get the percent of HoleAgents reached, of the total grid volume

void LangmuirCore::World::placeDefects ( const QList< int > &  siteIDs = QList< int >())
private

places defects

Parameters
siteIDsa list of defect site ids

Places carriers according to the site ids passed. If more need placing (according to SimulationParameters::seedCharges), then they are placed randomly.

void LangmuirCore::World::placeElectrons ( const QList< int > &  siteIDs = QList< int >())
private

places electrons

Parameters
siteIDsa list of electron site ids

Places carriers according to the site ids passed. If more need placing (according to SimulationParameters::seedCharges), then they are placed randomly.

void LangmuirCore::World::placeHoles ( const QList< int > &  siteIDs = QList< int >())
private

places holes

Parameters
siteIDsa list of hole site ids

Places carriers according to the site ids passed. If more need placing (according to SimulationParameters::seedCharges), then they are placed randomly.

Potential& LangmuirCore::World::potential ( )

get the Potential, a calculator used for...calculating the potential.

boost::multi_array<double,3>& LangmuirCore::World::R1 ( )

get the array of precomputed r-squared values

boost::multi_array<double,3>& LangmuirCore::World::R2 ( )

get the array of precomputed r values

Random& LangmuirCore::World::randomNumberGenerator ( )

get the Random, used for creating random numbers

double LangmuirCore::World::reachedChargeAgents ( )

get the percent of ChargeAgents reached, of the max allowed

double LangmuirCore::World::reachedElectronAgents ( )

get the percent of ElectronAgents reached, of the max allowed

double LangmuirCore::World::reachedHoleAgents ( )

get the percent of HoleAgents reached, of the max allowed

RecombinationAgent& LangmuirCore::World::recombinationAgent ( )
void LangmuirCore::World::setFluxInfo ( const QList< quint64 > &  fluxInfo)
private

set attempts / successes for sources / drains

boost::multi_array<double, 3>& LangmuirCore::World::sI ( )

get the self interactions

QList<SourceAgent*>& LangmuirCore::World::sources ( )

get a list of all SourceAgents

QList<int>& LangmuirCore::World::trapSiteIDs ( )

get a list of all trap sites

QList<double>& LangmuirCore::World::trapSitePotentials ( )

get a list of all trap potentials

QList<DrainAgent*>& LangmuirCore::World::xDrains ( )

get a list of all ElectronSourceAgents

QList<SourceAgent*>& LangmuirCore::World::xSources ( )

get a list of all ElectronSourceAgents

Member Data Documentation

CheckPointer* LangmuirCore::World::m_checkPointer
private

pointer to CheckPointer, used for reading/writing input(checkpoint) files

boost::multi_array<double,3> LangmuirCore::World::m_couplingConstants
private

array of coupling constants

This array is indexed by dx, dy, dz values.

QList<int> LangmuirCore::World::m_defectSiteIDs
private

list of defect sites

QList<DrainAgent*> LangmuirCore::World::m_drains
private

list of DrainAgents

QList<DrainAgent*> LangmuirCore::World::m_eDrains
private

list of ElectronSourceAgents

ElectronDrainAgent* LangmuirCore::World::m_electronDrainAgentLeft
private

pointer to left ElectronDrainAgent

ElectronDrainAgent* LangmuirCore::World::m_electronDrainAgentRight
private

pointer to right ElectronDrainAgent

Grid* LangmuirCore::World::m_electronGrid
private

pointer to electron Grid, used for keeping track of ElectronAgents

QList<ChargeAgent*> LangmuirCore::World::m_electrons
private

list of electrons

ElectronSourceAgent* LangmuirCore::World::m_electronSourceAgentLeft
private

pointer to left ElectronDrainAgent

ElectronSourceAgent* LangmuirCore::World::m_electronSourceAgentRight
private

pointer to right ElectronDrainAgent

boost::multi_array<double,3> LangmuirCore::World::m_eR
private

array of precomputed erf(r/(s*sqrt(2)) values

This array is indexed by dx, dy, dz values, and r is in grid-units

QList<SourceAgent*> LangmuirCore::World::m_eSources
private

list of ElectronSourceAgents

ExcitonSourceAgent* LangmuirCore::World::m_excitonSourceAgent
private

pointer to ExcitonSourceAgent, used for injecting Excitons

QList<FluxAgent*> LangmuirCore::World::m_fluxAgents
private

list of all FluxAgents, such as SoureAgents, DrainAgents, etc.

QList<DrainAgent*> LangmuirCore::World::m_hDrains
private

list of HoleSourceAgents

HoleDrainAgent* LangmuirCore::World::m_holeDrainAgentLeft
private

pointer to left HoleDrainAgent

HoleDrainAgent* LangmuirCore::World::m_holeDrainAgentRight
private

pointer to right HoleDrainAgent

Grid* LangmuirCore::World::m_holeGrid
private

pointer to hole Grid, used for keeping track of HoleAgents

QList<ChargeAgent*> LangmuirCore::World::m_holes
private

list of holes

HoleSourceAgent* LangmuirCore::World::m_holeSourceAgentLeft
private

pointer to left HoleDrainAgent

HoleSourceAgent* LangmuirCore::World::m_holeSourceAgentRight
private

pointer to right HoleDrainAgent

QList<SourceAgent*> LangmuirCore::World::m_hSources
private

list of HoleSourceAgents

boost::multi_array<double,3> LangmuirCore::World::m_iR
private

array of precomputed inverse-r values

This array is indexed by dx, dy, dz values, and r is in grid-units

KeyValueParser* LangmuirCore::World::m_keyValueParser
private

pointer to KeyValueParser, used for parsing key=value pairs

Logger* LangmuirCore::World::m_logger
private

pointer to Logger, used for output

int LangmuirCore::World::m_maxDefects
private

max number of defects

int LangmuirCore::World::m_maxElectrons
private

max number of electrons

int LangmuirCore::World::m_maxHoles
private

max number of holes

int LangmuirCore::World::m_maxTraps
private

max number of traps

OpenClHelper* LangmuirCore::World::m_ocl
private

pointer to OpenClHelper, used for Graphics Card calculations

SimulationParameters* LangmuirCore::World::m_parameters
private
Potential* LangmuirCore::World::m_potential
private

pointer to Potential, used for calculating the potential

boost::multi_array<double,3> LangmuirCore::World::m_R1
private

array of precomputed r values

This array is indexed by dx, dy, dz values, and r is in grid-units

boost::multi_array<double,3> LangmuirCore::World::m_R2
private

array of precomputed r-squared values

This array is indexed by dx, dy, dz values, and r is in grid-units

Random* LangmuirCore::World::m_rand
private

pointer to Random, used for generating random numbers

RecombinationAgent* LangmuirCore::World::m_recombinationAgent
private

pointer to electron/hole RecombinationAgent, used for removing Excitons

boost::multi_array<double, 3> LangmuirCore::World::m_sI
private

self interaction, which is 1/(4 pi e e0 r), with r=1 grid unit When a charge at it's future site interacts with other charges at their current site, the charge will interact with it's own current site. So, this value needs to be subtracted off.

QList<SourceAgent*> LangmuirCore::World::m_sources
private

list of SourceAgents

QList<int> LangmuirCore::World::m_trapSiteIDs
private

list of trap sites

QList<double> LangmuirCore::World::m_trapSitePotentials
private

list of trap potentials

QList<DrainAgent*> LangmuirCore::World::m_xDrains
private

list of ExcitonSourceAgents

QList<SourceAgent*> LangmuirCore::World::m_xSources
private

list of ExcitonSourceAgents


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