Minor inconsistency in default fixedpoint for fix npt w/ triclinic boxes

Hello LAMMPS users/developers,

I was looking through the code for the fix npt/etc. style and came across the line which sets the default value for fixedpoint. According to the documentation, this point should be the center of the cell

“The fixedpoint keyword specifies the fixed point for barostat volume changes. By default, it is the center of the box”

This is from the most recent version on github as of yesterday 9/20/14.

fix_nh.cpp: 94-96

fixedpoint[0] = 0.5*(domain->boxlo[0]+domain->boxhi[0]);

fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]);

fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]);

I believe that this won’t be the center of a triclinic box. I think the following might make more sense just in case anyone is relying on the description of the default behavior:

fixedpoint[0] = 0.5*(domain->boxlo[0]+domain->boxhi[0]+domain->xz+domain->xy);
fixedpoint[1] = 0.5*(domain->boxlo[1]+domain->boxhi[1]+domain->yz);
fixedpoint[2] = 0.5*(domain->boxlo[2]+domain->boxhi[2]);

Or, if the tilt factors are not well-defined for orthogonal boxes, there could be a separate case for triclinic and orthogonal.

Please let me know if this makes sense or if I am missing something.

Thanks,
-David

I agree that the “center” of the box is different for triclinic.
However, I’m not clear what you think the NPT behavior should
be for a tilted box. If the tilt is fixed, and you are just using NPT
to adjust the 3 orthogonal, then I think “fixedpoint” is fine as-is. LAMMPS

will adjust the 3 box sides around fixedpoint and the tilt will
be unchanged. If you are also barostatting the tilt factors,
I think it is also OK, b/c the tilt factors don’t vary around a center point.
They are additive values.

So is there some issue with how the box shape/size changes with
fix NPT you have observed, which you think does not conform
to what the fixedpoint keyword imples?

Steve