Emdee
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
fanntwoparticleforce.h
Go to the documentation of this file.
1 #ifndef FANNTWOPARTICLEFORCE_H
2 #define FANNTWOPARTICLEFORCE_H
3 
4 #include <vector>
5 #include "atomtype.h"
7 struct fann;
8 typedef double fann_type;
9 
10 using std::vector;
11 
13 public:
14  fann* ann;
15  double r12Min;
16  double r12Max;
20  double energyMin;
21  double energyMax;
28  double energyOffset;
29 
30  double rescaleDistance(double r12) const;
31 
32  double rescaleEnergy(double energy) const;
33 
34  double rescaleEnergyDerivative(double value) const;
35 
36  double tailCorrectionDampingFactor(double l12) const;
37  double tailCorrectionDampingFactorDerivative(double l12) const;
38  double headCorrectionEnergy(double l12) const;
39  double headCorrectionForce(double l12) const;
40 };
41 
43 {
44 public:
46 
47  void addNetwork(const AtomType& atomType1, const AtomType& atomType2, const std::string& fileName, const std::string& boundsFilename);
48 
49  // TwoParticleForce interface
50 public:
51  virtual void calculateAndApplyForce(Atom *atom1, Atom *atom2);
52  virtual void calculateAndApplyForce(Atom *atom1, Atom *atom2, const Vector3 &atom2Offset);
53 
54 private:
55  void warnAboutMissingNetwork();
56  fann_type m_fanntmp;
57  bool m_hasWarnedAboutMissingNetwork;
58  vector<FannTwoParticleNetwork> m_networks;
59 };
60 
61 #endif // FANNTWOPARTICLEFORCE_H