avoid direct access to internal data of Modify class instance

This commit is contained in:
Axel Kohlmeyer
2024-01-21 12:19:28 -05:00
parent 35124fdef3
commit 722452657c
3 changed files with 18 additions and 12 deletions

View File

@ -108,15 +108,14 @@ int FixThermalConductivity::setmask()
void FixThermalConductivity::init()
{
// warn if any fix ave/spatial comes after this fix
// warn if any fix ave/chunk comes after this fix
// can cause glitch in averaging since ave will happen after swap
int foundme = 0;
for (int i = 0; i < modify->nfix; i++) {
if (modify->fix[i] == this) foundme = 1;
if (foundme && strcmp(modify->fix[i]->style,"ave/spatial") == 0 && me == 0)
error->warning(FLERR,
"Fix thermal/conductivity comes before fix ave/spatial");
for (const auto &ifix : modify->get_fix_list()) {
if (ifix == this) foundme = 1;
if (foundme && utils::strmatch(ifix->style,"^ave/chunk") && (me == 0))
error->warning(FLERR, "Fix thermal/conductivity comes before fix ave/chunk");
}
// set bounds of 2 slabs in edim