fix enforce2d has to be defined after fixes with enforce2d_flag set
this check currently only applies to rigid fixes and is needed
so that their respective enforce2d function is called _after_
the post force functions. this is required in combination with
commit a9ff593763 to allow rigid
fixes use the langevin option correctly for 2d systems
This commit is contained in:
@ -66,12 +66,21 @@ void FixEnforce2D::init()
|
|||||||
if (modify->fix[i]->enforce2d_flag) nfixlist++;
|
if (modify->fix[i]->enforce2d_flag) nfixlist++;
|
||||||
|
|
||||||
if (nfixlist) {
|
if (nfixlist) {
|
||||||
|
int myindex = -1;
|
||||||
delete [] flist;
|
delete [] flist;
|
||||||
flist = new Fix*[nfixlist];
|
flist = new Fix*[nfixlist];
|
||||||
nfixlist = 0;
|
nfixlist = 0;
|
||||||
for (int i = 0; i < modify->nfix; i++) {
|
for (int i = 0; i < modify->nfix; i++) {
|
||||||
if (modify->fix[i]->enforce2d_flag)
|
if (modify->fix[i]->enforce2d_flag) {
|
||||||
flist[nfixlist++] = modify->fix[i];
|
if (myindex < 0)
|
||||||
|
flist[nfixlist++] = modify->fix[i];
|
||||||
|
else {
|
||||||
|
char msg[256];
|
||||||
|
sprintf(msg,"Fix enforce2d must be defined after fix %s",modify->fix[i]->style);
|
||||||
|
error->all(FLERR,msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (modify->fix[i] == this) myindex = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user