votca 2024.1-dev
Loading...
Searching...
No Matches
beadlist.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18#pragma once
19#ifndef VOTCA_CSG_BEADLIST_H
20#define VOTCA_CSG_BEADLIST_H
21
22// Standard includes
23#include <string>
24#include <vector>
25
26// VOTCA includes
27#include <votca/tools/eigen.h>
28#include <votca/tools/types.h>
29
30namespace votca {
31namespace csg {
40class Topology;
41class Bead;
42
43class BeadList {
44 public:
46 Index Generate(Topology &top, const std::string &select);
49 Index GenerateInSphericalSubvolume(Topology &top, const std::string &select,
50 Eigen::Vector3d ref, double radius);
51
52 Index size() const { return beads_.size(); }
53
54 bool empty() const { return beads_.empty(); }
55
56 void push_back(Bead *bead) { beads_.push_back(bead); }
57
58 using iterator = typename std::vector<Bead *>::iterator;
59
60 iterator begin() { return beads_.begin(); }
61 iterator end() { return beads_.end(); }
62
63 const Topology &getTopology() const { return *topology_; }
64
65 private:
66 std::vector<Bead *> beads_;
67 Topology *topology_ = nullptr;
68};
69
70} // namespace csg
71} // namespace votca
72
73#endif // VOTCA_CSG_BEADLIST_H
Index Generate(Topology &top, const std::string &select)
Select all beads of type "select".
Definition beadlist.cc:30
const Topology & getTopology() const
Definition beadlist.h:63
typename std::vector< Bead * >::iterator iterator
Definition beadlist.h:58
iterator begin()
Definition beadlist.h:60
std::vector< Bead * > beads_
Definition beadlist.h:66
void push_back(Bead *bead)
Definition beadlist.h:56
Index size() const
Definition beadlist.h:52
bool empty() const
Definition beadlist.h:54
Topology * topology_
Definition beadlist.h:67
Index GenerateInSphericalSubvolume(Topology &top, const std::string &select, Eigen::Vector3d ref, double radius)
Select all beads of type "select" withn a radius "radius" of reference vector "ref".
Definition beadlist.cc:57
information about a bead
Definition bead.h:50
topology of the whole system
Definition topology.h:81
base class for all analysis tools
Definition basebead.h:33
Eigen::Index Index
Definition types.h:26