mirror of https://github.com/lammps/lammps.git
(partially) apply clang-format
This commit is contained in:
parent
c0a01ae19b
commit
b68e56e9be
|
@ -728,7 +728,7 @@ void CFITPOD::read_data_files(std::string data_file, std::vector<std::string> sp
|
||||||
if (data.fraction >= 1.0) {
|
if (data.fraction >= 1.0) {
|
||||||
if (comm->me == 0)
|
if (comm->me == 0)
|
||||||
utils::logmesg(lmp, "**************** Begin of Training Data Set ****************\n");
|
utils::logmesg(lmp, "**************** Begin of Training Data Set ****************\n");
|
||||||
if ((int) traindata.data_path.size() > 1)
|
if (traindata.data_path.size() > 1)
|
||||||
get_data(traindata, species);
|
get_data(traindata, species);
|
||||||
else
|
else
|
||||||
error->all(FLERR,"data set is not found");
|
error->all(FLERR,"data set is not found");
|
||||||
|
@ -737,7 +737,7 @@ void CFITPOD::read_data_files(std::string data_file, std::vector<std::string> sp
|
||||||
} else {
|
} else {
|
||||||
if (comm->me == 0)
|
if (comm->me == 0)
|
||||||
utils::logmesg(lmp, "**************** Begin of Training Data Set ****************\n");
|
utils::logmesg(lmp, "**************** Begin of Training Data Set ****************\n");
|
||||||
if ((int) data.data_path.size() > 1)
|
if (data.data_path.size() > 1)
|
||||||
get_data(data, species);
|
get_data(data, species);
|
||||||
else
|
else
|
||||||
error->all(FLERR,"data set is not found");
|
error->all(FLERR,"data set is not found");
|
||||||
|
|
|
@ -32,8 +32,8 @@
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using MathConst::MY_PI;
|
using MathConst::MY_PI;
|
||||||
using MathSpecial::powint;
|
|
||||||
using MathSpecial::cube;
|
using MathSpecial::cube;
|
||||||
|
using MathSpecial::powint;
|
||||||
|
|
||||||
#define MAXLINE 1024
|
#define MAXLINE 1024
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ MLPOD::podstruct::podstruct() :
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
MLPOD::MLPOD(LAMMPS* _lmp, const std::string &pod_file, const std::string &coeff_file)
|
MLPOD::MLPOD(LAMMPS *_lmp, const std::string &pod_file, const std::string &coeff_file) :
|
||||||
: Pointers(_lmp)
|
Pointers(_lmp)
|
||||||
{
|
{
|
||||||
pod.besselparams = nullptr;
|
pod.besselparams = nullptr;
|
||||||
pod.pbc = nullptr;
|
pod.pbc = nullptr;
|
||||||
|
@ -56,12 +56,9 @@ MLPOD::MLPOD(LAMMPS* _lmp, const std::string &pod_file, const std::string &coeff
|
||||||
|
|
||||||
// read pod coefficient file to podstruct
|
// read pod coefficient file to podstruct
|
||||||
|
|
||||||
if (coeff_file != "")
|
if (coeff_file != "") read_coeff_file(coeff_file);
|
||||||
read_coeff_file(coeff_file);
|
|
||||||
|
|
||||||
if (pod.snaptwojmax > 0) {
|
if (pod.snaptwojmax > 0) { InitSnap(); }
|
||||||
InitSnap();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MLPOD::~MLPOD()
|
MLPOD::~MLPOD()
|
||||||
|
@ -73,15 +70,15 @@ MLPOD::~MLPOD()
|
||||||
memory->destroy(pod.elemindex);
|
memory->destroy(pod.elemindex);
|
||||||
memory->destroy(pod.besselparams);
|
memory->destroy(pod.besselparams);
|
||||||
memory->destroy(pod.coeff);
|
memory->destroy(pod.coeff);
|
||||||
if (pod.ns2 > 0){
|
if (pod.ns2 > 0) {
|
||||||
memory->destroy(pod.Phi2);
|
memory->destroy(pod.Phi2);
|
||||||
memory->destroy(pod.Lambda2);
|
memory->destroy(pod.Lambda2);
|
||||||
}
|
}
|
||||||
if (pod.ns3 > 0){
|
if (pod.ns3 > 0) {
|
||||||
memory->destroy(pod.Phi3);
|
memory->destroy(pod.Phi3);
|
||||||
memory->destroy(pod.Lambda3);
|
memory->destroy(pod.Lambda3);
|
||||||
}
|
}
|
||||||
if (pod.ns4 > 0){
|
if (pod.ns4 > 0) {
|
||||||
memory->destroy(pod.Phi4);
|
memory->destroy(pod.Phi4);
|
||||||
memory->destroy(pod.Lambda4);
|
memory->destroy(pod.Lambda4);
|
||||||
}
|
}
|
||||||
|
@ -107,6 +104,9 @@ MLPOD::~MLPOD()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
|
|
||||||
|
|
||||||
void MLPOD::print_matrix(const char *desc, int m, int n, double **a, int /*lda*/ )
|
void MLPOD::print_matrix(const char *desc, int m, int n, double **a, int /*lda*/ )
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
|
@ -25,23 +25,22 @@
|
||||||
#define DPOSV dposv_
|
#define DPOSV dposv_
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
double DDOT(int *, double *, int *, double *, int *);
|
double DDOT(int *, double *, int *, double *, int *);
|
||||||
void DGEMV(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
|
void DGEMV(char *, int *, int *, double *, double *, int *, double *, int *, double *, double *,
|
||||||
int *);
|
int *);
|
||||||
void DGEMM(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *,
|
void DGEMM(char *, char *, int *, int *, int *, double *, double *, int *, double *, int *,
|
||||||
double *, double *, int *);
|
double *, double *, int *);
|
||||||
void DGETRF(int *, int *, double *, int *, int *, int *);
|
void DGETRF(int *, int *, double *, int *, int *, int *);
|
||||||
void DGETRI(int *, double *, int *, int *, double *, int *, int *);
|
void DGETRI(int *, double *, int *, int *, double *, int *, int *);
|
||||||
void DSYEV(char *, char *, int *, double *, int *, double *, double *, int *, int *);
|
void DSYEV(char *, char *, int *, double *, int *, double *, double *, int *, int *);
|
||||||
void DPOSV(char *, int *, int *, double *, int *, double *, int *, int *);
|
void DPOSV(char *, int *, int *, double *, int *, double *, int *, int *);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace LAMMPS_NS {
|
namespace LAMMPS_NS {
|
||||||
|
|
||||||
class MLPOD : protected Pointers {
|
class MLPOD : protected Pointers {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// functions for reading input files
|
// functions for reading input files
|
||||||
|
|
||||||
void read_pod(const std::string &pod_file);
|
void read_pod(const std::string &pod_file);
|
||||||
|
@ -50,99 +49,106 @@ private:
|
||||||
// functions for calculating/collating POD descriptors/coefficients for energies
|
// functions for calculating/collating POD descriptors/coefficients for energies
|
||||||
|
|
||||||
void podradialbasis(double *rbf, double *drbf, double *xij, double *besselparams, double rin,
|
void podradialbasis(double *rbf, double *drbf, double *xij, double *besselparams, double rin,
|
||||||
double rmax, int besseldegree, int inversedegree, int nbesselpars, int N);
|
double rmax, int besseldegree, int inversedegree, int nbesselpars, int N);
|
||||||
void pod1body(double *eatom, double *fatom, int *atomtype, int nelements, int natom);
|
void pod1body(double *eatom, double *fatom, int *atomtype, int nelements, int natom);
|
||||||
void podtally2b(double *eatom, double *fatom, double *eij, double *fij, int *ai, int *aj,
|
void podtally2b(double *eatom, double *fatom, double *eij, double *fij, int *ai, int *aj, int *ti,
|
||||||
int *ti, int *tj, int *elemindex, int nelements, int nbf, int natom, int N);
|
int *tj, int *elemindex, int nelements, int nbf, int natom, int N);
|
||||||
void pod3body(double *eatom, double *fatom, double *rij, double *e2ij, double *f2ij, double *tmpmem,
|
void pod3body(double *eatom, double *fatom, double *rij, double *e2ij, double *f2ij,
|
||||||
int *elemindex, int *pairnumsum, int *ai, int *aj, int *ti, int *tj, int nrbf, int nabf,
|
double *tmpmem, int *elemindex, int *pairnumsum, int *ai, int *aj, int *ti, int *tj,
|
||||||
int nelements, int natom, int Nij);
|
int nrbf, int nabf, int nelements, int natom, int Nij);
|
||||||
void poddesc(double *eatom1, double *fatom1, double *eatom2, double *fatom2, double *eatom3,
|
void poddesc(double *eatom1, double *fatom1, double *eatom2, double *fatom2, double *eatom3,
|
||||||
double *fatom3, double *rij, double *Phi, double *besselparams, double *tmpmem, double rin,
|
double *fatom3, double *rij, double *Phi, double *besselparams, double *tmpmem,
|
||||||
double rcut, int *pairnumsum, int *atomtype, int *ai, int *aj, int *ti, int *tj, int *elemindex,
|
double rin, double rcut, int *pairnumsum, int *atomtype, int *ai, int *aj, int *ti,
|
||||||
int *pdegree, int nbesselpars, int nrbf2, int nrbf3, int nabf, int nelements, int Nij, int natom);
|
int *tj, int *elemindex, int *pdegree, int nbesselpars, int nrbf2, int nrbf3,
|
||||||
double quadratic_coefficients(double *c2, double *c3, double *d2, double *d3,
|
int nabf, int nelements, int Nij, int natom);
|
||||||
double *coeff23, int *quadratic, int nc2, int nc3);
|
double quadratic_coefficients(double *c2, double *c3, double *d2, double *d3, double *coeff23,
|
||||||
double quadratic_coefficients(double *c3, double *d3, double *coeff33,
|
int *quadratic, int nc2, int nc3);
|
||||||
int *quadratic, int nc3);
|
double quadratic_coefficients(double *c3, double *d3, double *coeff33, int *quadratic, int nc3);
|
||||||
double cubic_coefficients(double *c2, double *c3, double *c4, double *d2, double *d3, double *d4,
|
double cubic_coefficients(double *c2, double *c3, double *c4, double *d2, double *d3, double *d4,
|
||||||
double *coeff234, int *cubic, int nc2, int nc3, int nc4);
|
double *coeff234, int *cubic, int nc2, int nc3, int nc4);
|
||||||
double cubic_coefficients(double *c3, double *d3, double *coeff333, int *cubic, int nc3);
|
double cubic_coefficients(double *c3, double *d3, double *coeff333, int *cubic, int nc3);
|
||||||
double quadratic_coefficients(double *ce2, double *ce3, double *c2, double *c3, double *d2, double *d3,
|
double quadratic_coefficients(double *ce2, double *ce3, double *c2, double *c3, double *d2,
|
||||||
double *coeff23, int *quadratic, int nc2, int nc3);
|
double *d3, double *coeff23, int *quadratic, int nc2, int nc3);
|
||||||
double quadratic_coefficients(double *ce3, double *c3, double *d3, double *coeff33,
|
double quadratic_coefficients(double *ce3, double *c3, double *d3, double *coeff33,
|
||||||
int *quadratic, int nc3);
|
int *quadratic, int nc3);
|
||||||
double cubic_coefficients(double *ce2, double *ce3, double *ce4, double *c2, double *c3, double *c4,
|
double cubic_coefficients(double *ce2, double *ce3, double *ce4, double *c2, double *c3,
|
||||||
double *d2, double *d3, double *d4, double *coeff234, int *cubic, int nc2, int nc3, int nc4);
|
double *c4, double *d2, double *d3, double *d4, double *coeff234,
|
||||||
double cubic_coefficients(double *ce3, double *c3, double *d3, double *coeff333, int *cubic, int nc3);
|
int *cubic, int nc2, int nc3, int nc4);
|
||||||
|
double cubic_coefficients(double *ce3, double *c3, double *d3, double *coeff333, int *cubic,
|
||||||
|
int nc3);
|
||||||
|
|
||||||
// functions for calculating/collating SNAP descriptors/coefficients for energies
|
// functions for calculating/collating SNAP descriptors/coefficients for energies
|
||||||
|
|
||||||
void snapSetup(int twojmax, int ntypes);
|
void snapSetup(int twojmax, int ntypes);
|
||||||
void InitSnap();
|
void InitSnap();
|
||||||
void snapComputeUlist(double *Sr, double *Si, double *dSr, double *dSi, double *rootpqarray, double *rij,
|
void snapComputeUlist(double *Sr, double *Si, double *dSr, double *dSi, double *rootpqarray,
|
||||||
double *wjelem, double *radelem, double rmin0, double rfac0, double rcutfac, int *idxu_block,
|
double *rij, double *wjelem, double *radelem, double rmin0, double rfac0,
|
||||||
int *ti, int *tj, int twojmax, int idxu_max, int ijnum, int switch_flag);
|
double rcutfac, int *idxu_block, int *ti, int *tj, int twojmax,
|
||||||
void snapZeroUarraytot2(double *Stotr, double *Stoti, double wself, int *idxu_block,
|
int idxu_max, int ijnum, int switch_flag);
|
||||||
int *type, int *map, int *ai, int wselfall_flag, int chemflag, int idxu_max, int nelements,
|
void snapZeroUarraytot2(double *Stotr, double *Stoti, double wself, int *idxu_block, int *type,
|
||||||
int twojmax, int inum);
|
int *map, int *ai, int wselfall_flag, int chemflag, int idxu_max,
|
||||||
void snapAddUarraytot(double *Stotr, double *Stoti, double *Sr,
|
int nelements, int twojmax, int inum);
|
||||||
double *Si, int *map, int *ai, int *tj, int idxu_max, int inum, int ijnum, int chemflag);
|
void snapAddUarraytot(double *Stotr, double *Stoti, double *Sr, double *Si, int *map, int *ai,
|
||||||
|
int *tj, int idxu_max, int inum, int ijnum, int chemflag);
|
||||||
void snapComputeZi2(double *zlist_r, double *zlist_i, double *Stotr, double *Stoti,
|
void snapComputeZi2(double *zlist_r, double *zlist_i, double *Stotr, double *Stoti,
|
||||||
double *cglist, int *idxz, int *idxu_block, int *idxcg_block, int twojmax, int idxu_max,
|
double *cglist, int *idxz, int *idxu_block, int *idxcg_block, int twojmax,
|
||||||
int idxz_max, int nelements, int bnorm_flag, int inum);
|
int idxu_max, int idxz_max, int nelements, int bnorm_flag, int inum);
|
||||||
void snapComputeBi1(double *blist, double *zlist_r, double *zlist_i, double *Stotr, double *Stoti,
|
void snapComputeBi1(double *blist, double *zlist_r, double *zlist_i, double *Stotr, double *Stoti,
|
||||||
int *idxb, int *idxu_block, int *idxz_block, int twojmax, int idxb_max, int idxu_max,
|
int *idxb, int *idxu_block, int *idxz_block, int twojmax, int idxb_max,
|
||||||
int idxz_max, int nelements, int inum);
|
int idxu_max, int idxz_max, int nelements, int inum);
|
||||||
void snapComputeDbidrj(double *dblist, double *zlist_r, double *zlist_i,
|
void snapComputeDbidrj(double *dblist, double *zlist_r, double *zlist_i, double *dulist_r,
|
||||||
double *dulist_r, double *dulist_i, int *idxb, int *idxu_block, int *idxz_block,
|
double *dulist_i, int *idxb, int *idxu_block, int *idxz_block, int *map,
|
||||||
int *map, int *ai, int *tj, int twojmax, int idxb_max, int idxu_max, int idxz_max,
|
int *ai, int *tj, int twojmax, int idxb_max, int idxu_max, int idxz_max,
|
||||||
int nelements, int bnorm_flag, int chemflag, int inum, int ijnum);
|
int nelements, int bnorm_flag, int chemflag, int inum, int ijnum);
|
||||||
void snapdesc(double *blist, double *bd, double *rij, double *tmpmem, int *atomtype, int *ai,
|
void snapdesc(double *blist, double *bd, double *rij, double *tmpmem, int *atomtype, int *ai,
|
||||||
int *aj, int *ti, int *tj, int natom, int Nij);
|
int *aj, int *ti, int *tj, int natom, int Nij);
|
||||||
|
|
||||||
// functions for calculating/collating POD descriptors/coefficients for forces
|
// functions for calculating/collating POD descriptors/coefficients for forces
|
||||||
|
|
||||||
void podradialbasis(double *rbf, double *xij, double *besselparams, double rin,
|
void podradialbasis(double *rbf, double *xij, double *besselparams, double rin, double rmax,
|
||||||
double rmax, int besseldegree, int inversedegree, int nbesselpars, int N);
|
int besseldegree, int inversedegree, int nbesselpars, int N);
|
||||||
void pod1body(double *eatom, int *atomtype, int nelements, int natom);
|
void pod1body(double *eatom, int *atomtype, int nelements, int natom);
|
||||||
void podtally2b(double *eatom, double *eij, int *ai, int *ti, int *tj, int *elemindex,
|
void podtally2b(double *eatom, double *eij, int *ai, int *ti, int *tj, int *elemindex,
|
||||||
int nelements, int nbf, int natom, int N);
|
int nelements, int nbf, int natom, int N);
|
||||||
void pod3body(double *eatom, double *yij, double *e2ij, double *tmpmem, int *elemindex, int *pairnumsum,
|
void pod3body(double *eatom, double *yij, double *e2ij, double *tmpmem, int *elemindex,
|
||||||
int *ai, int *ti, int *tj, int nrbf, int nabf, int nelements, int natom, int Nij);
|
int *pairnumsum, int *ai, int *ti, int *tj, int nrbf, int nabf, int nelements,
|
||||||
void poddesc_ij(double *eatom1, double *eatom2, double *eatom3, double *rij, double *Phi, double *besselparams,
|
int natom, int Nij);
|
||||||
double *tmpmem, double rin, double rcut, int *pairnumsum, int *atomtype, int *ai, int *ti, int *tj,
|
void poddesc_ij(double *eatom1, double *eatom2, double *eatom3, double *rij, double *Phi,
|
||||||
int *elemindex, int *pdegree, int nbesselpars, int nrbf2, int nrbf3, int nabf, int nelements, int Nij, int natom);
|
double *besselparams, double *tmpmem, double rin, double rcut, int *pairnumsum,
|
||||||
void snapComputeUij(double *Sr, double *Si, double *rootpqarray, double *rij,
|
int *atomtype, int *ai, int *ti, int *tj, int *elemindex, int *pdegree,
|
||||||
double *wjelem, double *radelem, double rmin0, double rfac0, double rcutfac, int *idxu_block,
|
int nbesselpars, int nrbf2, int nrbf3, int nabf, int nelements, int Nij,
|
||||||
int *ti, int *tj, int twojmax, int idxu_max, int ijnum, int switch_flag);
|
int natom);
|
||||||
void snapdesc_ij(double *blist, double *rij, double *tmpmem, int *atomtype, int *ai,
|
void snapComputeUij(double *Sr, double *Si, double *rootpqarray, double *rij, double *wjelem,
|
||||||
int *ti, int *tj, int natom, int Nij);
|
double *radelem, double rmin0, double rfac0, double rcutfac, int *idxu_block,
|
||||||
void pod2body_force(double *force, double *fij, double *coeff2, int *ai, int *aj,
|
int *ti, int *tj, int twojmax, int idxu_max, int ijnum, int switch_flag);
|
||||||
int *ti, int *tj, int *elemindex, int nelements, int nbf, int natom, int Nij);
|
void snapdesc_ij(double *blist, double *rij, double *tmpmem, int *atomtype, int *ai, int *ti,
|
||||||
void pod3body_force(double *force, double *yij, double *e2ij, double *f2ij, double *coeff3, double *tmpmem,
|
int *tj, int natom, int Nij);
|
||||||
int *elemindex, int *pairnumsum, int *ai, int *aj, int *ti, int *tj, int nrbf, int nabf,
|
void pod2body_force(double *force, double *fij, double *coeff2, int *ai, int *aj, int *ti,
|
||||||
int nelements, int natom, int Nij);
|
int *tj, int *elemindex, int nelements, int nbf, int natom, int Nij);
|
||||||
void snapTallyForce(double *force, double *dbdr, double *coeff4, int *ai, int *aj, int *ti, int ijnum,
|
void pod3body_force(double *force, double *yij, double *e2ij, double *f2ij, double *coeff3,
|
||||||
int ncoeff, int ntype);
|
double *tmpmem, int *elemindex, int *pairnumsum, int *ai, int *aj, int *ti,
|
||||||
|
int *tj, int nrbf, int nabf, int nelements, int natom, int Nij);
|
||||||
|
void snapTallyForce(double *force, double *dbdr, double *coeff4, int *ai, int *aj, int *ti,
|
||||||
|
int ijnum, int ncoeff, int ntype);
|
||||||
void pod4body_force(double *force, double *rij, double *coeff4, double *tmpmem, int *atomtype,
|
void pod4body_force(double *force, double *rij, double *coeff4, double *tmpmem, int *atomtype,
|
||||||
int *idxi, int *ai, int *aj, int *ti, int *tj, int natom, int Nij);
|
int *idxi, int *ai, int *aj, int *ti, int *tj, int natom, int Nij);
|
||||||
void pod2body_force(double **force, double *fij, double *coeff2, int *ai, int *aj,
|
void pod2body_force(double **force, double *fij, double *coeff2, int *ai, int *aj, int *ti,
|
||||||
int *ti, int *tj, int *elemindex, int nelements, int nbf, int natom, int Nij);
|
int *tj, int *elemindex, int nelements, int nbf, int natom, int Nij);
|
||||||
void pod3body_force(double **force, double *yij, double *e2ij, double *f2ij, double *coeff3, double *tmpmem,
|
void pod3body_force(double **force, double *yij, double *e2ij, double *f2ij, double *coeff3,
|
||||||
int *elemindex, int *pairnumsum, int *ai, int *aj, int *ti, int *tj, int nrbf, int nabf,
|
double *tmpmem, int *elemindex, int *pairnumsum, int *ai, int *aj, int *ti,
|
||||||
int nelements, int natom, int Nij);
|
int *tj, int nrbf, int nabf, int nelements, int natom, int Nij);
|
||||||
void snapTallyForce(double **force, double *dbdr, double *coeff4, int *ai, int *aj, int *ti, int ijnum,
|
void snapTallyForce(double **force, double *dbdr, double *coeff4, int *ai, int *aj, int *ti,
|
||||||
int ncoeff, int ntype);
|
int ijnum, int ncoeff, int ntype);
|
||||||
void pod4body_force(double **force, double *rij, double *coeff4, double *tmpmem, int *atomtype,
|
void pod4body_force(double **force, double *rij, double *coeff4, double *tmpmem, int *atomtype,
|
||||||
int *idxi, int *ai, int *aj, int *ti, int *tj, int natom, int Nij);
|
int *idxi, int *ai, int *aj, int *ti, int *tj, int natom, int Nij);
|
||||||
|
|
||||||
// eigenproblem functions
|
// eigenproblem functions
|
||||||
|
|
||||||
void podeigenvaluedecomposition(double *Phi, double *Lambda, double *besselparams, double rin, double rcut,
|
void podeigenvaluedecomposition(double *Phi, double *Lambda, double *besselparams, double rin,
|
||||||
int besseldegree, int inversedegree, int nbesselpars, int N);
|
double rcut, int besseldegree, int inversedegree, int nbesselpars,
|
||||||
|
int N);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MLPOD(LAMMPS *, const std::string &pod_file, const std::string &coeff_file);
|
MLPOD(LAMMPS *, const std::string &pod_file, const std::string &coeff_file);
|
||||||
|
|
||||||
MLPOD(LAMMPS *lmp) : Pointers(lmp){};
|
MLPOD(LAMMPS *lmp) : Pointers(lmp){};
|
||||||
|
@ -183,16 +189,17 @@ public:
|
||||||
// variables declaring number of snapshots, descriptors, and combinations
|
// variables declaring number of snapshots, descriptors, and combinations
|
||||||
|
|
||||||
int nbesselpars = 3;
|
int nbesselpars = 3;
|
||||||
int ns2, ns3, ns4; // number of snapshots for radial basis functions for linear POD potentials
|
int ns2, ns3,
|
||||||
int nc2, nc3, nc4; // number of chemical combinations for linear POD potentials
|
ns4; // number of snapshots for radial basis functions for linear POD potentials
|
||||||
int nbf1, nbf2, nbf3, nbf4; // number of basis functions for linear POD potentials
|
int nc2, nc3, nc4; // number of chemical combinations for linear POD potentials
|
||||||
int nd1, nd2, nd3, nd4; // number of descriptors for linear POD potentials
|
int nbf1, nbf2, nbf3, nbf4; // number of basis functions for linear POD potentials
|
||||||
int nd22, nd23, nd24, nd33, nd34, nd44; // number of descriptors for quadratic POD potentials
|
int nd1, nd2, nd3, nd4; // number of descriptors for linear POD potentials
|
||||||
int nd234, nd333, nd444; // number of descriptors for cubic POD potentials
|
int nd22, nd23, nd24, nd33, nd34, nd44; // number of descriptors for quadratic POD potentials
|
||||||
|
int nd234, nd333, nd444; // number of descriptors for cubic POD potentials
|
||||||
int nrbf3, nabf3, nrbf4, nabf4;
|
int nrbf3, nabf3, nrbf4, nabf4;
|
||||||
int nd, nd1234;
|
int nd, nd1234;
|
||||||
|
|
||||||
int snaptwojmax; // also used to tell if SNAP is used when allocating/deallocating
|
int snaptwojmax; // also used to tell if SNAP is used when allocating/deallocating
|
||||||
int snapchemflag;
|
int snapchemflag;
|
||||||
double snaprfac0;
|
double snaprfac0;
|
||||||
double snapelementradius[10];
|
double snapelementradius[10];
|
||||||
|
@ -208,8 +215,8 @@ public:
|
||||||
int idxcg_max;
|
int idxcg_max;
|
||||||
int ntypes;
|
int ntypes;
|
||||||
int nelements;
|
int nelements;
|
||||||
int ndoubles; // number of multi-element pairs
|
int ndoubles; // number of multi-element pairs
|
||||||
int ntriples; // number of multi-element triplets
|
int ntriples; // number of multi-element triplets
|
||||||
int bnormflag;
|
int bnormflag;
|
||||||
int chemflag;
|
int chemflag;
|
||||||
int switchflag;
|
int switchflag;
|
||||||
|
@ -222,7 +229,7 @@ public:
|
||||||
double rcutfac;
|
double rcutfac;
|
||||||
double rcutmax;
|
double rcutmax;
|
||||||
|
|
||||||
int *map; // map types to [0,nelements)
|
int *map; // map types to [0,nelements)
|
||||||
int *idx_max;
|
int *idx_max;
|
||||||
int *idxz;
|
int *idxz;
|
||||||
int *idxz_block;
|
int *idxz_block;
|
||||||
|
@ -245,16 +252,16 @@ public:
|
||||||
|
|
||||||
// functions for collecting/collating arrays
|
// functions for collecting/collating arrays
|
||||||
|
|
||||||
void print_matrix(const char* desc, int m, int n, int* a, int lda );
|
void print_matrix(const char *desc, int m, int n, int *a, int lda);
|
||||||
void print_matrix(const char* desc, int m, int n, double* a, int lda );
|
void print_matrix(const char *desc, int m, int n, double *a, int lda);
|
||||||
void print_matrix(const char* desc, int m, int n, double **a, int lda );
|
void print_matrix(const char *desc, int m, int n, double **a, int lda);
|
||||||
void podMatMul(double *c, double *a, double *b, int r1, int c1, int c2);
|
void podMatMul(double *c, double *a, double *b, int r1, int c1, int c2);
|
||||||
void podCumsum(int* output, int* input, int length);
|
void podCumsum(int *output, int *input, int length);
|
||||||
double podArrayNorm(double *a, int n);
|
double podArrayNorm(double *a, int n);
|
||||||
double podArrayErrorNorm(double *a, double *b, int n);
|
double podArrayErrorNorm(double *a, double *b, int n);
|
||||||
void podArraySetValue(double *y, double a, int n);
|
void podArraySetValue(double *y, double a, int n);
|
||||||
void podArrayCopy(double *y, double *x, int n);
|
void podArrayCopy(double *y, double *x, int n);
|
||||||
void podArrayFill(int* output, int start, int length);
|
void podArrayFill(int *output, int start, int length);
|
||||||
double podArrayMin(double *a, int n);
|
double podArrayMin(double *a, int n);
|
||||||
double podArrayMax(double *a, int n);
|
double podArrayMax(double *a, int n);
|
||||||
double podArraySum(double *a, int n);
|
double podArraySum(double *a, int n);
|
||||||
|
@ -262,42 +269,53 @@ public:
|
||||||
int podArrayMax(int *a, int n);
|
int podArrayMax(int *a, int n);
|
||||||
void podKron(double *C, double *A, double *B, double alpha, int M1, int M2);
|
void podKron(double *C, double *A, double *B, double alpha, int M1, int M2);
|
||||||
void rotation_matrix(double *Rmat, double alpha, double beta, double gamma);
|
void rotation_matrix(double *Rmat, double alpha, double beta, double gamma);
|
||||||
void triclinic_lattice_conversion(double *a, double *b, double *c, double *A, double *B, double *C);
|
void triclinic_lattice_conversion(double *a, double *b, double *c, double *A, double *B,
|
||||||
|
double *C);
|
||||||
void matrix33_multiplication(double *xrot, double *Rmat, double *x, int natom);
|
void matrix33_multiplication(double *xrot, double *Rmat, double *x, int natom);
|
||||||
void matrix33_inverse(double *invA, double *A1, double *A2, double *A3);
|
void matrix33_inverse(double *invA, double *A1, double *A2, double *A3);
|
||||||
|
|
||||||
// functions for calculating energy and force descriptors
|
// functions for calculating energy and force descriptors
|
||||||
|
|
||||||
void podNeighPairs(double *xij, double *x, int *ai, int *aj, int *ti, int *tj,
|
void podNeighPairs(double *xij, double *x, int *ai, int *aj, int *ti, int *tj, int *pairlist,
|
||||||
int *pairlist, int *pairnumsum, int *atomtype, int *alist, int inum, int dim);
|
int *pairnumsum, int *atomtype, int *alist, int inum, int dim);
|
||||||
void linear_descriptors(double *gd, double *efatom, double *y, double *tmpmem, int *atomtype,
|
void linear_descriptors(double *gd, double *efatom, double *y, double *tmpmem, int *atomtype,
|
||||||
int *alist, int *pairlist, int *pairnum, int *pairnumsum, int *tmpint, int natom, int Nij);
|
int *alist, int *pairlist, int *pairnum, int *pairnumsum, int *tmpint,
|
||||||
void quadratic_descriptors(double* d23, double *dd23, double* d2, double *d3, double* dd2, double *dd3,
|
int natom, int Nij);
|
||||||
int M2, int M3, int N);
|
void quadratic_descriptors(double *d23, double *dd23, double *d2, double *d3, double *dd2,
|
||||||
void quadratic_descriptors(double* d33, double *dd33, double *d3, double *dd3, int M3, int N);
|
double *dd3, int M2, int M3, int N);
|
||||||
void cubic_descriptors(double* d234, double *dd234, double* d2, double *d3, double *d4,
|
void quadratic_descriptors(double *d33, double *dd33, double *d3, double *dd3, int M3, int N);
|
||||||
double* dd2, double *dd3, double *dd4, int M2, int M3, int M4, int N);
|
void cubic_descriptors(double *d234, double *dd234, double *d2, double *d3, double *d4,
|
||||||
void cubic_descriptors(double* d333, double *Dd333, double *d3, double *Dd3, int M3, int N);
|
double *dd2, double *dd3, double *dd4, int M2, int M3, int M4, int N);
|
||||||
double calculate_energyforce(double *force, double *gd, double *gdd, double *coeff, double *tmp, int natom);
|
void cubic_descriptors(double *d333, double *Dd333, double *d3, double *Dd3, int M3, int N);
|
||||||
double energyforce_calculation(double *f, double *gd, double *gdd, double *coeff, double *y, int *atomtype,
|
double calculate_energyforce(double *force, double *gd, double *gdd, double *coeff, double *tmp,
|
||||||
int *alist, int *pairlist, int *pairnum, int *pairnumsum, int *tmpint, int natom, int Nij);
|
int natom);
|
||||||
|
double energyforce_calculation(double *f, double *gd, double *gdd, double *coeff, double *y,
|
||||||
|
int *atomtype, int *alist, int *pairlist, int *pairnum,
|
||||||
|
int *pairnumsum, int *tmpint, int natom, int Nij);
|
||||||
|
|
||||||
// functions for calculating energies and forces
|
// functions for calculating energies and forces
|
||||||
|
|
||||||
void podNeighPairs(double *rij, double *x, int *idxi, int *ai, int *aj, int *ti, int *tj,
|
void podNeighPairs(double *rij, double *x, int *idxi, int *ai, int *aj, int *ti, int *tj,
|
||||||
int *pairnumsum, int *atomtype, int *jlist, int *alist, int inum);
|
int *pairnumsum, int *atomtype, int *jlist, int *alist, int inum);
|
||||||
int lammpsNeighPairs(double *rij, double **x, double rcutsq, int *idxi, int *ai, int *aj, int *ti, int *tj,
|
int lammpsNeighPairs(double *rij, double **x, double rcutsq, int *idxi, int *ai, int *aj, int *ti,
|
||||||
int *pairnumsum, int *atomtype, int *numneigh, int *ilist, int **jlist, int inum);
|
int *tj, int *pairnumsum, int *atomtype, int *numneigh, int *ilist,
|
||||||
void linear_descriptors_ij(double *gd, double *eatom, double *rij, double *tmpmem, int *pairnumsum,
|
int **jlist, int inum);
|
||||||
int *atomtype, int *ai, int *ti, int *tj, int natom, int Nij);
|
void linear_descriptors_ij(double *gd, double *eatom, double *rij, double *tmpmem,
|
||||||
|
int *pairnumsum, int *atomtype, int *ai, int *ti, int *tj, int natom,
|
||||||
|
int Nij);
|
||||||
double calculate_energy(double *effectivecoeff, double *gd, double *coeff);
|
double calculate_energy(double *effectivecoeff, double *gd, double *coeff);
|
||||||
double calculate_energy(double *energycoeff, double *forcecoeff, double *gd, double *gdall, double *coeff);
|
double calculate_energy(double *energycoeff, double *forcecoeff, double *gd, double *gdall,
|
||||||
void calculate_force(double *force, double *effectivecoeff, double *rij, double *tmpmem, int *pairnumsum,
|
double *coeff);
|
||||||
int *atomtype, int *idxi, int *ai, int *aj, int *ti, int *tj, int natom, int Nij);
|
void calculate_force(double *force, double *effectivecoeff, double *rij, double *tmpmem,
|
||||||
void calculate_force(double **force, double *effectivecoeff, double *rij, double *tmpmem, int *pairnumsum,
|
int *pairnumsum, int *atomtype, int *idxi, int *ai, int *aj, int *ti,
|
||||||
int *atomtype, int *idxi, int *ai, int *aj, int *ti, int *tj, int natom, int Nij);
|
int *tj, int natom, int Nij);
|
||||||
double energyforce_calculation(double *force, double *podcoeff, double *effectivecoeff, double *gd, double *rij,
|
void calculate_force(double **force, double *effectivecoeff, double *rij, double *tmpmem,
|
||||||
double *tmpmem, int *pairnumsum, int *atomtype, int *idxi, int *ai, int *aj, int *ti, int *tj, int natom, int Nij);
|
int *pairnumsum, int *atomtype, int *idxi, int *ai, int *aj, int *ti,
|
||||||
|
int *tj, int natom, int Nij);
|
||||||
|
double energyforce_calculation(double *force, double *podcoeff, double *effectivecoeff,
|
||||||
|
double *gd, double *rij, double *tmpmem, int *pairnumsum,
|
||||||
|
int *atomtype, int *idxi, int *ai, int *aj, int *ti, int *tj,
|
||||||
|
int natom, int Nij);
|
||||||
|
|
||||||
// variables used in eigenvaluedecomposition
|
// variables used in eigenvaluedecomposition
|
||||||
|
|
||||||
|
@ -306,10 +324,8 @@ public:
|
||||||
double *Q;
|
double *Q;
|
||||||
double *A;
|
double *A;
|
||||||
double *b;
|
double *b;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ class PairPOD : public Pair {
|
||||||
int *ti; // types of atoms I for all pairs (I, J)
|
int *ti; // types of atoms I for all pairs (I, J)
|
||||||
int *tj; // types of atoms J for all pairs (I, J)
|
int *tj; // types of atoms J for all pairs (I, J)
|
||||||
|
|
||||||
bool peratom_warn; // print warning about missing per-atom energies or stresses
|
bool peratom_warn; // print warning about missing per-atom energies or stresses
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace LAMMPS_NS
|
} // namespace LAMMPS_NS
|
||||||
|
|
Loading…
Reference in New Issue