1 /* -*- c++ -*- ---------------------------------------------------------- 2 LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator 3 https://www.lammps.org/, Sandia National Laboratories 4 Steve Plimpton, sjplimp@sandia.gov 5 6 Copyright (2003) Sandia Corporation. Under the terms of Contract 7 DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains 8 certain rights in this software. This software is distributed under 9 the GNU General Public License. 10 11 See the README file in the top-level LAMMPS directory. 12 ------------------------------------------------------------------------- */ 13 14 /* ---------------------------------------------------------------------- 15 Contributing author: Luca Ferraro (CASPUR) 16 email: luca.ferraro@caspur.it 17 18 Tersoff Potential 19 References: 20 1) Tersoff, Phys. Rev. B 39, 5566 (1988) 21 ------------------------------------------------------------------------- */ 22 23 #ifdef PAIR_CLASS 24 // clang-format off 25 PairStyle(tersoff/table,PairTersoffTable); 26 // clang-format on 27 #else 28 29 #ifndef LMP_PAIR_TERSOFF_TABLE_H 30 #define LMP_PAIR_TERSOFF_TABLE_H 31 32 #include "pair.h" 33 34 namespace LAMMPS_NS { 35 36 class PairTersoffTable : public Pair { 37 public: 38 PairTersoffTable(class LAMMPS *); 39 virtual ~PairTersoffTable(); 40 virtual void compute(int, int); 41 void settings(int, char **); 42 void coeff(int, char **); 43 void init_style(); 44 double init_one(int, int); 45 46 static constexpr int NPARAMS_PER_LINE = 17; 47 48 protected: 49 struct Param { 50 double lam1, lam2, lam3; 51 double c, d, h; 52 double gamma, powerm; 53 double powern, beta; 54 double biga, bigb, cutoffR, cutoffS; 55 double cut, cutsq; 56 int ielement, jelement, kelement; 57 int powermint; 58 }; 59 60 double cutmax; // max cutoff for all elements 61 Param *params; // parameter set for an I-J-K interaction 62 63 void allocate(); 64 65 void read_file(char *); 66 void setup_params(); 67 68 // pre-loop coordination functions 69 70 double **preGtetaFunction, **preGtetaFunctionDerived; 71 double *preCutoffFunction, *preCutoffFunctionDerived; 72 virtual void allocatePreLoops(void); 73 virtual void deallocatePreLoops(void); 74 75 // grids 76 77 double minArgumentExponential; 78 double *exponential, ***cutoffFunction, ***cutoffFunctionDerived; 79 double **gtetaFunction, **gtetaFunctionDerived; 80 double **betaZetaPower, **betaZetaPowerDerived; 81 82 void allocateGrids(void); 83 void deallocateGrids(void); 84 }; 85 86 } // namespace LAMMPS_NS 87 88 #endif 89 #endif 90