1 | /*
|
---|
2 | * atom_atominfo.hpp
|
---|
3 | *
|
---|
4 | * Created on: Oct 19, 2009
|
---|
5 | * Author: heber
|
---|
6 | */
|
---|
7 |
|
---|
8 | #ifndef ATOM_ATOMINFO_HPP_
|
---|
9 | #define ATOM_ATOMINFO_HPP_
|
---|
10 |
|
---|
11 |
|
---|
12 | using namespace std;
|
---|
13 |
|
---|
14 | /*********************************************** includes ***********************************/
|
---|
15 |
|
---|
16 | // include config.h
|
---|
17 | #ifdef HAVE_CONFIG_H
|
---|
18 | #include <config.h>
|
---|
19 | #endif
|
---|
20 |
|
---|
21 | #include "LinearAlgebra/Vector.hpp"
|
---|
22 | #include "LinearAlgebra/VectorInterface.hpp"
|
---|
23 |
|
---|
24 | /****************************************** forward declarations *****************************/
|
---|
25 |
|
---|
26 | class AtomInfo;
|
---|
27 | class element;
|
---|
28 | class RealSpaceMatrix;
|
---|
29 |
|
---|
30 | /********************************************** declarations *******************************/
|
---|
31 |
|
---|
32 | class AtomInfo : public VectorInterface {
|
---|
33 |
|
---|
34 | public:
|
---|
35 | Vector AtomicVelocity; //!< velocity vector of atom, giving last velocity within cell
|
---|
36 | Vector AtomicForce; //!< Force vector of atom, giving last force within cell
|
---|
37 |
|
---|
38 | AtomInfo();
|
---|
39 | AtomInfo(const AtomInfo &_atom);
|
---|
40 | AtomInfo(const VectorInterface &_v);
|
---|
41 | virtual ~AtomInfo();
|
---|
42 |
|
---|
43 | const element *getType() const;
|
---|
44 | void setType(const element *);
|
---|
45 | void setType(const int);
|
---|
46 |
|
---|
47 | ///// manipulation of the atomic position
|
---|
48 |
|
---|
49 | // Accessors ussually come in pairs... and sometimes even more than that
|
---|
50 | const double& operator[](size_t i) const;
|
---|
51 | const double& at(size_t i) const;
|
---|
52 | void set(size_t i, const double value);
|
---|
53 | const Vector& getPosition() const;
|
---|
54 |
|
---|
55 | // Assignment operator
|
---|
56 | void setPosition(const Vector& _vector);
|
---|
57 | class VectorInterface &operator=(const Vector& _vector);
|
---|
58 |
|
---|
59 | // operators for mathematical operations
|
---|
60 | const VectorInterface& operator+=(const Vector& b);
|
---|
61 | const VectorInterface& operator-=(const Vector& b);
|
---|
62 | Vector const operator+(const Vector& b) const;
|
---|
63 | Vector const operator-(const Vector& b) const;
|
---|
64 |
|
---|
65 | void Zero();
|
---|
66 | void One(const double one);
|
---|
67 | void LinearCombinationOfVectors(const Vector &x1, const Vector &x2, const Vector &x3, const double * const factors);
|
---|
68 |
|
---|
69 | double distance(const Vector &point) const;
|
---|
70 | double DistanceSquared(const Vector &y) const;
|
---|
71 | double distance(const VectorInterface &_atom) const;
|
---|
72 | double DistanceSquared(const VectorInterface &_atom) const;
|
---|
73 |
|
---|
74 | void ScaleAll(const double *factor);
|
---|
75 | void ScaleAll(const Vector &factor);
|
---|
76 | void Scale(const double factor);
|
---|
77 |
|
---|
78 | std::ostream & operator << (std::ostream &ost) const;
|
---|
79 |
|
---|
80 | private:
|
---|
81 | Vector AtomicPosition; //!< coordinate vector of atom, giving last position within cell
|
---|
82 | const element *AtomicElement; //!< pointing to element
|
---|
83 | };
|
---|
84 |
|
---|
85 | std::ostream & operator << (std::ostream &ost, const AtomInfo &a);
|
---|
86 |
|
---|
87 | const AtomInfo& operator*=(AtomInfo& a, const double m);
|
---|
88 | AtomInfo const operator*(const AtomInfo& a, const double m);
|
---|
89 | AtomInfo const operator*(const double m, const AtomInfo& a);
|
---|
90 |
|
---|
91 | #endif /* ATOM_ATOMINFO_HPP_ */
|
---|