whitespace

This commit is contained in:
Axel Kohlmeyer
2022-11-27 23:50:04 -05:00
parent fda10cf604
commit 484b84396c
2 changed files with 16 additions and 16 deletions

View File

@ -3075,7 +3075,7 @@ double MLPOD::calculate_energy(double *effectivecoeff, double *gd, double *coeff
return energy;
}
double MLPOD::calculate_energy(double *energycoeff, double *forcecoeff, double *gd,
double MLPOD::calculate_energy(double *energycoeff, double *forcecoeff, double *gd,
double *gdall, double *coeff)
{
int nd1 = pod.nd1;
@ -3108,15 +3108,15 @@ double MLPOD::calculate_energy(double *energycoeff, double *forcecoeff, double *
double *coeff333 = &coeff[nd1234+nd22+nd23+nd24+nd33+nd34+nd44+nd234];
double *coeff444 = &coeff[nd1234+nd22+nd23+nd24+nd33+nd34+nd44+nd234+nd333];
// sum global descriptors over all MPI ranks
MPI_Allreduce(gd, gdall, nd1234, MPI_DOUBLE, MPI_SUM, world);
for (int i=0; i< nd1234; i++) {
// sum global descriptors over all MPI ranks
MPI_Allreduce(gd, gdall, nd1234, MPI_DOUBLE, MPI_SUM, world);
for (int i=0; i< nd1234; i++) {
energycoeff[i] = 0.0;
forcecoeff[i] = 0.0;
}
// effective POD coefficients for calculating force
double *c2 = &forcecoeff[nd1];
@ -3124,11 +3124,11 @@ double MLPOD::calculate_energy(double *energycoeff, double *forcecoeff, double *
double *c4 = &forcecoeff[nd1+nd2+nd3];
// effective POD coefficients for calculating energy
double *ce2 = &energycoeff[nd1];
double *ce3 = &energycoeff[nd1+nd2];
double *ce4 = &energycoeff[nd1+nd2+nd3];
// two-body, three-body, and four-body descriptors
double *d2 = &gdall[nd1];
@ -3178,12 +3178,12 @@ double MLPOD::calculate_energy(double *energycoeff, double *forcecoeff, double *
forcecoeff[i] += coeff[i];
}
// calculate energy
// calculate energy
double energy = 0.0;
for (int i=0; i< nd1234; i++)
energy += energycoeff[i]*gd[i];
for (int i=0; i< nd1234; i++)
energy += energycoeff[i]*gd[i];
return energy;
}

View File

@ -130,14 +130,14 @@ void PairMLPOD::compute(int eflag, int vflag)
int nd34 = podptr->pod.nd34;
int nd44 = podptr->pod.nd44;
int nd = podptr->pod.nd;
bigint natom = atom->natoms;
bigint natom = atom->natoms;
for (int j=nd1234; j<(nd1234+nd22+nd23+nd24+nd33+nd34+nd44); j++)
newpodcoeff[j] = podcoeff[j]/(natom);
for (int j=(nd1234+nd22+nd23+nd24+nd33+nd34+nd44); j<nd; j++)
newpodcoeff[j] = podcoeff[j]/(natom*natom);
// compute energy and effective coefficients
eng_vdwl = podptr->calculate_energy(energycoeff, forcecoeff, gd, gdall, newpodcoeff);