forked from lijiext/lammps
add warning if gravity is used incorrectly with overlapped rigid bodies
This commit is contained in:
parent
5859b18d2f
commit
a11b886b5c
|
@ -728,6 +728,23 @@ void FixRigid::init()
|
|||
}
|
||||
}
|
||||
|
||||
// warn if body properties are read from inpfile
|
||||
// and the gravity keyword is not set and a gravity fix exists
|
||||
// this could mean body particles are overlapped
|
||||
// and gravity is not applied correctly
|
||||
|
||||
if (inpfile && !id_gravity) {
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"gravity") == 0) {
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Gravity may not be correctly applied "
|
||||
"to rigid bodies if they consist of "
|
||||
"overlapped particles");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// error if npt,nph fix comes before rigid fix
|
||||
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
|
|
|
@ -574,6 +574,23 @@ void FixRigidSmall::init()
|
|||
}
|
||||
}
|
||||
|
||||
// warn if body properties are read from inpfile or a mol template file
|
||||
// and the gravity keyword is not set and a gravity fix exists
|
||||
// this could mean body particles are overlapped
|
||||
// and gravity is not applied correctly
|
||||
|
||||
if ((inpfile || onemols) && !id_gravity) {
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"gravity") == 0) {
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Gravity may not be correctly applied "
|
||||
"to rigid bodies if they consist of "
|
||||
"overlapped particles");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// error if npt,nph fix comes before rigid fix
|
||||
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
|
|
Loading…
Reference in New Issue