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

A class to represent moving charged particles. More...

#include <chargeagent.h>

Public Member Functions

 ChargeAgent (Agent::Type getType, World &world, Grid &grid, int site, QObject *parent=0)
 Construct charge. More...
 
virtual ~ChargeAgent ()
 Destroy charge. More...
 
int charge ()
 Get the charge of the ChargeAgent. More...
 
void chooseFuture ()
 Propose a random site to move to. More...
 
void decideFuture ()
 Decide what should happen, called after chooseFuture. More...
 
void completeTick ()
 Perform action, called after decideFuture. More...
 
bool removed ()
 True if decideFuture removed the charge from the grid. More...
 
int lifetime ()
 Number of steps ChargeAgent has existed. More...
 
int pathlength ()
 Number of sites ChargeAgent has traversed. More...
 
void setOpenCLID (int id)
 Set the ChargeAgent OpenCL identifier. More...
 
int getOpenCLID ()
 Get the ChargeAgent OpenCL identifier. More...
 
double coulombInteraction ()
 Perform coulombCPU() or coulombGPU() More...
 
void coulombCPU ()
 Calculate the Coulomb potential on the CPU. More...
 
void coulombGPU ()
 Retrieve the Coulomb potential from the GPU More...
 
void compareCoulomb ()
 compare results for CPU and GPU Coulomb (assumes kernel was called) More...
 
GridgetGrid ()
 Get the grid this ChargeAgent exists in. More...
 
void setRemoved (const bool &status=true)
 Set the removed status of this ChargeAgent. More...
 
virtual Agent::Type otherType ()=0
 Return the opposite ChargeAgent type relative to this ChargeAgent. More...
 
virtual GridotherGrid ()=0
 Return the opposite Grid relative to this ChargeAgent's Agent::Type. More...
 
- Public Member Functions inherited from LangmuirCore::Agent
 Agent (Type type, World &world, int site=0, QObject *parent=0)
 Create an Agent. More...
 
virtual ~Agent ()
 Destroy Agent. More...
 
const QVector< int > & getNeighbors () const
 Get Agent neighbor list. More...
 
void setNeighbors (QVector< int > neighbors)
 Set Agent neighbor list. More...
 
int getCurrentSite () const
 Get Agent current site. More...
 
int getFutureSite () const
 Get Agent future site. More...
 
void setCurrentSite (int site)
 Set Agent current site. More...
 
void setFutureSite (int site)
 Set Agent future site. More...
 
Type getType () const
 Get Agent::Type enum. More...
 
WorldgetWorld () const
 Get Langmuir::World reference. More...
 

Protected Member Functions

virtual double bindingPotential (int site)=0
 Calculate the exciton binding energy. More...
 

Protected Attributes

int m_charge
 Charge of ChargeAgent (in units of e) More...
 
bool m_removed
 Removed status of ChargeAgent. More...
 
int m_lifetime
 Number of steps ChargeAgent as been in existance. More...
 
int m_pathlength
 Number of grid spaces ChargeAgent has moved. More...
 
Gridm_grid
 The Grid the ChargeAgent lives in. More...
 
int m_openClID
 The index of the Charge in the OpenCL vectors (see OpenClHelper) More...
 
double m_de
 The difference in Coulomb potential between ChargeAgent::m_site and ChargeAgent::m_fSite. More...
 
- Protected Attributes inherited from LangmuirCore::Agent
int m_site
 Current site the Agent occupies. More...
 
int m_fSite
 Future site the Agent will occupy. More...
 
Worldm_world
 Reference to World object. More...
 
QVector< int > m_neighbors
 List fo neighboring site ids. More...
 
Type m_type
 Agent Type enum. More...
 

Additional Inherited Members

- Public Types inherited from LangmuirCore::Agent
enum  Type {
  Empty = 0, Electron = 1, Hole = 2, Defect = 3,
  Source = 4, Drain = 5, SIZE = 6
}
 An identifier for the type of Agent. More...
 
- Static Public Member Functions inherited from LangmuirCore::Agent
static QString toQString (const Agent::Type e)
 Convert Agent type enum to QString. More...
 

Detailed Description

A class to represent moving charged particles.

Constructor & Destructor Documentation

LangmuirCore::ChargeAgent::ChargeAgent ( Agent::Type  getType,
World world,
Grid grid,
int  site,
QObject *  parent = 0 
)

Construct charge.

ChargeAgent

Parameters
getTypeAgent type; must be Agent::Electron or Agent::Hole
worldreference to world
gridreference to grid
sitesite id in grid
parentparent QObject
virtual LangmuirCore::ChargeAgent::~ChargeAgent ( )
virtual

Destroy charge.

Member Function Documentation

virtual double LangmuirCore::ChargeAgent::bindingPotential ( int  site)
protectedpure virtual

Calculate the exciton binding energy.

Parameters
sitethe site to check in other Grid
Returns
  • $+0.5$ eV if exciton
  • 0 otherwise

Implemented in LangmuirCore::HoleAgent, and LangmuirCore::ElectronAgent.

int LangmuirCore::ChargeAgent::charge ( )

Get the charge of the ChargeAgent.

void LangmuirCore::ChargeAgent::chooseFuture ( )

Propose a random site to move to.

void LangmuirCore::ChargeAgent::compareCoulomb ( )

compare results for CPU and GPU Coulomb (assumes kernel was called)

void LangmuirCore::ChargeAgent::completeTick ( )

Perform action, called after decideFuture.

void LangmuirCore::ChargeAgent::coulombCPU ( )

Calculate the Coulomb potential on the CPU.

Note
The result is stored in m_de
void LangmuirCore::ChargeAgent::coulombGPU ( )

Retrieve the Coulomb potential from the GPU

Note
The result is stored in m_de
Warning
this function assumes:
  • the openCL id set for the ChargeAgent is the correct one
  • the openCL kernel has been executed
double LangmuirCore::ChargeAgent::coulombInteraction ( )
void LangmuirCore::ChargeAgent::decideFuture ( )

Decide what should happen, called after chooseFuture.

Grid& LangmuirCore::ChargeAgent::getGrid ( )

Get the grid this ChargeAgent exists in.

int LangmuirCore::ChargeAgent::getOpenCLID ( )

Get the ChargeAgent OpenCL identifier.

See also
OpenClHelper
int LangmuirCore::ChargeAgent::lifetime ( )

Number of steps ChargeAgent has existed.

virtual Grid& LangmuirCore::ChargeAgent::otherGrid ( )
pure virtual

Return the opposite Grid relative to this ChargeAgent's Agent::Type.

Returns
World::holeGrid() if this chargeAgent is an Agent::Electron

Implemented in LangmuirCore::HoleAgent, and LangmuirCore::ElectronAgent.

virtual Agent::Type LangmuirCore::ChargeAgent::otherType ( )
pure virtual

Return the opposite ChargeAgent type relative to this ChargeAgent.

Returns
Agent::Hole if this ChargeAgent is an Agent::Electron

Implemented in LangmuirCore::HoleAgent, and LangmuirCore::ElectronAgent.

int LangmuirCore::ChargeAgent::pathlength ( )

Number of sites ChargeAgent has traversed.

bool LangmuirCore::ChargeAgent::removed ( )

True if decideFuture removed the charge from the grid.

void LangmuirCore::ChargeAgent::setOpenCLID ( int  id)

Set the ChargeAgent OpenCL identifier.

See also
OpenClHelper
void LangmuirCore::ChargeAgent::setRemoved ( const bool &  status = true)

Set the removed status of this ChargeAgent.

Note
Removed charges are not actually removed until completeTick() is called

Member Data Documentation

int LangmuirCore::ChargeAgent::m_charge
protected

Charge of ChargeAgent (in units of e)

double LangmuirCore::ChargeAgent::m_de
protected

The difference in Coulomb potential between ChargeAgent::m_site and ChargeAgent::m_fSite.

Grid& LangmuirCore::ChargeAgent::m_grid
protected

The Grid the ChargeAgent lives in.

int LangmuirCore::ChargeAgent::m_lifetime
protected

Number of steps ChargeAgent as been in existance.

int LangmuirCore::ChargeAgent::m_openClID
protected

The index of the Charge in the OpenCL vectors (see OpenClHelper)

int LangmuirCore::ChargeAgent::m_pathlength
protected

Number of grid spaces ChargeAgent has moved.

bool LangmuirCore::ChargeAgent::m_removed
protected

Removed status of ChargeAgent.


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