more checking on temperature and pressure computes plus bugfixes
This commit is contained in:
@ -246,8 +246,12 @@ void FixRigidNH::init()
|
||||
|
||||
if (tcomputeflag) {
|
||||
temperature = modify->get_compute_by_id(id_temp);
|
||||
if (!temperature)
|
||||
if (!temperature) {
|
||||
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
|
||||
} else {
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
|
||||
}
|
||||
}
|
||||
|
||||
if (pstat_flag) {
|
||||
@ -260,9 +264,9 @@ void FixRigidNH::init()
|
||||
auto deform = dynamic_cast<FixDeform *>(ifix);
|
||||
if (deform) {
|
||||
int *dimflag = deform->dimflag;
|
||||
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) ||
|
||||
(p_flag[2] && dimflag[2]))
|
||||
error->all(FLERR,"Cannot use fix {} and fix deform on same component of stress tensor", style);
|
||||
if ((p_flag[0] && dimflag[0]) || (p_flag[1] && dimflag[1]) || (p_flag[2] && dimflag[2]))
|
||||
error->all(FLERR,"Cannot use fix {} and fix deform on same component of stress tensor",
|
||||
style);
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,9 +288,12 @@ void FixRigidNH::init()
|
||||
// set pressure compute ptr
|
||||
|
||||
pressure = modify->get_compute_by_id(id_press);
|
||||
if (!pressure) error->all(FLERR,"Pressure ID {} for fix {} does not exist", id_press, style);
|
||||
if (pressure->pressflag == 0)
|
||||
error->all(FLERR,"Compute ID {} does not compute pressure", id_press);
|
||||
if (!pressure) {
|
||||
error->all(FLERR,"Pressure ID {} for fix {} does not exist", id_press, style);
|
||||
} else {
|
||||
if (pressure->pressflag == 0)
|
||||
error->all(FLERR,"Compute ID {} does not compute pressure", id_press);
|
||||
}
|
||||
|
||||
// detect if any rigid fixes exist so rigid bodies move on remap
|
||||
// this will include self
|
||||
|
||||
@ -221,8 +221,12 @@ void FixRigidNHSmall::init()
|
||||
|
||||
if (tcomputeflag) {
|
||||
temperature = modify->get_compute_by_id(id_temp);
|
||||
if (!temperature)
|
||||
if (!temperature) {
|
||||
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
|
||||
} else {
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
|
||||
}
|
||||
}
|
||||
|
||||
if (pstat_flag) {
|
||||
@ -260,9 +264,12 @@ void FixRigidNHSmall::init()
|
||||
// set pressure compute ptr
|
||||
|
||||
pressure = modify->get_compute_by_id(id_press);
|
||||
if (!pressure) error->all(FLERR,"Pressure ID {} for fix {} does not exist", id_press, style);
|
||||
if (pressure->pressflag == 0)
|
||||
error->all(FLERR,"Compute ID {} does not compute pressure", id_press);
|
||||
if (!pressure) {
|
||||
error->all(FLERR,"Pressure ID {} for fix {} does not exist", id_press, style);
|
||||
} else {
|
||||
if (pressure->pressflag == 0)
|
||||
error->all(FLERR,"Compute ID {} does not compute pressure", id_press);
|
||||
}
|
||||
|
||||
// detect if any rigid fixes exist so rigid bodies move on remap
|
||||
// this will include self
|
||||
|
||||
@ -248,18 +248,28 @@ void FixMSST::init()
|
||||
// set compute ptrs
|
||||
|
||||
temperature = modify->get_compute_by_id(id_temp);
|
||||
if (!temperature)
|
||||
if (!temperature) {
|
||||
error->all(FLERR, "Could not find fix msst temperature compute ID {}", id_temp);
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Fix msst compute ID {} does not compute temperature", id_temp);
|
||||
} else {
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Fix msst compute ID {} does not compute temperature", id_temp);
|
||||
}
|
||||
|
||||
pressure = modify->get_compute_by_id(id_press);
|
||||
if (!pressure) error->all(FLERR, "Could not find fix msst pressure compute ID {}", id_press);
|
||||
if (pressure->pressflag == 0)
|
||||
error->all(FLERR, "Fix msst compute ID {} does not compute pressure", id_press);
|
||||
if (!pressure) {
|
||||
error->all(FLERR, "Could not find fix msst pressure compute ID {}", id_press);
|
||||
} else {
|
||||
if (pressure->pressflag == 0)
|
||||
error->all(FLERR, "Fix msst compute ID {} does not compute pressure", id_press);
|
||||
}
|
||||
|
||||
pe = modify->get_compute_by_id(id_pe);
|
||||
if (!pe) error->all(FLERR, "Could not find fix msst pe compute ID {}", id_pe);
|
||||
if (pe->peflag == 0)
|
||||
error->all(FLERR, "Fix msst compute ID {} does not compute potential energy", id_pe);
|
||||
if (!pe) {
|
||||
error->all(FLERR, "Could not find fix msst pe compute ID {}", id_pe);
|
||||
} else {
|
||||
if (pe->peflag == 0)
|
||||
error->all(FLERR, "Fix msst compute ID {} does not compute potential energy", id_pe);
|
||||
}
|
||||
|
||||
dtv = update->dt;
|
||||
dtf = 0.5 * update->dt * force->ftm2v;
|
||||
|
||||
@ -162,8 +162,13 @@ void FixNPHug::init()
|
||||
// set pe ptr
|
||||
|
||||
pe = modify->get_compute_by_id(id_pe);
|
||||
if (!pe)
|
||||
if (!pe) {
|
||||
error->all(FLERR, "Potential energy compute ID {} for fix {} does not exist", id_pe, style);
|
||||
} else {
|
||||
if (pe->peflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute potential energy",
|
||||
id_temp, style);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -225,11 +225,12 @@ void FixLangevin::init()
|
||||
{
|
||||
if (id_temp) {
|
||||
temperature = modify->get_compute_by_id(id_temp);
|
||||
if (!temperature)
|
||||
if (!temperature) {
|
||||
error->all(FLERR, "Temperature compute ID {} for fix {} does not exist", id_temp, style);
|
||||
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute temperature", id_temp, style);
|
||||
} else {
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute temperature", id_temp, style);
|
||||
}
|
||||
}
|
||||
|
||||
if (gjfflag) {
|
||||
|
||||
@ -268,6 +268,7 @@ void FixPressBerendsen::init()
|
||||
temperature = modify->get_compute_by_id(id_temp);
|
||||
if (!temperature) {
|
||||
error->all(FLERR, "Temperature compute ID {} for fix {} does not exist", id_temp, style);
|
||||
} else {
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
|
||||
if (temperature->tempbias)
|
||||
@ -279,6 +280,7 @@ void FixPressBerendsen::init()
|
||||
pressure = modify->get_compute_by_id(id_press);
|
||||
if (!pressure) {
|
||||
error->all(FLERR, "Pressure compute ID {} for fix {} does not exist", id_press, style);
|
||||
} else {
|
||||
if (pressure->pressflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute pressure", id_press, style);
|
||||
}
|
||||
|
||||
@ -119,6 +119,7 @@ void FixTempBerendsen::init()
|
||||
temperature = modify->get_compute_by_id(id_temp);
|
||||
if (!temperature) {
|
||||
error->all(FLERR,"Temperature compute ID {} for fix {} does not exist", id_temp, style);
|
||||
} else {
|
||||
if (temperature->tempflag == 0)
|
||||
error->all(FLERR, "Compute ID {} for fix {} does not compute a temperature", id_temp, style);
|
||||
if (temperature->tempbias) which = BIAS;
|
||||
|
||||
Reference in New Issue
Block a user