35 class Grid :
public QObject
228 int getIndexS(
int xIndex,
int yIndex,
int zIndex = 0);
343 QVector<int>
sliceIndex(
int xi,
int xf,
int yi,
int yf,
int zi,
int zf);
x = 0, yz plane
Definition: cubicgrid.h:49
QList< QList< Agent * > > m_specialAgents
A list of lists of special agents, where each sub-list is for a different Grid::CubeFace.
Definition: cubicgrid.h:437
int m_xzPlaneArea
The number of sites in the xz-plane.
Definition: cubicgrid.h:477
double xImageDistance(int site1, int site2)
Get the image distance along the x-direction between two sites.
QVector< int > neighborsSite(int site, int hoppingRange=1)
Calculate the neighboring sites of a given site.
int zSize()
Get the number of sites along the z-direction.
int ySize()
Get the number of sites along the y-direction.
int m_ySize
The number of sites along the y-direction.
Definition: cubicgrid.h:457
double getPositionY(int site)
Get the y-position from the "s-site ID".
int yImageDistancei(int site1, int site2)
Get the integer image distance along the y-direction between two sites.
double getPositionX(int site)
Get the x-position from the "s-site ID".
void unregisterAgent(Agent *agent)
Remove an Agent from the Grid.
void unregisterDefect(int site)
Remove a defect from the Grid.
Agent * agentAddress(int site)
Get a pointer to the Agent at a site.
A class that abstractly represents an object that can occupy grid sites.
Definition: agent.h:24
static QString toQString(const Grid::CubeFace e)
void registerAgent(Agent *agent)
Assign an Agent to a site in the Grid.
QVector< double > m_potentials
1D list of site potentials, the size of which is the volume of the Grid + the max number of special A...
Definition: cubicgrid.h:423
int m_specialAgentCount
The current number of special Agents registered with the Grid.
Definition: cubicgrid.h:447
x = lx, yz plane
Definition: cubicgrid.h:52
QTextStream & operator<<(QTextStream &stream, const Agent::Type e)
Output Agent type enum to stream.
Definition: agent.h:172
int getIndexX(int site)
Get the "x-site ID" from the "s-site ID".
A class to hold Agents, calculate their positions, and store the background potential.
Definition: cubicgrid.h:35
int m_specialAgentReserve
The max number of special Agents allowed.
Definition: cubicgrid.h:442
int yDistancei(int site1, int site2)
Get the integer distance along the y-direction between two sites.
Type
An identifier for the type of Agent.
Definition: agent.h:33
int getIndexY(int site)
Get the "y-site ID" from the "s-site ID".
QVector< Agent::Type > m_agentType
1D list of Agent types, the size of which is the volume of the Grid + the max number of special Agent...
Definition: cubicgrid.h:432
double yImageDistance(int site1, int site2)
Get the image distance along the y-direction between two sites.
QVector< int > neighborsFace(Grid::CubeFace cubeFace)
Calculate the neighboring sites of a given face of the Grid.
Agent::Type agentType(int site)
Get the type of Agent at a site.
int m_yzPlaneArea
The number of sites in the yz-plane.
Definition: cubicgrid.h:472
void registerSpecialAgent(Agent *agent, Grid::CubeFace cubeFace)
Assign an Agent to a special location.
A class to hold all objects in a simulation.
Definition: world.h:51
void setPotential(int site, double potential)
Set the background potential at a site to some value.
int xImageDistancei(int site1, int site2)
Get the integer image distance along the x-direction between two sites.
double zImageDistance(int site1, int site2)
Get the image distance along the z-direction between two sites.
int m_xSize
The number of sites along the x-direction.
Definition: cubicgrid.h:452
int zDistancei(int site1, int site2)
Get the integer distance along the z-direction between two sites.
z = lz, xy plane
Definition: cubicgrid.h:58
int m_volume
The total number of sites.
Definition: cubicgrid.h:482
Grid(World &world, QObject *parent=0)
Create a grid.
double totalDistance(int site1, int site2)
Get the distance between two sites.
int getIndexS(int xIndex, int yIndex, int zIndex=0)
Get the serial site ID.
int xSize()
Get the number of sites along the x-direction.
void unregisterSpecialAgent(Agent *agent, Grid::CubeFace cubeFace)
Remove an Agent from the special list of Agents in the Grid.
y = 0, xz plane
Definition: cubicgrid.h:61
double potential(int site)
Get the background potential at some site.
double yDistance(int site1, int site2)
Get the distance along the y-direction between two sites.
QVector< int > sliceIndex(int xi, int xf, int yi, int yf, int zi, int zf)
Calculate the list of sites occupying a given range.
double getPositionZ(int site)
Get the z-position from the "s-site ID".
int volume()
Get the total number of sites.
y = ly, xz plane
Definition: cubicgrid.h:64
int specialAgentCount()
The total number of special Agents.
World & m_world
Reference to the World object.
Definition: cubicgrid.h:406
int m_xyPlaneArea
The number of sites in the xy-plane.
Definition: cubicgrid.h:467
void registerDefect(int site)
Assign a site to be Agent::Defect.
QList< Agent * > & getSpecialAgentList(Grid::CubeFace cubeFace)
Get a list of special Agents assigned to a specific Grid::CubeFace.
undefined face
Definition: cubicgrid.h:67
QVector< Agent * > m_agents
1D list of Agent pointers, the size of which is the volume of the Grid + the max number of special Ag...
Definition: cubicgrid.h:415
int getIndexZ(int site)
Get the "z-site ID" from the "s-site ID".
CubeFace
A way to indicate the faces of a cube.
Definition: cubicgrid.h:46
int xyPlaneArea()
Get the number of sites in the xy-plane.
z = 0, xy plane
Definition: cubicgrid.h:55
double zDistance(int site1, int site2)
Get the distance along the z-direction between two sites.
double xDistance(int site1, int site2)
Get the distance along the x-direction between two sites.
int m_zSize
The number of sites along the z-direction.
Definition: cubicgrid.h:462
int zImageDistancei(int site1, int site2)
Get the integer image distance along the z-direction between two sites.
void addToPotential(int site, double potential)
Add some value to the background potential at a site.
int xDistancei(int site1, int site2)
Get the integer distance along the x-direction between two sites.