19#ifndef VOTCA_CSG_BEADSTRUCTURE_H
20#define VOTCA_CSG_BEADSTRUCTURE_H
23#include <unordered_map>
71 const std::vector<tools::Edge> &edges)
const;
154 std::unordered_map<Index, BeadInfo>
beads_;
160 if (
beads_.count(bead.getId())) {
161 std::string err =
"Cannot add bead with Id ";
162 err += std::to_string(bead.getId());
163 err +=
" because each bead must have a unique Id and a bead with that Id ";
164 err +=
"already exists within the beadstructure";
165 throw std::invalid_argument(err);
168 size_t numberOfBeads =
beads_.size();
170 bead_info.
mass = bead.getMass();
171 bead_info.
name = bead.getName();
173 beads_[bead.getId()] = bead_info;
175 if (numberOfBeads !=
beads_.size()) {
Designed to determine if the structure beads passed in.
std::string structure_id_
tools::GraphNode BeadInfoToGraphNode_(const BeadInfo &)
bool single_structureUpToDate_
std::set< tools::Edge > connections_
size_t BeadCount() const noexcept
returns the number of beads in the bead structure
virtual void UpdateOnBeadAddition_()
bool BeadExist(Index bead_id) const
Determine if a bead exists in the structure.
std::vector< Index > getNeighBeadIds(const Index &index)
Return a vector of all the ids of the beads neighboring the index.
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::unordered_map< Index, tools::GraphNode > graphnodes_
std::unordered_map< Index, BeadInfo > beads_
void CalculateStructure_()
bool isStructureEquivalent(BeadStructure &beadstructure)
Compare the topology of two bead structures.
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.
std::vector< Index > getBeadIds() const
Return the ids of the beads that are in the structure.
bool isSingleStructure()
Determine if the bead structure consists of a single connected structure.
base class for all analysis tools
Small structure to help store bead info relevant to the structure.