QNANO
Neighborhood_Criterion_vdW.h
1 #ifndef QNANO_NEW_NEIGHBORHOOD_CRITERION_VDW_DEFINED_H
2 #define QNANO_NEW_NEIGHBORHOOD_CRITERION_VDW_DEFINED_H
3 
4 #include "structure/Neighborhood_Criterion.h"
5 
7 public:
8  double distance;
9  double tolerance;
10 
11  Neighborhood_Criterion_vdW(double distance_, double tolerance_=0.2)
12  : distance(distance_), tolerance(tolerance_){
13  }
14 
15  virtual bool is_neighbor(const Atom &a1, const Atom &a2) const{
16  Vec3d pos1(a1.pos[0], a1.pos[1], a1.pos[2]+distance);
17  Vec3d pos2(a1.pos[0], a1.pos[1], a1.pos[2]-distance);
18  if( dist(pos1,a2.pos)<distance*tolerance)return true;
19  else if(dist(pos2,a2.pos)<distance*tolerance)return true;
20  else return false;
21  }
22  virtual double upper_bound_radius() const{ return distance*(1+tolerance);}
23 
24 };
25 
26 
27 #endif
Class to store positions and to handle operations on 3d vectors.
Definition: Vec3d.h:9
Definition: Atom.h:6
Definition: Neighborhood_Criterion.h:6
Definition: Neighborhood_Criterion_vdW.h:6