simplify and reformat
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
/* -*- c++ -*- ----------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||||
https://www.lammps.org/ Sandia National Laboratories
|
https://www.lammps.org/ Sandia National Laboratories
|
||||||
Steve Plimpton, sjplimp@sandia.gov
|
Steve Plimpton, sjplimp@sandia.gov
|
||||||
@ -43,74 +43,36 @@ Fingerprint::Fingerprint(PairRANN *_pair)
|
|||||||
pair = _pair;
|
pair = _pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
Fingerprint::~Fingerprint() {
|
// Smooth cutoff, goes from 1 to zero over the interval rc-dr to rc.
|
||||||
|
// Same as MEAM uses. Used by generateradialtable and generatexpcuttable.
|
||||||
|
|
||||||
}
|
double Fingerprint::cutofffunction(double r, double rc, double dr)
|
||||||
|
{
|
||||||
bool Fingerprint::parse_values(std::string line,std::vector<std::string> line1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Fingerprint::init(int *i,int id) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Fingerprint::allocate() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Fingerprint::compute_fingerprint(double *features,double *dfeaturesx,double *dfeaturesy,double * dfeaturesz, int ii,int sid,double *xn,double *yn,double*zn,int *tn,int jnum,int *jl) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Fingerprint::compute_fingerprint(double *features,double *dfeaturesx,double *dfeaturesy,double * dfeaturesz,double *Sik, double *dSikx, double*dSiky, double *dSikz, double *dSijkx, double *dSijky, double *dSijkz, bool *Bij, int ii,int sid,double *xn,double *yn,double*zn,int *tn,int jnum,int *jl) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Fingerprint::compute_fingerprint(double *features,double *dfeaturesx,double *dfeaturesy,double * dfeaturesz,double *sx, double *sy, double *sz, int ii,int sid,double *xn,double *yn,double*zn,int *tn,int jnum,int *jl) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Fingerprint::compute_fingerprint(double *features,double *dfeaturesx,double *dfeaturesy,double * dfeaturesz,double *sx, double *sy, double *sz, double *Sik, double *dSikx, double*dSiky, double *dSikz, double *dSijkx, double *dSijky, double *dSijkz, bool *Bij, int ii,int sid,double *xn,double *yn,double*zn,int *tn,int jnum,int *jl) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Fingerprint::write_values(FILE *fid) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
int Fingerprint::get_length() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
//Smooth cutoff, goes from 1 to zero over the interval rc-dr to rc. Same as MEAM uses. Used by generateradialtable and generatexpcuttable.
|
|
||||||
double Fingerprint::cutofffunction(double r,double rc, double dr) {
|
|
||||||
double out;
|
double out;
|
||||||
if (r < (rc -dr))out=1;
|
if (r < (rc - dr))
|
||||||
else if (r>rc)out=0;
|
out = 1;
|
||||||
|
else if (r > rc)
|
||||||
|
out = 0;
|
||||||
else {
|
else {
|
||||||
out = 1-(rc-r)/dr;
|
out = 1 - (rc - r) / dr;
|
||||||
out *= out;
|
out *= out;
|
||||||
out *= out;
|
out *= out;
|
||||||
out = 1-out;
|
out = 1 - out;
|
||||||
out *= out;
|
out *= out;
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fingerprint::generate_rinvssqrttable() {
|
void Fingerprint::generate_rinvssqrttable()
|
||||||
|
{
|
||||||
int buf = 5;
|
int buf = 5;
|
||||||
int m;
|
int m;
|
||||||
double r1;
|
double r1;
|
||||||
double cutmax = pair->cutmax;
|
double cutmax = pair->cutmax;
|
||||||
int res = pair->res;
|
int res = pair->res;
|
||||||
rinvsqrttable = new double[res+buf];
|
rinvsqrttable = new double[res + buf];
|
||||||
for (m=0;m<(res+buf);m++) {
|
for (m = 0; m < (res + buf); m++) {
|
||||||
r1 = cutmax*cutmax*(double)(m)/(double)(res);
|
r1 = cutmax * cutmax * (double) (m) / (double) (res);
|
||||||
rinvsqrttable[m] = 1/sqrt(r1);
|
rinvsqrttable[m] = 1 / sqrt(r1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,38 +35,62 @@ DISTRIBUTION A. Approved for public release; distribution unlimited. OPSEC#4918
|
|||||||
#include "pair_rann.h"
|
#include "pair_rann.h"
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
namespace RANN {
|
namespace RANN {
|
||||||
class Fingerprint {
|
class Fingerprint {
|
||||||
public:
|
public:
|
||||||
Fingerprint(PairRANN *);
|
Fingerprint(PairRANN *);
|
||||||
virtual ~Fingerprint();
|
virtual ~Fingerprint() {}
|
||||||
virtual bool parse_values(std::string,std::vector<std::string>);
|
|
||||||
virtual void write_values(FILE *);
|
|
||||||
virtual void init(int*,int);
|
|
||||||
virtual void allocate();
|
|
||||||
void init_screen(int);
|
|
||||||
virtual void compute_fingerprint(double*,double*,double*,double*,int,int,double*,double*,double*,int*,int,int*);//no screen,no spin
|
|
||||||
virtual void compute_fingerprint(double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,bool*,int,int,double*,double*,double*,int*,int,int*);//screen
|
|
||||||
virtual void compute_fingerprint(double*,double*,double*,double*,double*,double*,double*,int,int,double*,double*,double*,int*,int,int*);//spin
|
|
||||||
virtual void compute_fingerprint(double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,double*,bool*,int,int,double*,double*,double*,int*,int,int*);//spin,screen
|
|
||||||
virtual int get_length();
|
|
||||||
virtual double cutofffunction(double,double, double);
|
|
||||||
virtual void generate_rinvssqrttable();
|
|
||||||
bool spin;
|
|
||||||
bool screen;
|
|
||||||
int n_body_type;//i-j vs. i-j-k vs. i-j-k-l, etc.
|
|
||||||
bool empty;
|
|
||||||
bool fullydefined;
|
|
||||||
int startingneuron;
|
|
||||||
int id;//based on ordering of fingerprints listed for i-j in potential file
|
|
||||||
const char *style;
|
|
||||||
int* atomtypes;
|
|
||||||
double *rinvsqrttable;
|
|
||||||
double rc;
|
|
||||||
PairRANN *pair;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
virtual bool parse_values(std::string, std::vector<std::string>) { return false; }
|
||||||
|
virtual void write_values(FILE *) {}
|
||||||
|
|
||||||
|
virtual void init(int *, int) {}
|
||||||
|
virtual void allocate() {}
|
||||||
|
|
||||||
|
void init_screen(int);
|
||||||
|
|
||||||
|
//no screen,no spin
|
||||||
|
virtual void compute_fingerprint(double *, double *, double *, double *, int, int, double *,
|
||||||
|
double *, double *, int *, int, int *)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//screen
|
||||||
|
virtual void compute_fingerprint(double *, double *, double *, double *, double *, double *,
|
||||||
|
double *, double *, double *, double *, double *, bool *, int,
|
||||||
|
int, double *, double *, double *, int *, int, int *)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//spin
|
||||||
|
virtual void compute_fingerprint(double *, double *, double *, double *, double *, double *,
|
||||||
|
double *, int, int, double *, double *, double *, int *, int,
|
||||||
|
int *)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
//spin,screen
|
||||||
|
virtual void compute_fingerprint(double *, double *, double *, double *, double *, double *,
|
||||||
|
double *, double *, double *, double *, double *, double *,
|
||||||
|
double *, double *, bool *, int, int, double *, double *,
|
||||||
|
double *, int *, int, int *)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int get_length(){return 0};
|
||||||
|
virtual double cutofffunction(double, double, double);
|
||||||
|
virtual void generate_rinvssqrttable();
|
||||||
|
bool spin;
|
||||||
|
bool screen;
|
||||||
|
int n_body_type; //i-j vs. i-j-k vs. i-j-k-l, etc.
|
||||||
|
bool empty;
|
||||||
|
bool fullydefined;
|
||||||
|
int startingneuron;
|
||||||
|
int id; //based on ordering of fingerprints listed for i-j in potential file
|
||||||
|
const char *style;
|
||||||
|
int *atomtypes;
|
||||||
|
double *rinvsqrttable;
|
||||||
|
double rc;
|
||||||
|
PairRANN *pair;
|
||||||
|
};
|
||||||
|
} // namespace RANN
|
||||||
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
#endif /* RANN_FINGERPRINT_H_ */
|
#endif /* RANN_FINGERPRINT_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user