GPUE
v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
|
#include <lattice.h>
Public Member Functions | |
Lattice () | |
Makes stuff exist. More... | |
~Lattice () | |
Makes stuff anti-exist. More... | |
std::vector< std::shared_ptr< Node > > & | getVortices () |
Returns the vectors for vortices. More... | |
std::vector< std::shared_ptr< Edge > > & | getEdges () |
Returns the edges for edges. More... | |
std::shared_ptr< Node > | getVortexIdx (unsigned int idx) |
Returns vortex specified at index idx. More... | |
std::shared_ptr< Edge > | getEdgeIdx (unsigned int idx) |
Returns edge specified at index idx. More... | |
unsigned int | getVortexIdxUid (unsigned int uid) |
Returns vortex index based on UID. More... | |
unsigned int | getEdgeIdxUid (unsigned int uid) |
Returns edge index based on UID. More... | |
std::shared_ptr< Node > | getVortexUid (unsigned int uid) |
Returns vortex based on UID. More... | |
std::shared_ptr< Edge > | getEdgeUid (unsigned int uid) |
Returns edge based on UID. More... | |
double | getVortexDistance (std::shared_ptr< Node > n1, std::shared_ptr< Node > n2) |
Calculates distance between vortices. More... | |
double | getVortexDistanceD (std::shared_ptr< Node > n1, std::shared_ptr< Node > n2) |
Calculates distance between vortices. More... | |
void | setVortex (unsigned int idx, std::shared_ptr< Node > n) |
Set vortex (node) at a specific position. More... | |
void | setEdge (unsigned int idx, std::shared_ptr< Edge > e) |
Set edge at a specific position. More... | |
void | addVortex (std::shared_ptr< Node > n) |
Add vortex (node) to the lattice (graph). More... | |
void | addEdge (std::shared_ptr< Edge > e) |
Add edge e to the lattice (graph). Assumes edge has nodes already. More... | |
void | addEdge (std::shared_ptr< Node > n1, std::shared_ptr< Node > n2) |
Add edge between vortex (node) n1 and n2 to the lattice (graph). More... | |
void | addEdge (std::shared_ptr< Edge > e, std::shared_ptr< Node > n1, std::shared_ptr< Node > n2) |
Add edge e between vortex (node) n1 and n2 to the lattice (graph). More... | |
void | removeVortex (std::shared_ptr< Node > n) |
Remove vortex n from the lattice. More... | |
void | removeVortexIdx (unsigned int idx) |
Remove vortex from the lattice based on index idx. More... | |
void | removeVortexUid (unsigned int uid) |
Remove vortex from the lattice based on UID uid. More... | |
void | removeEdge (std::shared_ptr< Node > n1, std::shared_ptr< Node > n2) |
Remove edge between n1 and n2 from the lattice. More... | |
void | removeEdge (std::shared_ptr< Edge > e) |
Remove edge from the lattice. More... | |
void | removeEdgeUid (unsigned int uid) |
Remove edge from the lattice based on UID uid. More... | |
void | removeEdgeIdx (unsigned int idx) |
Remove edge from the lattice based index idx. More... | |
void | removeEdges (std::shared_ptr< Node > n1) |
Remove all edges from vortex. More... | |
void | createVortex (double posx, double posy, int winding) |
Create a vortex at specified location with given winding. More... | |
void | destroyVortex (unsigned int uid) |
Destroy a vortex with UID uid. More... | |
void | createEdges (unsigned int radius) |
Generate edges between vortices closer than int radius. More... | |
void | createEdges (double radius) |
Generate edges between vortices closer than double radius. More... | |
void | genAdjMat (unsigned int *mat) |
Output adjacency matrix. More... | |
void | genAdjMat (double *mat) |
Output adjacency matrix. More... | |
void | adjMatMtca (unsigned int *mat) |
Format adjacency matrix with Mathematica-friendly output. More... | |
void | adjMatMtca (double *mat) |
Format adjacency matrix with Mathematica-friendly output. More... | |
void | swapIdxUid (unsigned int uid1, unsigned int uid2) |
Swap the elements at indices based on UID uid1 and uid2. More... | |
void | swapIdx (unsigned int idx1, unsigned int idx2) |
Swap the elements at indices idx1 and idx2. More... | |
std::weak_ptr< Edge > | isConnected (std::shared_ptr< Node > n1, std::shared_ptr< Node > n2) |
Checks if vortex n1 and n2 are connected. More... | |
LatticeGraph::Lattice::Lattice | ( | ) |
Makes stuff exist.
LatticeGraph::Lattice::~Lattice | ( | ) |
Makes stuff anti-exist.
void LatticeGraph::Lattice::addEdge | ( | std::shared_ptr< Edge > | e | ) |
Add edge e to the lattice (graph). Assumes edge has nodes already.
e | Edge to add |
Add edge between vortex (node) n1 and n2 to the lattice (graph).
n1 | Vortex to add edge to as connection 1 |
n2 | Vortex to add edge to as connection 2 |
void LatticeGraph::Lattice::addEdge | ( | std::shared_ptr< Edge > | e, |
std::shared_ptr< Node > | n1, | ||
std::shared_ptr< Node > | n2 | ||
) |
Add edge e between vortex (node) n1 and n2 to the lattice (graph).
e | Edge to add |
n1 | Vortex to add edge to as connection 1 |
n2 | Vortex to add edge to as connection 2 |
void LatticeGraph::Lattice::addVortex | ( | std::shared_ptr< Node > | n | ) |
Add vortex (node) to the lattice (graph).
n | Vortex to add |
void LatticeGraph::Lattice::adjMatMtca | ( | unsigned int * | mat | ) |
Format adjacency matrix with Mathematica-friendly output.
*mat | Adjacency matrix from genAdjMat(*uint) |
void LatticeGraph::Lattice::adjMatMtca | ( | double * | mat | ) |
Format adjacency matrix with Mathematica-friendly output.
*mat | Adjacency matrix from genAdjMat(*double) |
void LatticeGraph::Lattice::createEdges | ( | unsigned int | radius | ) |
Generate edges between vortices closer than int radius.
radius | Radius cutoff for creating edge connections |
void LatticeGraph::Lattice::createEdges | ( | double | radius | ) |
Generate edges between vortices closer than double radius.
radius | Radius cutoff for creating edge connections |
void LatticeGraph::Lattice::createVortex | ( | double | posx, |
double | posy, | ||
int | winding | ||
) |
Create a vortex at specified location with given winding.
posx | Position x to create vortex |
posy | Position y to create vortex |
Winding | of vortex to create |
void LatticeGraph::Lattice::destroyVortex | ( | unsigned int | uid | ) |
Destroy a vortex with UID uid.
uid | Vortex to destroy with UID uid |
void LatticeGraph::Lattice::genAdjMat | ( | unsigned int * | mat | ) |
Output adjacency matrix.
*mat | Modifyable UInt array for adjacency matrix |
void LatticeGraph::Lattice::genAdjMat | ( | double * | mat | ) |
Output adjacency matrix.
*mat | Modifyable double array for adjacency matrix |
std::shared_ptr<Edge> LatticeGraph::Lattice::getEdgeIdx | ( | unsigned int | idx | ) |
Returns edge specified at index idx.
idx | Index of vortex position |
unsigned int LatticeGraph::Lattice::getEdgeIdxUid | ( | unsigned int | uid | ) |
Returns edge index based on UID.
uid | UID of edge |
std::vector<std::shared_ptr <Edge> >& LatticeGraph::Lattice::getEdges | ( | ) |
Returns the edges for edges.
std::shared_ptr<Edge> LatticeGraph::Lattice::getEdgeUid | ( | unsigned int | uid | ) |
Returns edge based on UID.
uid | UID of edge |
double LatticeGraph::Lattice::getVortexDistance | ( | std::shared_ptr< Node > | n1, |
std::shared_ptr< Node > | n2 | ||
) |
Calculates distance between vortices.
n1 | Vortex (node) 1 |
n2 | Vortex (node) 2 |
double LatticeGraph::Lattice::getVortexDistanceD | ( | std::shared_ptr< Node > | n1, |
std::shared_ptr< Node > | n2 | ||
) |
Calculates distance between vortices.
n1 | Vortex (node) 1 |
n2 | Vortex (node) 2 |
std::shared_ptr<Node> LatticeGraph::Lattice::getVortexIdx | ( | unsigned int | idx | ) |
Returns vortex specified at index idx.
idx | Index of vortex position |
unsigned int LatticeGraph::Lattice::getVortexIdxUid | ( | unsigned int | uid | ) |
Returns vortex index based on UID.
uid | UID of vortex |
std::shared_ptr<Node> LatticeGraph::Lattice::getVortexUid | ( | unsigned int | uid | ) |
Returns vortex based on UID.
uid | UID of vortex |
std::vector<std::shared_ptr <Node> >& LatticeGraph::Lattice::getVortices | ( | ) |
Returns the vectors for vortices.
std::weak_ptr<Edge> LatticeGraph::Lattice::isConnected | ( | std::shared_ptr< Node > | n1, |
std::shared_ptr< Node > | n2 | ||
) |
Checks if vortex n1 and n2 are connected.
n1 | Vortex (node) 1 |
n2 | Vortex (node) 2 |
Remove edge between n1 and n2 from the lattice.
n1 | Vortex 1 |
n2 | Vortex 2 |
void LatticeGraph::Lattice::removeEdge | ( | std::shared_ptr< Edge > | e | ) |
Remove edge from the lattice.
e | Edge to remove |
void LatticeGraph::Lattice::removeEdgeIdx | ( | unsigned int | idx | ) |
Remove edge from the lattice based index idx.
idx | Edge at index idx to remove |
void LatticeGraph::Lattice::removeEdges | ( | std::shared_ptr< Node > | n1 | ) |
Remove all edges from vortex.
n1 | Vortex (node) to lose all edges |
void LatticeGraph::Lattice::removeEdgeUid | ( | unsigned int | uid | ) |
Remove edge from the lattice based on UID uid.
uid | Edge with UID uid to remove |
void LatticeGraph::Lattice::removeVortex | ( | std::shared_ptr< Node > | n | ) |
Remove vortex n from the lattice.
n | Vortex (node) to remove |
void LatticeGraph::Lattice::removeVortexIdx | ( | unsigned int | idx | ) |
Remove vortex from the lattice based on index idx.
idx | Vortex at index idx to remove |
void LatticeGraph::Lattice::removeVortexUid | ( | unsigned int | uid | ) |
Remove vortex from the lattice based on UID uid.
uid | Vortex with UID uid to remove |
void LatticeGraph::Lattice::setEdge | ( | unsigned int | idx, |
std::shared_ptr< Edge > | e | ||
) |
Set edge at a specific position.
idx | Index to set vortex |
n | Vortex to set |
void LatticeGraph::Lattice::setVortex | ( | unsigned int | idx, |
std::shared_ptr< Node > | n | ||
) |
Set vortex (node) at a specific position.
idx | Index to set vortex |
n | Vortex to set |
void LatticeGraph::Lattice::swapIdx | ( | unsigned int | idx1, |
unsigned int | idx2 | ||
) |
Swap the elements at indices idx1 and idx2.
idx1 | Index of element 1 |
idx2 | Index of element 2 |
void LatticeGraph::Lattice::swapIdxUid | ( | unsigned int | uid1, |
unsigned int | uid2 | ||
) |
Swap the elements at indices based on UID uid1 and uid2.
uid1 | UID of element 1 to swap |
uid2 | UID of element 2 to swap |