forked from masayoshi-ogura/HDNNP-LAMMPS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpair_nnp.h
executable file
·95 lines (66 loc) · 2.67 KB
/
pair_nnp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/* -*- c++ -*- ----------------------------------------------------------
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
http://lammps.sandia.gov, Sandia National Laboratories
Steve Plimpton, [email protected]
Copyright (2003) Sandia Corporation. Under the terms of Contract
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
certain rights in this software. This software is distributed under
the GNU General Public License.
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(nnp, PairNNP)
#else
#ifndef LMP_PAIR_NNP_H
#define LMP_PAIR_NNP_H
#include "neural_network_potential.h"
#include "pair.h"
#include "symmetry_function.h"
namespace LAMMPS_NS {
class PairNNP : public Pair {
public:
PairNNP(class LAMMPS *);
virtual ~PairNNP();
virtual void compute(int, int);
void settings(int, char **);
virtual void coeff(int, char **);
virtual double init_one(int, int);
virtual void init_style();
protected:
double cutmax; // max cutoff for all elements
int nelements; // # of unique elements
int ntwobody; // # of 2-body combinations
int nthreebody; // # of 3-body combinations
vector<vector<int> > combinations; // index of combination of 2 element
vector<string> elements; // names of unique elements
vector<int> map; // mapping from atom types to elements
vector<NNP> masters; // parameter set for an I-J-K interaction
int nG1params, nG2params, nG4params;
vector<vector<double> > G1params, G2params, G4params;
int nfeature;
int npreprocess;
vector<MatrixXd> pca_transform;
vector<VectorXd> pca_mean;
vector<VectorXd> scl_max;
vector<VectorXd> scl_min;
double scl_target_max;
double scl_target_min;
vector<VectorXd> std_mean;
vector<VectorXd> std_std;
virtual void allocate();
void get_next_line(ifstream &, stringstream &, int &);
void read_file(char *);
virtual void setup_params();
void geometry(int, int *, int, VectorXd *, VectorXd &, MatrixXd &, VectorXd *,
MatrixXd *);
void feature_index(int *, int, std::vector<int> &, vector< vector<int> > &);
typedef void (PairNNP::*FuncPtr)(int, VectorXd &, MatrixXd &, MatrixXd &,
MatrixXd &);
vector<FuncPtr> preprocesses;
void pca(int, VectorXd &, MatrixXd &, MatrixXd &, MatrixXd &);
void scaling(int, VectorXd &, MatrixXd &, MatrixXd &, MatrixXd &);
void standardization(int, VectorXd &, MatrixXd &, MatrixXd &, MatrixXd &);
};
} // namespace LAMMPS_NS
#endif
#endif