follow LAMMMPS' programming style more closely
This commit is contained in:
@ -251,43 +251,25 @@ void PairKIM::compute(int eflag, int vflag)
|
||||
|
||||
// compute via KIM model
|
||||
int kimerror = KIM_Model_Compute(pkim, pargs);
|
||||
if (kimerror) error->all(FLERR,"KIM Compute returned error {}", kimerror);
|
||||
if (kimerror) error->all(FLERR, "KIM Compute returned error {}", kimerror);
|
||||
|
||||
// scale results for fix adapt if needed
|
||||
if (scale_extracted)
|
||||
{
|
||||
if (eflag_global != 0)
|
||||
{
|
||||
eng_vdwl *= scale;
|
||||
}
|
||||
for (int i = 0; i < nall; i++)
|
||||
{
|
||||
if (eflag_atom != 0)
|
||||
{
|
||||
eatom[i] *= scale;
|
||||
}
|
||||
if (vflag_atom != 0)
|
||||
{
|
||||
for (int j = 0; j < 6; j++)
|
||||
{
|
||||
vatom[i][j] *= scale;
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
atom->f[i][j] *= scale;
|
||||
if (scale_extracted) {
|
||||
if (eflag_global != 0) eng_vdwl *= scale;
|
||||
for (int i = 0; i < nall; i++) {
|
||||
if (eflag_atom != 0) eatom[i] *= scale;
|
||||
if (vflag_atom != 0) {
|
||||
for (int j = 0; j < 6; j++) vatom[i][j] *= scale;
|
||||
}
|
||||
for (int j = 0; j < 3; j++) atom->f[i][j] *= scale;
|
||||
}
|
||||
}
|
||||
|
||||
// compute virial before reverse comm!
|
||||
if (vflag_global)
|
||||
virial_fdotr_compute();
|
||||
if (vflag_global) virial_fdotr_compute();
|
||||
|
||||
// if newton is off, perform reverse comm
|
||||
if (!lmps_using_newton) {
|
||||
comm->reverse_comm(this);
|
||||
}
|
||||
if (!lmps_using_newton) comm->reverse_comm(this);
|
||||
|
||||
if ((vflag_atom != 0) &&
|
||||
KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial,
|
||||
@ -1169,8 +1151,8 @@ std::string PairKIM::get_atom_type_list() { return atom_type_list; }
|
||||
|
||||
void *PairKIM::extract(const char *str, int &dim)
|
||||
{
|
||||
dim = 0;
|
||||
if (strcmp(str,"scale") == 0)
|
||||
dim = 0;
|
||||
if (strcmp(str,"scale") == 0)
|
||||
{
|
||||
scale_extracted = true;
|
||||
return (void *) &scale;
|
||||
|
||||
Reference in New Issue
Block a user