[6b919f8] | 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 |
|
---|
[57f243] | 21 | #include "LinearAlgebra/Vector.hpp"
|
---|
[8f4df1] | 22 | #include "LinearAlgebra/VectorInterface.hpp"
|
---|
[6b919f8] | 23 |
|
---|
| 24 | /****************************************** forward declarations *****************************/
|
---|
| 25 |
|
---|
[d74077] | 26 | class AtomInfo;
|
---|
[6b919f8] | 27 | class element;
|
---|
[cca9ef] | 28 | class RealSpaceMatrix;
|
---|
[6b919f8] | 29 |
|
---|
| 30 | /********************************************** declarations *******************************/
|
---|
| 31 |
|
---|
[d74077] | 32 | class AtomInfo : public VectorInterface {
|
---|
| 33 |
|
---|
[6b919f8] | 34 | public:
|
---|
[d74077] | 35 | Vector AtomicVelocity; //!< velocity vector of atom, giving last velocity within cell
|
---|
| 36 | Vector AtomicForce; //!< Force vector of atom, giving last force within cell
|
---|
[6b919f8] | 37 |
|
---|
| 38 | AtomInfo();
|
---|
[d74077] | 39 | AtomInfo(const AtomInfo &_atom);
|
---|
| 40 | AtomInfo(const VectorInterface &_v);
|
---|
| 41 | virtual ~AtomInfo();
|
---|
[6b919f8] | 42 |
|
---|
[d74077] | 43 | const element *getType() const;
|
---|
[ead4e6] | 44 | void setType(const element *);
|
---|
[d74077] | 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;
|
---|
[f16a4b] | 79 |
|
---|
[6b919f8] | 80 | private:
|
---|
[d74077] | 81 | Vector AtomicPosition; //!< coordinate vector of atom, giving last position within cell
|
---|
| 82 | const element *AtomicElement; //!< pointing to element
|
---|
[6b919f8] | 83 | };
|
---|
| 84 |
|
---|
[d74077] | 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 |
|
---|
[6b919f8] | 91 | #endif /* ATOM_ATOMINFO_HPP_ */
|
---|