Ising_OPV
v4.0.2
Generates and analyzes model bulk heterojunction morphologies in a parallel computing environment
|
This class contains the properties of a three-dimensional lattice and the functions needed to interact with it. More...
#include <Lattice.h>
Classes | |
struct | Lattice_Params |
This struct contains all of the main input parameters needed by the Lattice class. More... | |
Public Member Functions | |
Lattice () | |
Default constructor that creates an empty Lattice object. More... | |
void | init (const Lattice_Params ¶ms) |
Initializes the Lattice object using the provided Parameters_Lattice input parameter struct. More... | |
void | calculateDestinationCoords (const Coords &coords_initial, const int i, const int j, const int k, Coords &coords_dest) const |
Calculates the destination coordinates when given the starting coordinates and the displacement vector (i,j,k). More... | |
int | calculateDX (const int x, const int i) const |
Calculates a coordinate adjustment factor if the x-direction periodic boundary is crossed. More... | |
int | calculateDX (const Coords &coords_initial, const Coords &coords_dest) const |
Calculates a coordinate adjustment factor if the x-direction periodic boundary is crossed. More... | |
int | calculateDY (const int y, const int j) const |
Calculates a coordinate adjustment factor if the y-direction periodic boundary is crossed. More... | |
int | calculateDY (const Coords &coords_initial, const Coords &coords_dest) const |
Calculates a coordinate adjustment factor if the y-direction periodic boundary is crossed. More... | |
int | calculateDZ (const int z, const int k) const |
Calculates a coordinate adjustment factor if the z-direction periodic boundary is crossed. More... | |
int | calculateDZ (const Coords &coords_initial, const Coords &coords_dest) const |
Calculates a coordinate adjustment factor if the z-direction periodic boundary is crossed. More... | |
int | calculateLatticeDistanceSquared (const Coords &coords_start, const Coords &coords_dest) const |
Calculates the shortest distance between a pair of coordinates in squared lattice units. More... | |
bool | checkMoveValidity (const Coords &coords_initial, const int i, const int j, const int k) const |
Checks to see if a generic move operation from the designated initial coordinates to a destination position specified by the displacement vector (i,j,k) is possible. More... | |
Lattice | extractSublattice (const int x, const int sublength, const int y, const int subwidth, const int z, const int subheight) const |
Extracts a sub-lattice from a larger lattice. More... | |
Coords | generateRandomCoords () |
Generates the coordinates for a randomly selected site in the lattice. More... | |
int | generateRandomX () |
Generates a random x coordinate that lies within the x-dimension size of the lattice. More... | |
int | generateRandomY () |
Generates a random y coordinate that lies within the y-dimension size of the lattice. More... | |
int | generateRandomZ () |
Generates a random z coordinate that lies within the z-dimension size of the lattice. More... | |
int | getHeight () const |
Gets the z-direction size of the lattice, the height. More... | |
int | getLength () const |
Gets the x-direction size of the lattice, the length. More... | |
long int | getNumSites () const |
Gets the number of sites contained in the lattice. More... | |
Coords | getSiteCoords (long int site_index) const |
Gets the coordinates of the specified site. More... | |
long int | getSiteIndex (const Coords &coords) const |
Gets the vector index for the site corresponding to the input coordinates. More... | |
long int | getSiteIndex (const int x, const int y, const int z) const |
Gets the vector index for the site corresponding to the input coordinates. More... | |
char | getSiteType (const long int site_index) const |
Gets the type of the site wtih the specified site index. More... | |
char | getSiteType (const Coords &coords) const |
Gets the type of the site located at the specified input coordinates. More... | |
char | getSiteType (const int x, const int y, const int z) const |
Gets the type of the site located at the specified input coordinates. More... | |
double | getUnitSize () const |
Gets the lattice unit size, which is used to convert lattice units into real space units. More... | |
double | getVolume () const |
Gets the volume of the lattice in cm^-3. More... | |
int | getWidth () const |
Gets the y-direction size of the lattice, the width. More... | |
bool | isXPeriodic () const |
Checks whether the x-direction periodic boundaries are enabled or not. More... | |
bool | isYPeriodic () const |
Checks whether the y-direction periodic boundaries are enabled or not. More... | |
bool | isZPeriodic () const |
Checks whether the z-direction periodic boundaries are enabled or not. More... | |
void | resize (const int length_new, const int width_new, const int height_new) |
Resizes the lattice and clears the sites. More... | |
void | setSiteType (const long int site_index, const char site_type) |
Sets the type of the site located at the specified input coordinates. More... | |
void | setSiteType (const int x, const int y, const int z, const char site_type) |
Sets the type of the site located at the specified input coordinates. More... | |
This class contains the properties of a three-dimensional lattice and the functions needed to interact with it.
The class makes use of the Lattice_Params struct to load the neccessary input parameters and the Coords struct to record the Cartesian coordinates of each lattice site.
Ising_OPV::Lattice::Lattice | ( | ) |
Default constructor that creates an empty Lattice object.
void Ising_OPV::Lattice::calculateDestinationCoords | ( | const Coords & | coords_initial, |
const int | i, | ||
const int | j, | ||
const int | k, | ||
Coords & | coords_dest | ||
) | const |
Calculates the destination coordinates when given the starting coordinates and the displacement vector (i,j,k).
When the starting coordinates are near one or more of the lattice boundaries and periodic boundary conditions are enabled, the function detemines the destination coordinates across the periodic boundary and assigns the calculated Coords struct to the input coords_dest argument.
int Ising_OPV::Lattice::calculateDX | ( | const int | x, |
const int | i | ||
) | const |
Calculates a coordinate adjustment factor if the x-direction periodic boundary is crossed.
x | is the starting x coordinate. |
i | is the displacement in the x-direction. |
int Ising_OPV::Lattice::calculateDX | ( | const Coords & | coords_initial, |
const Coords & | coords_dest | ||
) | const |
Calculates a coordinate adjustment factor if the x-direction periodic boundary is crossed.
coords_initial | is the Coords struct that represents the starting coordinates. |
coords_dest | is the Coords struct that represents the destination coordinates. |
int Ising_OPV::Lattice::calculateDY | ( | const int | y, |
const int | j | ||
) | const |
Calculates a coordinate adjustment factor if the y-direction periodic boundary is crossed.
y | is the starting y coordinate. |
j | is the displacement in the y-direction. |
int Ising_OPV::Lattice::calculateDY | ( | const Coords & | coords_initial, |
const Coords & | coords_dest | ||
) | const |
Calculates a coordinate adjustment factor if the y-direction periodic boundary is crossed.
coords_initial | is the Coords struct that represents the starting coordinates. |
coords_dest | is the Coords struct that represents the destination coordinates. |
int Ising_OPV::Lattice::calculateDZ | ( | const int | z, |
const int | k | ||
) | const |
Calculates a coordinate adjustment factor if the z-direction periodic boundary is crossed.
z | is the starting z coordinate. |
k | is the displacement in the z-direction. |
int Ising_OPV::Lattice::calculateDZ | ( | const Coords & | coords_initial, |
const Coords & | coords_dest | ||
) | const |
Calculates a coordinate adjustment factor if the z-direction periodic boundary is crossed.
coords_initial | is the Coords struct that represents the starting coordinates. |
coords_dest | is the Coords struct that represents the destination coordinates. |
int Ising_OPV::Lattice::calculateLatticeDistanceSquared | ( | const Coords & | coords_start, |
const Coords & | coords_dest | ||
) | const |
Calculates the shortest distance between a pair of coordinates in squared lattice units.
coords_start | is the Coords struct that represents the starting coordinates. |
coords_dest | is the Coords struct that represents the destination coordinates. |
bool Ising_OPV::Lattice::checkMoveValidity | ( | const Coords & | coords_initial, |
const int | i, | ||
const int | j, | ||
const int | k | ||
) | const |
Checks to see if a generic move operation from the designated initial coordinates to a destination position specified by the displacement vector (i,j,k) is possible.
The main use of this function is used to check if a proposed move event crosses a non-periodic boundary.
coords_initial | is the Coords struct that represents the starting coordinates. |
i | is the displacement in the x-direction. |
j | is the displacement in the y-direction. |
k | is the displacement in the z-direction. |
Lattice Ising_OPV::Lattice::extractSublattice | ( | const int | x, |
const int | sublength, | ||
const int | y, | ||
const int | subwidth, | ||
const int | z, | ||
const int | subheight | ||
) | const |
Extracts a sub-lattice from a larger lattice.
x | is the starting x-coordinate of sub-lattice. |
sublength | is the x-dimension of the sub-lattice. |
y | is the starting y-coordinate of sub-lattice. |
subwidth | is the y-dimension of the sub-lattice. |
z | is the starting z-coordinate of sub-lattice. |
subheight | is the z-dimension of the sub-lattice. |
Coords Ising_OPV::Lattice::generateRandomCoords | ( | ) |
Generates the coordinates for a randomly selected site in the lattice.
int Ising_OPV::Lattice::generateRandomX | ( | ) |
Generates a random x coordinate that lies within the x-dimension size of the lattice.
int Ising_OPV::Lattice::generateRandomY | ( | ) |
Generates a random y coordinate that lies within the y-dimension size of the lattice.
int Ising_OPV::Lattice::generateRandomZ | ( | ) |
Generates a random z coordinate that lies within the z-dimension size of the lattice.
int Ising_OPV::Lattice::getHeight | ( | ) | const |
Gets the z-direction size of the lattice, the height.
int Ising_OPV::Lattice::getLength | ( | ) | const |
Gets the x-direction size of the lattice, the length.
long int Ising_OPV::Lattice::getNumSites | ( | ) | const |
Gets the number of sites contained in the lattice.
Coords Ising_OPV::Lattice::getSiteCoords | ( | long int | site_index | ) | const |
Gets the coordinates of the specified site.
site_index | is the vector index of the input site |
long int Ising_OPV::Lattice::getSiteIndex | ( | const Coords & | coords | ) | const |
Gets the vector index for the site corresponding to the input coordinates.
coords | is the Coords struct that represents the input coordinates. |
long int Ising_OPV::Lattice::getSiteIndex | ( | const int | x, |
const int | y, | ||
const int | z | ||
) | const |
Gets the vector index for the site corresponding to the input coordinates.
x | is the x coordinate. |
y | is the y coordinate. |
z | is the z coordinate. |
char Ising_OPV::Lattice::getSiteType | ( | const long int | site_index | ) | const |
Gets the type of the site wtih the specified site index.
site_index | is the site index. |
char Ising_OPV::Lattice::getSiteType | ( | const Coords & | coords | ) | const |
Gets the type of the site located at the specified input coordinates.
coords | is the Coords struct that represents the input coordinates. |
char Ising_OPV::Lattice::getSiteType | ( | const int | x, |
const int | y, | ||
const int | z | ||
) | const |
Gets the type of the site located at the specified input coordinates.
x | is the x coordinate. |
y | is the y coordinate. |
z | is the z coordinate. |
double Ising_OPV::Lattice::getUnitSize | ( | ) | const |
Gets the lattice unit size, which is used to convert lattice units into real space units.
double Ising_OPV::Lattice::getVolume | ( | ) | const |
Gets the volume of the lattice in cm^-3.
int Ising_OPV::Lattice::getWidth | ( | ) | const |
Gets the y-direction size of the lattice, the width.
void Ising_OPV::Lattice::init | ( | const Lattice_Params & | params | ) |
Initializes the Lattice object using the provided Parameters_Lattice input parameter struct.
params | is a Lattice_Params struct that contains all of the required parameters to initialize the Lattice object. |
bool Ising_OPV::Lattice::isXPeriodic | ( | ) | const |
Checks whether the x-direction periodic boundaries are enabled or not.
bool Ising_OPV::Lattice::isYPeriodic | ( | ) | const |
Checks whether the y-direction periodic boundaries are enabled or not.
bool Ising_OPV::Lattice::isZPeriodic | ( | ) | const |
Checks whether the z-direction periodic boundaries are enabled or not.
void Ising_OPV::Lattice::resize | ( | const int | length_new, |
const int | width_new, | ||
const int | height_new | ||
) |
Resizes the lattice and clears the sites.
length_new | is the new x-dimension of the lattice. |
width_new | is the new y-dimension of the lattice. |
height_new | is the new z-dimension of the lattice. |
void Ising_OPV::Lattice::setSiteType | ( | const long int | site_index, |
const char | site_type | ||
) |
Sets the type of the site located at the specified input coordinates.
site_index | is the site index. |
site_type | is the char datatype designation for the site type. |
void Ising_OPV::Lattice::setSiteType | ( | const int | x, |
const int | y, | ||
const int | z, | ||
const char | site_type | ||
) |
Sets the type of the site located at the specified input coordinates.
x | is the x coordinate. |
y | is the y coordinate. |
z | is the z coordinate. |
site_type | is the char datatype designation for the site type. |