apply clang-format

This commit is contained in:
Axel Kohlmeyer
2024-06-25 20:07:34 -04:00
parent e3fb1f24bd
commit e5250a76ac
6 changed files with 191 additions and 185 deletions

View File

@ -32,8 +32,8 @@ class ComputePODAtom : public Compute {
void init_list(int, class NeighList *) override; void init_list(int, class NeighList *) override;
void compute_peratom() override; void compute_peratom() override;
double memory_usage() override; double memory_usage() override;
void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype, int *numneigh, void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype,
double rcutsq, int i); int *numneigh, double rcutsq, int i);
void map_element2type(int narg, char **arg, int nelements); void map_element2type(int narg, char **arg, int nelements);
private: private:
@ -45,14 +45,14 @@ class ComputePODAtom : public Compute {
int nij; int nij;
int nijmax; int nijmax;
double *tmpmem; // temporary memory double *tmpmem; // temporary memory
double *rij; // (xj - xi) for all pairs (I, J) double *rij; // (xj - xi) for all pairs (I, J)
char **elements; char **elements;
int *map; int *map;
int *ai; // IDs of atoms I for all pairs (I, J) int *ai; // IDs of atoms I for all pairs (I, J)
int *aj; // IDs of atoms J for all pairs (I, J) int *aj; // IDs of atoms J for all pairs (I, J)
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)
}; };
} // namespace LAMMPS_NS } // namespace LAMMPS_NS

View File

@ -32,8 +32,8 @@ class ComputePODGlobal : public Compute {
void init_list(int, class NeighList *) override; void init_list(int, class NeighList *) override;
void compute_array() override; void compute_array() override;
double memory_usage() override; double memory_usage() override;
void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype, int *numneigh, void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype,
double rcutsq, int i); int *numneigh, double rcutsq, int i);
void map_element2type(int narg, char **arg, int nelements); void map_element2type(int narg, char **arg, int nelements);
private: private:
@ -44,14 +44,14 @@ class ComputePODGlobal : public Compute {
int nij; int nij;
int nijmax; int nijmax;
double *tmpmem; // temporary memory double *tmpmem; // temporary memory
double *rij; // (xj - xi) for all pairs (I, J) double *rij; // (xj - xi) for all pairs (I, J)
char **elements; char **elements;
int *map; int *map;
int *ai; // IDs of atoms I for all pairs (I, J) int *ai; // IDs of atoms I for all pairs (I, J)
int *aj; // IDs of atoms J for all pairs (I, J) int *aj; // IDs of atoms J for all pairs (I, J)
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)
}; };
} // namespace LAMMPS_NS } // namespace LAMMPS_NS

View File

@ -32,8 +32,8 @@ class ComputePODLocal : public Compute {
void init_list(int, class NeighList *) override; void init_list(int, class NeighList *) override;
void compute_array() override; void compute_array() override;
double memory_usage() override; double memory_usage() override;
void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype, int *numneigh, void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype,
double rcutsq, int i); int *numneigh, double rcutsq, int i);
void map_element2type(int narg, char **arg, int nelements); void map_element2type(int narg, char **arg, int nelements);
private: private:
@ -44,14 +44,14 @@ class ComputePODLocal : public Compute {
int nij; int nij;
int nijmax; int nijmax;
double *tmpmem; // temporary memory double *tmpmem; // temporary memory
double *rij; // (xj - xi) for all pairs (I, J) double *rij; // (xj - xi) for all pairs (I, J)
char **elements; char **elements;
int *map; int *map;
int *ai; // IDs of atoms I for all pairs (I, J) int *ai; // IDs of atoms I for all pairs (I, J)
int *aj; // IDs of atoms J for all pairs (I, J) int *aj; // IDs of atoms J for all pairs (I, J)
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)
}; };
} // namespace LAMMPS_NS } // namespace LAMMPS_NS

View File

@ -32,8 +32,8 @@ class ComputePODDAtom : public Compute {
void init_list(int, class NeighList *) override; void init_list(int, class NeighList *) override;
void compute_peratom() override; void compute_peratom() override;
double memory_usage() override; double memory_usage() override;
void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype, int *numneigh, void lammpsNeighborList(double **x, int **firstneigh, tagint *atomid, int *atomtype,
double rcutsq, int i); int *numneigh, double rcutsq, int i);
void map_element2type(int narg, char **arg, int nelements); void map_element2type(int narg, char **arg, int nelements);
private: private:
@ -45,14 +45,14 @@ class ComputePODDAtom : public Compute {
int nij; int nij;
int nijmax; int nijmax;
double *tmpmem; // temporary memory double *tmpmem; // temporary memory
double *rij; // (xj - xi) for all pairs (I, J) double *rij; // (xj - xi) for all pairs (I, J)
char **elements; char **elements;
int *map; int *map;
int *ai; // IDs of atoms I for all pairs (I, J) int *ai; // IDs of atoms I for all pairs (I, J)
int *aj; // IDs of atoms J for all pairs (I, J) int *aj; // IDs of atoms J for all pairs (I, J)
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)
}; };
} // namespace LAMMPS_NS } // namespace LAMMPS_NS

View File

@ -25,26 +25,26 @@
#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 EAPOD : protected Pointers { class EAPOD : protected Pointers {
private: private:
int indexmap3(int *indx, int n1, int n2, int n3, int N1, int N2); int indexmap3(int *indx, int n1, int n2, int n3, int N1, int N2);
int crossindices(int *dabf1, int nabf1, int nrbf1, int nebf1, int crossindices(int *dabf1, int nabf1, int nrbf1, int nebf1, int *dabf2, int nabf2, int nrbf2,
int *dabf2, int nabf2, int nrbf2, int nebf2, int dabf12, int nrbf12); int nebf2, int dabf12, int nrbf12);
int crossindices(int *ind1, int *ind2, int *dabf1, int nabf1, int nrbf1, int nebf1, int crossindices(int *ind1, int *ind2, int *dabf1, int nabf1, int nrbf1, int nebf1, int *dabf2,
int *dabf2, int nabf2, int nrbf2, int nebf2, int dabf12, int nrbf12); int nabf2, int nrbf2, int nebf2, int dabf12, int nrbf12);
void init3bodyarray(int *np, int *pq, int *pc, int Pa3); void init3bodyarray(int *np, int *pq, int *pc, int Pa3);
@ -60,17 +60,19 @@ private:
void eigenvaluedecomposition(double *Phi, double *Lambda, int N); void eigenvaluedecomposition(double *Phi, double *Lambda, int N);
void myneighbors(double *rij, double *x, int *ai, int *aj, int *ti, int *tj, void myneighbors(double *rij, double *x, int *ai, int *aj, int *ti, int *tj, int *jlist,
int *jlist, int *pairnumsum, int *atomtype, int *alist, int i); int *pairnumsum, int *atomtype, int *alist, int i);
void radialbasis(double *rbf, double *rbfx, double *rbfy, double *rbfz, double *rij, double *besselparams, double rin, void radialbasis(double *rbf, double *rbfx, double *rbfy, double *rbfz, double *rij,
double rmax, int besseldegree, int inversedegree, int nbesselpars, int N); double *besselparams, double rin, double rmax, int besseldegree,
int inversedegree, int nbesselpars, int N);
void angularbasis(double *abf, double *abfx, double *abfy, double *abfz, double *rij, double *tm, int *pq, int N, int K); void angularbasis(double *abf, double *abfx, double *abfy, double *abfz, double *rij, double *tm,
int *pq, int N, int K);
void radialangularbasis(double *sumU, double *U, double *Ux, double *Uy, double *Uz, void radialangularbasis(double *sumU, double *U, double *Ux, double *Uy, double *Uz, double *rbf,
double *rbf, double *rbfx, double *rbfy, double *rbfz, double *abf, double *rbfx, double *rbfy, double *rbfz, double *abf, double *abfx,
double *abfx, double *abfy, double *abfz, int *atomtype, int N, int K, int M, int Ne); double *abfy, double *abfz, int *atomtype, int N, int K, int M, int Ne);
void MatMul(double *c, double *a, double *b, int r1, int c1, int c2); void MatMul(double *c, double *a, double *b, int r1, int c1, int c2);
@ -80,19 +82,18 @@ private:
void mvproduct(double *fij, double *c, double *dd, int N, int ndesc); void mvproduct(double *fij, double *c, double *dd, int N, int ndesc);
public: public:
std::vector<std::string> species; std::vector<std::string> species;
double rin; double rin;
double rcut; double rcut;
int true4BodyDesc; int true4BodyDesc;
int nelements; // number of elements
int nelements; // number of elements
int pbc[3]; int pbc[3];
int *elemindex ; int *elemindex;
int onebody; // one-body descriptors int onebody; // one-body descriptors
int besseldegree; int besseldegree;
int inversedegree; int inversedegree;
int pdegree[2]; int pdegree[2];
@ -100,44 +101,45 @@ public:
int timing; int timing;
double comptime[20]; double comptime[20];
double besselparams[3]; double besselparams[3];
double *Phi ; // eigenvectors double *Phi; // eigenvectors
double *Lambda ; // eigenvalues double *Lambda; // eigenvalues
double *coeff; // coefficients double *coeff; // coefficients
//double *newcoeff ; // coefficients //double *newcoeff ; // coefficients
double *tmpmem; double *tmpmem;
// environmental variables // environmental variables
int nClusters; // number of environment clusters int nClusters; // number of environment clusters
int nComponents; // number of principal components int nComponents; // number of principal components
//int nNeighbors; // numbe of neighbors //int nNeighbors; // numbe of neighbors
int Mdesc; // number of base descriptors int Mdesc; // number of base descriptors
double *Proj; // PCA Projection matrix double *Proj; // PCA Projection matrix
double *Centroids; // centroids of the clusters double *Centroids; // centroids of the clusters
double *bd; // base descriptors double *bd; // base descriptors
double *bdd; // derivatives of the base descriptors with respect to the atomic positions double *bdd; // derivatives of the base descriptors with respect to the atomic positions
double *pd; // multi-environment descriptors double *pd; // multi-environment descriptors
double *pdd; // derivative of the multi-environment descriptors with respect to the atomic positions double *
pdd; // derivative of the multi-environment descriptors with respect to the atomic positions
int nproj; // number of elements in projection matrix (nComponents * Mdesc * nelements) int nproj; // number of elements in projection matrix (nComponents * Mdesc * nelements)
int ncentroids; // number of centroids (nComponents * nClusters * nelements) int ncentroids; // number of centroids (nComponents * nClusters * nelements)
int Njmax; int Njmax;
int nCoeffPerElement; // number of coefficients per element = (nl1 + Mdesc*nClusters) int nCoeffPerElement; // number of coefficients per element = (nl1 + Mdesc*nClusters)
int nCoeffAll; // number of coefficients for all elements = (nl1 + Mdesc*nClusters)*nelements int nCoeffAll; // number of coefficients for all elements = (nl1 + Mdesc*nClusters)*nelements
int ncoeff; // number of coefficients in the input file int ncoeff; // number of coefficients in the input file
int ns; // number of snapshots for radial basis functions int ns; // number of snapshots for radial basis functions
int nd1, nd2, nd3, nd4, nd5, nd6, nd7, nd; // number of global descriptors int nd1, nd2, nd3, nd4, nd5, nd6, nd7, nd; // number of global descriptors
int nl1, nl2, nl3, nl4, nl5, nl6, nl7, nl; // number of local descriptors int nl1, nl2, nl3, nl4, nl5, nl6, nl7, nl; // number of local descriptors
int nrbf2, nrbf3, nrbf4, nrbfmax; // number of radial basis functions int nrbf2, nrbf3, nrbf4, nrbfmax; // number of radial basis functions
int nabf3, nabf4; // number of angular basis functions int nabf3, nabf4; // number of angular basis functions
int P3, P4; // angular polynomial degrees int P3, P4; // angular polynomial degrees
int K3, K4, Q4; // number of monomials int K3, K4, Q4; // number of monomials
int *pn3, *pq3, *pc3; // arrays to compute 3-body angular basis functions int *pn3, *pq3, *pc3; // arrays to compute 3-body angular basis functions
int *pq4, *pa4, *pb4, *pc4; // arrays to compute 3-body angular basis functions int *pq4, *pa4, *pb4, *pc4; // arrays to compute 3-body angular basis functions
int *tmpint; int *tmpint;
int nintmem; // number of integers in tmpint array int nintmem; // number of integers in tmpint array
int ndblmem; // number of doubles in tmpmem array int ndblmem; // number of doubles in tmpmem array
// four-body descriptors // four-body descriptors
int *ind23, *ind32, nrbf23, nabf23, P23, n23, n32, nl23, nd23; int *ind23, *ind32, nrbf23, nabf23, P23, n23, n32, nl23, nd23;
@ -174,62 +176,64 @@ public:
void mknewcoeff(double *c, int nc); void mknewcoeff(double *c, int nc);
void twobodydesc(double *d2, double *rbf, int *tj, int N); void twobodydesc(double *d2, double *rbf, int *tj, int N);
void twobodydescderiv(double *d2, double *dd2, double *rbf, double *rbfx, void twobodydescderiv(double *d2, double *dd2, double *rbf, double *rbfx, double *rbfy,
double *rbfy, double *rbfz, int *tj, int N); double *rbfz, int *tj, int N);
void twobody_forces(double *fij, double *cb2, double *rbfx, double *rbfy, double *rbfz, int *tj, int Nj); void twobody_forces(double *fij, double *cb2, double *rbfx, double *rbfy, double *rbfz, int *tj,
int Nj);
void threebodydesc(double *d3, double *sumU); void threebodydesc(double *d3, double *sumU);
void threebodydescderiv(double *dd3, double *sumU, double *Ux, double *Uy, double *Uz, void threebodydescderiv(double *dd3, double *sumU, double *Ux, double *Uy, double *Uz,
int *atomtype, int N); int *atomtype, int N);
void threebody_forcecoeff(double *fb3, double *cb3, double *sumU); void threebody_forcecoeff(double *fb3, double *cb3, double *sumU);
void fourbodydesc(double *d4, double *sumU); void fourbodydesc(double *d4, double *sumU);
void fourbodydescderiv(double *d4, double *dd4, double *sumU, double *Ux, double *Uy, double *Uz, void fourbodydescderiv(double *d4, double *dd4, double *sumU, double *Ux, double *Uy, double *Uz,
int *atomtype, int N); int *atomtype, int N);
void fourbody_forcecoeff(double *fb4, double *cb4, double *sumU); void fourbody_forcecoeff(double *fb4, double *cb4, double *sumU);
void allbody_forces(double *fij, double *forcecoeff, double *rbf, double *rbfx, double *rbfy, double *rbfz, void allbody_forces(double *fij, double *forcecoeff, double *rbf, double *rbfx, double *rbfy,
double *abf, double *abfx, double *abfy, double *abfz, int *tj, int Nj); double *rbfz, double *abf, double *abfx, double *abfy, double *abfz, int *tj,
void allbody_forces(double *fij, double *forcecoeff, double *Ux, double *Uy, double *Uz, int *tj, int Nj); int Nj);
void allbody_forces(double *fij, double *forcecoeff, double *Ux, double *Uy, double *Uz, int *tj,
int Nj);
void descriptors(double *gd, double *gdd, double *basedesc, double *probdesc, double *x, int *atomtype, int *alist, void descriptors(double *gd, double *gdd, double *basedesc, double *probdesc, double *x,
int *jlist, int *pairnumsum, int natom); int *atomtype, int *alist, int *jlist, int *pairnumsum, int natom);
void descriptors(double *gd, double *gdd, double *basedesc, double *x, int *atomtype, int *alist, void descriptors(double *gd, double *gdd, double *basedesc, double *x, int *atomtype, int *alist,
int *jlist, int *pairnumsum, int natom); int *jlist, int *pairnumsum, int natom);
void peratombase_descriptors(double *bd, double *bdd, double *rij, double *temp, void peratombase_descriptors(double *bd, double *bdd, double *rij, double *temp, int *tj, int Nj);
int *tj, int Nj);
double peratombase_coefficients(double *cb, double *bd, int *ti); double peratombase_coefficients(double *cb, double *bd, int *ti);
double peratom_environment_descriptors(double *cb, double *bd, double *tm, int *ti); double peratom_environment_descriptors(double *cb, double *bd, double *tm, int *ti);
void peratomenvironment_descriptors(double *P, double *dP_dR, double *B, double *dB_dR, double *tmp, int elem, int nNeighbors); void peratomenvironment_descriptors(double *P, double *dP_dR, double *B, double *dB_dR,
double *tmp, int elem, int nNeighbors);
void base_descriptors(double *basedesc, double *x, int *atomtype, int *alist, void base_descriptors(double *basedesc, double *x, int *atomtype, int *alist, int *jlist,
int *jlist, int *pairnumsum, int natom); int *pairnumsum, int natom);
void descriptors(double *basedesc, double *probdesc, double *x, int *atomtype, int *alist, void descriptors(double *basedesc, double *probdesc, double *x, int *atomtype, int *alist,
int *jlist, int *pairnumsum, int natom); int *jlist, int *pairnumsum, int natom);
double peratomenergyforce(double *fij, double *rij, double *temp, int *ti, int *tj, int Nj); double peratomenergyforce(double *fij, double *rij, double *temp, int *ti, int *tj, int Nj);
double peratomenergyforce2(double *fij, double *rij, double *temp, int *ti, int *tj, int Nj); double peratomenergyforce2(double *fij, double *rij, double *temp, int *ti, int *tj, int Nj);
double energyforce(double *force, double *x, int *atomtype, int *alist, double energyforce(double *force, double *x, int *atomtype, int *alist, int *jlist,
int *jlist, int *pairnumsum, int natom); int *pairnumsum, int natom);
void tallyforce(double *force, double *fij, int *ai, int *aj, int N); void tallyforce(double *force, double *fij, int *ai, int *aj, int N);
void fourbodydesc23(double* d23, double* d2, double *d3); void fourbodydesc23(double *d23, double *d2, double *d3);
void fourbodydescderiv23(double* dd23, double* d2, double *d3, double* dd2, double *dd3, int N); void fourbodydescderiv23(double *dd23, double *d2, double *d3, double *dd2, double *dd3, int N);
void crossdesc(double *d12, double *d1, double *d2, int *ind1, int *ind2, int n12); void crossdesc(double *d12, double *d1, double *d2, int *ind1, int *ind2, int n12);
void crossdescderiv(double *dd12, double *d1, double *d2, double *dd1, double *dd2, void crossdescderiv(double *dd12, double *d1, double *d2, double *dd1, double *dd2, int *ind1,
int *ind1, int *ind2, int n12, int N); int *ind2, int n12, int N);
void crossdesc_reduction(double *cb1, double *cb2, double *c12, double *d1, void crossdesc_reduction(double *cb1, double *cb2, double *c12, double *d1, double *d2, int *ind1,
double *d2, int *ind1, int *ind2, int n12); int *ind2, int n12);
}; };
} // namespace LAMMPS_NS } // namespace LAMMPS_NS
#endif #endif

View File

@ -25,7 +25,7 @@ PairStyle(pod,PairPOD);
namespace LAMMPS_NS { namespace LAMMPS_NS {
class PairPOD : public Pair { class PairPOD : public Pair {
public: public:
PairPOD(class LAMMPS *); PairPOD(class LAMMPS *);
~PairPOD() override; ~PairPOD() override;
void compute(int, int) override; void compute(int, int) override;
@ -36,14 +36,16 @@ public:
double init_one(int, int) override; double init_one(int, int) override;
double memory_usage() override; double memory_usage() override;
void lammpsNeighborList(double *rij1, int *ai1, int *aj1, int *ti1, int *tj1, double **x, int **firstneigh, int *atomtype, int *map, int *numneigh, void lammpsNeighborList(double *rij1, int *ai1, int *aj1, int *ti1, int *tj1, double **x,
double rcutsq, int i); int **firstneigh, int *atomtype, int *map, int *numneigh, double rcutsq,
void NeighborCount(double **x, int **firstneigh, int *ilist, int *numneigh, double rcutsq, int i1); int i);
void NeighborList(double **x, int **firstneigh, int *atomtype, int *map, int *ilist, int *numneigh, void NeighborCount(double **x, int **firstneigh, int *ilist, int *numneigh, double rcutsq,
double rcutsq, int i1); int i1);
void NeighborList(double **x, int **firstneigh, int *atomtype, int *map, int *ilist,
int *numneigh, double rcutsq, int i1);
void tallyenergy(double *ei, int istart, int Ni); void tallyenergy(double *ei, int istart, int Ni);
void tallystress(double *fij, double *rij, int *ai, int *aj, int nlocal, int N); void tallystress(double *fij, double *rij, int *ai, int *aj, int nlocal, int N);
void tallyforce(double **force, double *fij, int *ai, int *aj, int N); void tallyforce(double **force, double *fij, int *ai, int *aj, int N);
void divideInterval(int *intervals, int N, int M); void divideInterval(int *intervals, int N, int M);
int calculateNumberOfIntervals(int N, int intervalSize); int calculateNumberOfIntervals(int N, int intervalSize);
int numberOfNeighbors(); int numberOfNeighbors();
@ -63,13 +65,13 @@ public:
void fourbodydesc(double *d4, int Ni); void fourbodydesc(double *d4, int Ni);
void fourbodydescderiv(double *dd4, int Nij); void fourbodydescderiv(double *dd4, int Nij);
void crossdesc(double *d12, double *d1, double *d2, int *ind1, int *ind2, int n12, int Ni); void crossdesc(double *d12, double *d1, double *d2, int *ind1, int *ind2, int n12, int Ni);
void crossdescderiv(double *dd12, double *d1, double *d2, double *dd1, double *dd2, void crossdescderiv(double *dd12, double *d1, double *d2, double *dd1, double *dd2, int *ind1,
int *ind1, int *ind2, int *idxi, int n12, int Ni, int Nij); int *ind2, int *idxi, int n12, int Ni, int Nij);
void blockatombase_descriptors(double *bd1, double *bdd1, int Ni, int Nij); void blockatombase_descriptors(double *bd1, double *bdd1, int Ni, int Nij);
void blockatomenergyforce(double *ei, double *fij, int Ni, int Nij); void blockatomenergyforce(double *ei, double *fij, int Ni, int Nij);
void crossdesc_reduction(double *cb1, double *cb2, double *c12, double *d1, void crossdesc_reduction(double *cb1, double *cb2, double *c12, double *d1, double *d2, int *ind1,
double *d2, int *ind1, int *ind2, int n12, int Ni); int *ind2, int n12, int Ni);
void blockatom_base_descriptors(double *bd1, int Ni, int Nij); void blockatom_base_descriptors(double *bd1, int Ni, int Nij);
void blockatom_base_coefficients(double *ei, double *cb, double *B, int Ni); void blockatom_base_coefficients(double *ei, double *cb, double *B, int Ni);
void blockatom_environment_descriptors(double *ei, double *cb, double *B, int Ni); void blockatom_environment_descriptors(double *ei, double *cb, double *B, int Ni);
@ -89,79 +91,79 @@ public:
void saveintmatrix2binfile(std::string filename, int *A, int nrows, int ncols); void saveintmatrix2binfile(std::string filename, int *A, int nrows, int ncols);
void savedatafordebugging(); void savedatafordebugging();
protected: protected:
class EAPOD *fastpodptr; class EAPOD *fastpodptr;
virtual void allocate(); virtual void allocate();
void grow_atoms(int Ni); void grow_atoms(int Ni);
void grow_pairs(int Nij); void grow_pairs(int Nij);
int atomBlockSize; // size of each atom block int atomBlockSize; // size of each atom block
int nAtomBlocks; // number of atoms blocks int nAtomBlocks; // number of atoms blocks
int atomBlocks[101]; // atom blocks int atomBlocks[101]; // atom blocks
int ni; // total number of atoms i int ni; // total number of atoms i
int nij; // total number of pairs (i,j) int nij; // total number of pairs (i,j)
int nimax; // maximum number of atoms i int nimax; // maximum number of atoms i
int nijmax; // maximum number of pairs (i,j) int nijmax; // maximum number of pairs (i,j)
int nelements; // number of elements int nelements; // number of elements
int onebody; // one-body descriptors int onebody; // one-body descriptors
int besseldegree; // degree of Bessel functions int besseldegree; // degree of Bessel functions
int inversedegree; // degree of inverse functions int inversedegree; // degree of inverse functions
int nbesselpars; // number of Bessel parameters int nbesselpars; // number of Bessel parameters
int nCoeffPerElement; // number of coefficients per element = (nl1 + Mdesc*nClusters) int nCoeffPerElement; // number of coefficients per element = (nl1 + Mdesc*nClusters)
int ns; // number of snapshots for radial basis functions int ns; // number of snapshots for radial basis functions
int nl1, nl2, nl3, nl4, nl23, nl33, nl34, nl44, nl; // number of local descriptors int nl1, nl2, nl3, nl4, nl23, nl33, nl34, nl44, nl; // number of local descriptors
int nrbf2, nrbf3, nrbf4, nrbfmax; // number of radial basis functions int nrbf2, nrbf3, nrbf4, nrbfmax; // number of radial basis functions
int nabf3, nabf4; // number of angular basis functions int nabf3, nabf4; // number of angular basis functions
int K3, K4, Q4; // number of monomials int K3, K4, Q4; // number of monomials
// environmental variables // environmental variables
int nClusters; // number of environment clusters int nClusters; // number of environment clusters
int nComponents; // number of principal components int nComponents; // number of principal components
int Mdesc; // number of base descriptors int Mdesc; // number of base descriptors
double rin; // inner cut-off radius double rin; // inner cut-off radius
double rcut; // outer cut-off radius double rcut; // outer cut-off radius
double rmax; // rcut - rin double rmax; // rcut - rin
double *rij; // (xj - xi) for all pairs (I, J) double *rij; // (xj - xi) for all pairs (I, J)
double *fij; // force for all pairs (I, J) double *fij; // force for all pairs (I, J)
double *ei; // energy for each atom I double *ei; // energy for each atom I
int *typeai; // types of atoms I only int *typeai; // types of atoms I only
int *numij; // number of pairs (I, J) for each atom I int *numij; // number of pairs (I, J) for each atom I
int *idxi; // storing linear indices of atom I for all pairs (I, J) int *idxi; // storing linear indices of atom I for all pairs (I, J)
int *ai; // IDs of atoms I for all pairs (I, J) int *ai; // IDs of atoms I for all pairs (I, J)
int *aj; // IDs of atoms J for all pairs (I, J) int *aj; // IDs of atoms J for all pairs (I, J)
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)
double besselparams[3]; double besselparams[3];
double *Phi ; // eigenvectors matrix ns x ns double *Phi; // eigenvectors matrix ns x ns
double *rbf; // radial basis functions nij x nrbfmax double *rbf; // radial basis functions nij x nrbfmax
double *rbfx; // x-derivatives of radial basis functions nij x nrbfmax double *rbfx; // x-derivatives of radial basis functions nij x nrbfmax
double *rbfy; // y-derivatives of radial basis functions nij x nrbfmax double *rbfy; // y-derivatives of radial basis functions nij x nrbfmax
double *rbfz; // z-derivatives of radial basis functions nij x nrbfmax double *rbfz; // z-derivatives of radial basis functions nij x nrbfmax
double *abf; // angular basis functions nij x K3 double *abf; // angular basis functions nij x K3
double *abfx; // x-derivatives of angular basis functions nij x K3 double *abfx; // x-derivatives of angular basis functions nij x K3
double *abfy; // y-derivatives of angular basis functions nij x K3 double *abfy; // y-derivatives of angular basis functions nij x K3
double *abfz; // z-derivatives of angular basis functions nij x K3 double *abfz; // z-derivatives of angular basis functions nij x K3
double *abftm ; // angular basis functions 4 x K3 double *abftm; // angular basis functions 4 x K3
double *sumU; // sum of radial basis functions ni x K3 x nrbfmax x nelements double *sumU; // sum of radial basis functions ni x K3 x nrbfmax x nelements
double *forcecoeff; // force coefficients ni x K3 x nrbfmax x nelements double *forcecoeff; // force coefficients ni x K3 x nrbfmax x nelements
double *Proj; // PCA Projection matrix double *Proj; // PCA Projection matrix
double *Centroids; // centroids of the clusters double *Centroids; // centroids of the clusters
double *bd; // base descriptors ni x Mdesc double *bd; // base descriptors ni x Mdesc
double *cb; // force coefficients for base descriptors ni x Mdesc double *cb; // force coefficients for base descriptors ni x Mdesc
double *pd; // environment probability descriptors ni x nClusters double *pd; // environment probability descriptors ni x nClusters
double *bdd; // base descriptors derivatives 3 x nij x Mdesc double *bdd; // base descriptors derivatives 3 x nij x Mdesc
double *pdd; // environment probability descriptors derivatives 3 x nij x nClusters double *pdd; // environment probability descriptors derivatives 3 x nij x nClusters
double *coefficients; // coefficients nCoeffPerElement x nelements double *coefficients; // coefficients nCoeffPerElement x nelements
int *pq3, *pn3, *pc3; // arrays to compute 3-body angular basis functions int *pq3, *pn3, *pc3; // arrays to compute 3-body angular basis functions
int *pa4, *pb4, *pc4; // arrays to compute 4-body angular basis functions int *pa4, *pb4, *pc4; // arrays to compute 4-body angular basis functions
int *ind33l, *ind33r; // nl33 int *ind33l, *ind33r; // nl33
int *ind34l, *ind34r; // nl34 int *ind34l, *ind34r; // nl34
int *ind44l, *ind44r; // nl44 int *ind44l, *ind44r; // nl44
int *elemindex; int *elemindex;
bool peratom_warn; // print warning about missing per-atom energies or stresses bool peratom_warn; // print warning about missing per-atom energies or stresses