make sure gmres and icc have same kspace flag behavior

This commit is contained in:
ali
2022-10-10 09:49:56 -05:00
parent b56df94b34
commit d834d5cc15
2 changed files with 9 additions and 6 deletions

View File

@ -273,8 +273,12 @@ void FixPolarizeBEMGMRES::setup(int /*vflag*/)
efield_kspace = (dynamic_cast<MSMDielectric *>(force->kspace))->efield; efield_kspace = (dynamic_cast<MSMDielectric *>(force->kspace))->efield;
else else
error->all(FLERR, "Kspace style not compatible with fix polarize/bem/gmres"); error->all(FLERR, "Kspace style not compatible with fix polarize/bem/gmres");
} else } else {
error->all(FLERR, "No Kspace style available for fix polarize/bem/gmres"); if (kspaceflag == 1) { // users specified kspace yes but there is no kspace pair style
error->warning(FLERR, "No Kspace pair style available for fix polarize/bem/gmres");
kspaceflag = 0;
}
}
// NOTE: epsilon0e2q converts (epsilon0 * efield) to the unit of (charge unit / squared distance unit) // NOTE: epsilon0e2q converts (epsilon0 * efield) to the unit of (charge unit / squared distance unit)
// efield is computed by pair and kspace styles in the unit of energy unit / charge unit / distance unit // efield is computed by pair and kspace styles in the unit of energy unit / charge unit / distance unit

View File

@ -175,10 +175,9 @@ void FixPolarizeBEMICC::setup(int /*vflag*/)
efield_kspace = (dynamic_cast<MSMDielectric *>(force->kspace))->efield; efield_kspace = (dynamic_cast<MSMDielectric *>(force->kspace))->efield;
else else
error->all(FLERR, "Kspace style not compatible with fix polarize/bem/icc"); error->all(FLERR, "Kspace style not compatible with fix polarize/bem/icc");
} else { } else {
if (kspaceflag == 1) { // users specified kspace yes if (kspaceflag == 1) { // users specified kspace yes but there is no kspace pair style
error->warning(FLERR, "No Kspace style available for fix polarize/bem/icc"); error->warning(FLERR, "No Kspace pair style available for fix polarize/bem/icc");
kspaceflag = 0; kspaceflag = 0;
} }
} }