votca 2024.2-dev
|
Designed to determine if the structure beads passed in. More...
#include <beadstructure.h>
Classes | |
struct | BeadInfo |
Small structure to help store bead info relevant to the structure. More... | |
Public Member Functions | |
virtual | ~BeadStructure ()=default |
BeadStructure | getSubStructure (const std::vector< Index > &idx, const std::vector< tools::Edge > &edges) const |
Given indices and edges that exist are a subset of beadstructure, return the sub-beadstructure. | |
bool | isSingleStructure () |
Determine if the bead structure consists of a single connected structure. | |
size_t | BeadCount () const noexcept |
returns the number of beads in the bead structure | |
template<class T > | |
void | AddBead (const T &bead) |
add a bead to the bead structure | |
virtual void | ConnectBeads (const Index &bead1_id, const Index &bead2_id) |
Create a connection between two beads in the structure. | |
std::vector< Index > | getNeighBeadIds (const Index &index) |
Return a vector of all the ids of the beads neighboring the index. | |
tools::Graph | getGraph () |
bool | isStructureEquivalent (BeadStructure &beadstructure) |
Compare the topology of two bead structures. | |
bool | BeadExist (Index bead_id) const |
Determine if a bead exists in the structure. | |
std::vector< Index > | getBeadIds () const |
Return the ids of the beads that are in the structure. | |
Protected Member Functions | |
virtual void | UpdateOnBeadAddition_ () |
void | InitializeGraph_ () |
void | CalculateStructure_ () |
tools::GraphNode | BeadInfoToGraphNode_ (const BeadInfo &) |
Protected Attributes | |
bool | structureIdUpToDate = false |
bool | graphUpToDate = false |
bool | single_structureUpToDate_ = false |
bool | single_structure_ = false |
std::string | structure_id_ = "" |
tools::Graph | graph_ |
std::set< tools::Edge > | connections_ |
std::unordered_map< Index, BeadInfo > | beads_ |
std::unordered_map< Index, tools::GraphNode > | graphnodes_ |
Designed to determine if the structure beads passed in.
Essentially it will have the functionality to determine if the stored beads make up a single molecule. It can also break the stored beads up into molecules. It can compare two bead structures and determine if they are the same structure. The Ids of a bead will not determine if a structure is equivalent or not. Each bead must have a unique Id.
E.g. If a beadstructure is composed of the following:
BeadStructure 1 Name:"A" Id:1 -— Name:"B" Id:2
BeadStucture 2 Name:"A" Id:3 -— Name:"B" Id:4
Here BeadStructure 1 and 2 will compare equal
Definition at line 51 of file beadstructure.h.
|
virtualdefault |
void votca::csg::BeadStructure::AddBead | ( | const T & | bead | ) |
add a bead to the bead structure
The same bead cannot be added twice.
Definition at line 159 of file beadstructure.h.
|
inlinenoexcept |
returns the number of beads in the bead structure
Definition at line 87 of file beadstructure.h.
|
inline |
Determine if a bead exists in the structure.
Definition at line 125 of file beadstructure.h.
|
protected |
Add graphnodes
Definition at line 63 of file beadstructure.cc.
|
protected |
Definition at line 54 of file beadstructure.cc.
Create a connection between two beads in the structure.
A bead cannot be connected to itself. It also may not be connected to a bead that has not yet been added to the structure.
Reimplemented in votca::csg::BeadMotif.
Definition at line 115 of file beadstructure.cc.
std::vector< Index > BeadStructure::getBeadIds | ( | ) | const |
Return the ids of the beads that are in the structure.
Do not use graph_.getVertices() because this would require that the graph is updated
Definition at line 187 of file beadstructure.cc.
tools::Graph BeadStructure::getGraph | ( | ) |
Definition at line 134 of file beadstructure.cc.
Return a vector of all the ids of the beads neighboring the index.
Definition at line 179 of file beadstructure.cc.
BeadStructure BeadStructure::getSubStructure | ( | const std::vector< Index > & | idx, |
const std::vector< tools::Edge > & | edges ) const |
Given indices and edges that exist are a subset of beadstructure, return the sub-beadstructure.
If the edges and and indices passed in do not exist within the current BeadStructure a runtime exception is thrown, as the the sub structure is not actually a sub structure of the current BeadStructure.
idx | Indices of the substructure, must exist within the current BeadStructure |
edges | Edges of the substructure, must exist within the current BeadStructure |
Definition at line 83 of file beadstructure.cc.
|
protected |
Definition at line 38 of file beadstructure.cc.
bool BeadStructure::isSingleStructure | ( | ) |
Determine if the bead structure consists of a single connected structure.
This function will determine if all beads in the structure are connected somehow to everyother bead. The connection does not have to be direct
Definition at line 139 of file beadstructure.cc.
bool BeadStructure::isStructureEquivalent | ( | BeadStructure & | beadstructure | ) |
Compare the topology of two bead structures.
This function looks at how the beads are arranged within the bead structure and determines if the topology is the same.
[in] | beadstructure | - beadstructure to compare with |
Definition at line 169 of file beadstructure.cc.
|
inlineprotectedvirtual |
If extra initialization is needed by a child class when a bead is added this method can be overridden.
Reimplemented in votca::csg::BeadMotif.
Definition at line 142 of file beadstructure.h.
Definition at line 154 of file beadstructure.h.
|
protected |
Definition at line 153 of file beadstructure.h.
|
protected |
Definition at line 152 of file beadstructure.h.
|
protected |
Definition at line 155 of file beadstructure.h.
|
protected |
Definition at line 148 of file beadstructure.h.
|
protected |
Definition at line 150 of file beadstructure.h.
|
protected |
Definition at line 149 of file beadstructure.h.
|
protected |
Definition at line 151 of file beadstructure.h.
|
protected |
Definition at line 147 of file beadstructure.h.