GPUE  v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
LatticeGraph::Lattice Class Reference

#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< NodegetVortexIdx (unsigned int idx)
 Returns vortex specified at index idx. More...
 
std::shared_ptr< EdgegetEdgeIdx (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< NodegetVortexUid (unsigned int uid)
 Returns vortex based on UID. More...
 
std::shared_ptr< EdgegetEdgeUid (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< EdgeisConnected (std::shared_ptr< Node > n1, std::shared_ptr< Node > n2)
 Checks if vortex n1 and n2 are connected. More...
 

Detailed Description

Definition at line 31 of file lattice.h.

Constructor & Destructor Documentation

◆ Lattice()

LatticeGraph::Lattice::Lattice ( )

Makes stuff exist.

◆ ~Lattice()

LatticeGraph::Lattice::~Lattice ( )

Makes stuff anti-exist.

Member Function Documentation

◆ addEdge() [1/3]

void LatticeGraph::Lattice::addEdge ( std::shared_ptr< Edge e)

Add edge e to the lattice (graph). Assumes edge has nodes already.

Parameters
eEdge to add

◆ addEdge() [2/3]

void LatticeGraph::Lattice::addEdge ( std::shared_ptr< Node n1,
std::shared_ptr< Node n2 
)

Add edge between vortex (node) n1 and n2 to the lattice (graph).

Parameters
n1Vortex to add edge to as connection 1
n2Vortex to add edge to as connection 2

◆ addEdge() [3/3]

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).

Parameters
eEdge to add
n1Vortex to add edge to as connection 1
n2Vortex to add edge to as connection 2

◆ addVortex()

void LatticeGraph::Lattice::addVortex ( std::shared_ptr< Node n)

Add vortex (node) to the lattice (graph).

Parameters
nVortex to add

◆ adjMatMtca() [1/2]

void LatticeGraph::Lattice::adjMatMtca ( unsigned int *  mat)

Format adjacency matrix with Mathematica-friendly output.

Parameters
*matAdjacency matrix from genAdjMat(*uint)

◆ adjMatMtca() [2/2]

void LatticeGraph::Lattice::adjMatMtca ( double *  mat)

Format adjacency matrix with Mathematica-friendly output.

Parameters
*matAdjacency matrix from genAdjMat(*double)

◆ createEdges() [1/2]

void LatticeGraph::Lattice::createEdges ( unsigned int  radius)

Generate edges between vortices closer than int radius.

Parameters
radiusRadius cutoff for creating edge connections

◆ createEdges() [2/2]

void LatticeGraph::Lattice::createEdges ( double  radius)

Generate edges between vortices closer than double radius.

Parameters
radiusRadius cutoff for creating edge connections

◆ createVortex()

void LatticeGraph::Lattice::createVortex ( double  posx,
double  posy,
int  winding 
)

Create a vortex at specified location with given winding.

Parameters
posxPosition x to create vortex
posyPosition y to create vortex
Windingof vortex to create

◆ destroyVortex()

void LatticeGraph::Lattice::destroyVortex ( unsigned int  uid)

Destroy a vortex with UID uid.

Parameters
uidVortex to destroy with UID uid

◆ genAdjMat() [1/2]

void LatticeGraph::Lattice::genAdjMat ( unsigned int *  mat)

Output adjacency matrix.

Parameters
*matModifyable UInt array for adjacency matrix

◆ genAdjMat() [2/2]

void LatticeGraph::Lattice::genAdjMat ( double *  mat)

Output adjacency matrix.

Parameters
*matModifyable double array for adjacency matrix

◆ getEdgeIdx()

std::shared_ptr<Edge> LatticeGraph::Lattice::getEdgeIdx ( unsigned int  idx)

Returns edge specified at index idx.

Parameters
idxIndex of vortex position
Returns
Shared pointer to edge at index idx

◆ getEdgeIdxUid()

unsigned int LatticeGraph::Lattice::getEdgeIdxUid ( unsigned int  uid)

Returns edge index based on UID.

Parameters
uidUID of edge
Returns
Index of edge with UID uid

◆ getEdges()

std::vector<std::shared_ptr <Edge> >& LatticeGraph::Lattice::getEdges ( )

Returns the edges for edges.

Returns
Vector of shared_ptr for edges (Nodes)

◆ getEdgeUid()

std::shared_ptr<Edge> LatticeGraph::Lattice::getEdgeUid ( unsigned int  uid)

Returns edge based on UID.

Parameters
uidUID of edge
Returns
edge with UID uid
Bug:
Fails for vortex UIDs that do not exist. Assumes they do.

◆ getVortexDistance()

double LatticeGraph::Lattice::getVortexDistance ( std::shared_ptr< Node n1,
std::shared_ptr< Node n2 
)

Calculates distance between vortices.

Parameters
n1Vortex (node) 1
n2Vortex (node) 2
Returns
double of intervortex distance

◆ getVortexDistanceD()

double LatticeGraph::Lattice::getVortexDistanceD ( std::shared_ptr< Node n1,
std::shared_ptr< Node n2 
)

Calculates distance between vortices.

Parameters
n1Vortex (node) 1
n2Vortex (node) 2
Returns
double of intervortex distance

◆ getVortexIdx()

std::shared_ptr<Node> LatticeGraph::Lattice::getVortexIdx ( unsigned int  idx)

Returns vortex specified at index idx.

Parameters
idxIndex of vortex position
Returns
Shared pointer to vortex (Node) at index idx

◆ getVortexIdxUid()

unsigned int LatticeGraph::Lattice::getVortexIdxUid ( unsigned int  uid)

Returns vortex index based on UID.

Parameters
uidUID of vortex
Returns
Index of vortex with UID uid

◆ getVortexUid()

std::shared_ptr<Node> LatticeGraph::Lattice::getVortexUid ( unsigned int  uid)

Returns vortex based on UID.

Parameters
uidUID of vortex
Returns
Vortex with UID uid
Bug:
Fails for vortex UIDs that do not exist. Assumes they do.

◆ getVortices()

std::vector<std::shared_ptr <Node> >& LatticeGraph::Lattice::getVortices ( )

Returns the vectors for vortices.

Returns
Vector of shared_ptr for vortices (Nodes)

◆ isConnected()

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.

Parameters
n1Vortex (node) 1
n2Vortex (node) 2
Returns
Weak pointer to the connecting edge

◆ removeEdge() [1/2]

void LatticeGraph::Lattice::removeEdge ( std::shared_ptr< Node n1,
std::shared_ptr< Node n2 
)

Remove edge between n1 and n2 from the lattice.

Parameters
n1Vortex 1
n2Vortex 2

◆ removeEdge() [2/2]

void LatticeGraph::Lattice::removeEdge ( std::shared_ptr< Edge e)

Remove edge from the lattice.

Parameters
eEdge to remove

◆ removeEdgeIdx()

void LatticeGraph::Lattice::removeEdgeIdx ( unsigned int  idx)

Remove edge from the lattice based index idx.

Parameters
idxEdge at index idx to remove

◆ removeEdges()

void LatticeGraph::Lattice::removeEdges ( std::shared_ptr< Node n1)

Remove all edges from vortex.

Parameters
n1Vortex (node) to lose all edges

◆ removeEdgeUid()

void LatticeGraph::Lattice::removeEdgeUid ( unsigned int  uid)

Remove edge from the lattice based on UID uid.

Parameters
uidEdge with UID uid to remove

◆ removeVortex()

void LatticeGraph::Lattice::removeVortex ( std::shared_ptr< Node n)

Remove vortex n from the lattice.

Parameters
nVortex (node) to remove

◆ removeVortexIdx()

void LatticeGraph::Lattice::removeVortexIdx ( unsigned int  idx)

Remove vortex from the lattice based on index idx.

Parameters
idxVortex at index idx to remove

◆ removeVortexUid()

void LatticeGraph::Lattice::removeVortexUid ( unsigned int  uid)

Remove vortex from the lattice based on UID uid.

Parameters
uidVortex with UID uid to remove

◆ setEdge()

void LatticeGraph::Lattice::setEdge ( unsigned int  idx,
std::shared_ptr< Edge e 
)

Set edge at a specific position.

Parameters
idxIndex to set vortex
nVortex to set

◆ setVortex()

void LatticeGraph::Lattice::setVortex ( unsigned int  idx,
std::shared_ptr< Node n 
)

Set vortex (node) at a specific position.

Parameters
idxIndex to set vortex
nVortex to set

◆ swapIdx()

void LatticeGraph::Lattice::swapIdx ( unsigned int  idx1,
unsigned int  idx2 
)

Swap the elements at indices idx1 and idx2.

Parameters
idx1Index of element 1
idx2Index of element 2

◆ swapIdxUid()

void LatticeGraph::Lattice::swapIdxUid ( unsigned int  uid1,
unsigned int  uid2 
)

Swap the elements at indices based on UID uid1 and uid2.

Parameters
uid1UID of element 1 to swap
uid2UID of element 2 to swap

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