QNANO
Atom.h
1 #ifndef QNANO_NEW_ATOM_DEFINED_H
2 #define QNANO_NEW_ATOM_DEFINED_H
3 
4 #include "tools/Vec3d.h"
5 
6 class Atom{
7 public:
9  int element;
10  Vec3d pos;
11 
12  //setter and constructors
13  inline void set(int i, Vec3d v){
14  element=i;
15  pos=v;
16  }
17  Atom(){};
18  Atom(int element_, Vec3d pos_):element(element_),pos(pos_){};
19  Atom(int element_, double x, double y, double z):element(element_),pos(x,y,z){};
20 
21  //additional operators:
22 
23  Atom & operator+=(const Vec3d &otherpos){
24  pos+=otherpos;
25  return *this;
26  }
27 };
28 //distance between atoms:
29 inline double dist(const Atom &a1, const Atom &a2){
30  return dist(a1.pos, a2.pos);
31 }
32 Atom operator+(const Atom& a, const Vec3d& pos);
33 
34 #endif
int element
Atoms are specified by their element and their position.
Definition: Atom.h:9
Class to store positions and to handle operations on 3d vectors.
Definition: Vec3d.h:9
Definition: Atom.h:6