votca 2024.2-dev
|
Designed determine what kind of structure a beadstructure has. More...
#include <beadmotif.h>
Public Types | |
enum | MotifType { empty , single_bead , line , loop , fused_ring , single_structure , multiple_structures , undefined } |
Public Member Functions | |
BeadMotif ()=default | |
BeadMotif (const BeadStructure &structure) | |
MotifType | getType () |
Gets the motif type, calculates it first if it is not yet known. | |
bool | isMotifSimple () |
Determines if the motif type is a simple type. | |
void | ConnectBeads (const Index &bead1_id, const Index &bead2_id) final |
Adds a new connection to the motif. | |
Public Member Functions inherited from votca::csg::BeadStructure | |
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 | |
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. | |
Private Member Functions | |
void | UpdateOnBeadAddition_ () final |
void | InitializeGraph_ () |
bool | junctionExist_ () |
void | CalculateType_ () |
bool | isSingle_ () const noexcept |
bool | isLine_ () |
bool | isLoop_ () |
bool | isFusedRing_ () |
Private Attributes | |
MotifType | type_ = MotifType::undefined |
bool | junctionsUpToDate_ = false |
bool | type_up_to_date_ = false |
std::vector< Index > | junctions_ |
tools::ReducedGraph | reduced_graph_ |
Additional Inherited Members | |
Protected Member Functions inherited from votca::csg::BeadStructure | |
void | InitializeGraph_ () |
void | CalculateStructure_ () |
tools::GraphNode | BeadInfoToGraphNode_ (const BeadInfo &) |
Protected Attributes inherited from votca::csg::BeadStructure | |
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 determine what kind of structure a beadstructure has.
Wants a beadstructure is created there are several different forms it can have, this class helps to classify and break structures up into the appropriate sub class. The possible classes include:
Some of the structures are considered fundamental and cannot be broken up any more than they are. These elements are listed as simple
Examples of each type are shown below connections are indicated with lines
Single Bead:
H1
Line:
C1 - C2 - C3 H1 - H2 H1 H2 \ / O1 Loop:
C1 - C2 C5 - C6 | | / \ C4 - C3 C7 C8 \ / C9 - C10
Fused Ring:
C5 - C6 / \ C7 C8 - C11 \ / \ C9 - C10 C12 \ / C13 - C14
Single Structures:
H1 H5 H6 | \ /
H2 - C1 - H3 C1 - C2 | / \ H4 H7 - C3 C4 - H8 \ / C5 - C6 / \ H9 H10
Multiple Structures:
Any combination of more than one structure
The Single, line, loop and Fused Ring types are all elementary types that represent a fundamental structural unit.
Single Structure represents a type that has not been broken up into its fundamental components but consists of a single interconnected structure.
Multiple Structures means that the structure consists of multiple structures
Undefined means the structure has not yet been categorized.
Though the Beadmotif inherits from the Beadstructure its methods are kept private the reason is that the type might be incorrect if an AddBead from the original class is called.
Definition at line 111 of file beadmotif.h.
Enumerator | |
---|---|
empty | |
single_bead | |
line | |
loop | |
fused_ring | |
single_structure | |
multiple_structures | |
undefined |
Definition at line 113 of file beadmotif.h.
|
default |
|
inline |
Definition at line 126 of file beadmotif.h.
|
private |
Definition at line 53 of file beadmotif.cc.
|
finalvirtual |
Adds a new connection to the motif.
Also switches an internal attribute to indicate the beadtype is no longer up to date.
[in] | bead1_id | - id of the first bead that are connected |
[in] | bead2_id | - id of the second bead that are connected |
Reimplemented from votca::csg::BeadStructure.
Definition at line 208 of file beadmotif.cc.
BeadMotif::MotifType votca::csg::BeadMotif::getType | ( | ) |
Gets the motif type, calculates it first if it is not yet known.
Definition at line 191 of file beadmotif.cc.
|
private |
Definition at line 40 of file beadmotif.cc.
|
private |
One has to explore the whole tree from each of the junctions to determine if the model is a fused ring or not. For speed it might make since to reduce the graph first to junctions of 3 or more.
if There is not way back to the junction than you have something like this:
c1 - c2 - c5 - c6 | | | | c3 - c4 c7 - c8
Say you start at c2 and head down tree c5 if you never find a way back you can split it
If you have something like this
c1 - c2 - c3 | / \ | c4 c5
Then you do not have a fused ring, must be represented as a joint and two lines. Exploring a tree will only lead to one way back.
c6 / |
c1 - c2 - c3 | / \ | c4 c5
Still acts like a joint, For it not to be a joint exploring a single branch originating from the junction should lead to exploration of all the edges.
Definition at line 153 of file beadmotif.cc.
|
private |
Definition at line 79 of file beadmotif.cc.
|
private |
Definition at line 104 of file beadmotif.cc.
bool votca::csg::BeadMotif::isMotifSimple | ( | ) |
Determines if the motif type is a simple type.
If the motif is of type single_bead, line, loop or fused ring it will return true.
Definition at line 199 of file beadmotif.cc.
|
privatenoexcept |
Definition at line 72 of file beadmotif.cc.
|
private |
Definition at line 45 of file beadmotif.cc.
|
finalprivatevirtual |
If extra initialization is needed by a child class when a bead is added this method can be overridden.
Reimplemented from votca::csg::BeadStructure.
Definition at line 181 of file beadmotif.cc.
|
private |
Definition at line 157 of file beadmotif.h.
|
private |
Definition at line 154 of file beadmotif.h.
|
private |
Definition at line 158 of file beadmotif.h.
|
private |
Definition at line 153 of file beadmotif.h.
|
private |
Definition at line 155 of file beadmotif.h.