Can the volume be varied in the NVT ensemble, as it can be at temperature?
For example, something like changing the length of a side from 40 to 20.
You have to be careful with your choice of words. There is a difference between an NVT ensemble (which is a term from statistical mechanics) and the “fix nvt” integrator in LAMMPS. Many people make the mistake of mixing those and thus give a very bad example and often say things that are plain incorrect.
Bottom line, using “fix nvt” does not result in a simulation in the “NVT ensemble”. Additional requirements, as determined by statistical mechanics, have to be met. Same for NPT, NVE, NPH etc.
In the NVT ensemble you must not change the volume. It would no longer be an NVT ensemble.
When using the “fix nvt” integrator you can very well also use “fix deform” to change the box volume. As stated above, this would no longer represent an NVT ensemble.
Thanks for the reply.
I was able to revise my knowledge about ensembles.
It also solved what I was trying to do with fix deform.