source: src/Bond/StretchBond.hpp@ e9f307

Candidate_v1.7.0 stable
Last change on this file since e9f307 was 9f55b9, checked in by Frederik Heber <frederik.heber@…>, 5 years ago

Extracted functor StretchBondUtil from StretchBondAction.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1/*
2 * StretchBond.hpp
3 *
4 * Created on: Oct 4, 2020
5 * Author: heber
6 */
7
8
9#ifndef BOND_STRETCHBOND_HPP_
10#define BOND_STRETCHBOND_HPP_
11
12// include config.h
13#ifdef HAVE_CONFIG_H
14#include <config.h>
15#endif
16
17#include <vector>
18
19#include "LinearAlgebra/Vector.hpp"
20
21#include "Graph/BoostGraphHelpers.hpp"
22#include "types.hpp"
23
24class atom;
25class bond;
26class Box;
27class molecule;
28
29/**
30 * Helper class for stretching bonds in a molecule.
31 */
32class StretchBondUtil {
33public:
34 StretchBondUtil(const std::vector< atom *> atoms);
35
36 /**
37 * Stretches the bond of two given atoms.
38 *
39 */
40 bool operator()(const double newdistance);
41
42 const std::vector<Vector>& getShift() const { return Shift; }
43
44 double getOldDistance() const { return olddistance; }
45
46 const std::vector< BoostGraphHelpers::Nodeset_t > & getBondSides() const { return bondside_sets; }
47
48 const molecule & getMolecule() const { return *mol; }
49
50private:
51 static bool addEdgePredicate(
52 const bond &_bond,
53 const std::vector<atomId_t> &_atomids);
54
55 const std::vector< atom *> atoms;
56 molecule *mol;
57 double olddistance;
58 std::vector<Vector> Shift;
59 std::vector<atomId_t> atomids;
60 const Box &domain;
61
62 std::vector< BoostGraphHelpers::Nodeset_t > bondside_sets;
63};
64
65#endif /* BOND_STRETCHBOND_HPP_ */
Note: See TracBrowser for help on using the repository browser.