votca 2024.2-dev
Loading...
Searching...
No Matches
beadpair.h
Go to the documentation of this file.
1/*
2 * Copyright 2009-2020 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#ifndef VOTCA_CSG_BEADPAIR_H
19#define VOTCA_CSG_BEADPAIR_H
20
21// VOTCA includes
22#include <votca/tools/eigen.h>
23
24namespace votca {
25namespace csg {
26
35class BeadPair {
36 public:
37 BeadPair() = default;
38 BeadPair(Bead *bead1, Bead *bead2, Eigen::Vector3d r)
39 : pair_(std::pair<Bead *, Bead *>(bead1, bead2)),
40 r_(r),
41 dist_(r.norm()) {}
42
43 Bead *first() { return pair_.first; }
44 Bead *second() { return pair_.second; }
46 const Eigen::Vector3d &r() const { return r_; }
48 double dist() const { return dist_; }
49
50 protected:
51 std::pair<Bead *, Bead *> pair_;
52
53 Eigen::Vector3d r_;
54 double dist_;
55};
56
57} // namespace csg
58} // namespace votca
59
60#endif // VOTCA_CSG_BEADPAIR_H
A particle pair.
Definition beadpair.h:35
Eigen::Vector3d r_
Definition beadpair.h:53
std::pair< Bead *, Bead * > pair_
Definition beadpair.h:51
double dist() const
the distance of the beads
Definition beadpair.h:48
BeadPair(Bead *bead1, Bead *bead2, Eigen::Vector3d r)
Definition beadpair.h:38
const Eigen::Vector3d & r() const
the vector connecting two beads
Definition beadpair.h:46
information about a bead
Definition bead.h:50
STL namespace.
base class for all analysis tools
Definition basebead.h:33