Skip to content
Snippets Groups Projects
Commit 027ee904 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Merge branch 'v2.1'

parents cf669d65 22c223b5
No related branches found
No related tags found
No related merge requests found
......@@ -189,6 +189,7 @@ For users:
See notes <a href="http://github.com/plumed/plumed2/issues/132"> here </a>
This fix requires gromacs to be repatched and could be very important if you run biased simulations in the NPT ensemble.
- Fixed a bug in the virial computed with \ref FIT_TO_TEMPLATE when the reference pdb had center non located at the origin.
- Fixed a bug in the the forces computed with \ref FIT_TO_TEMPLATE when used in combination with \ref COM, \ref CENTER, or \ref GHOST
- Updated internal molfile plugins to VMD 1.9.2.
- Included crd and crdbox formats to internal molfile.
- Added --natoms to \ref driver . This is required to read coordinate
......
......@@ -7,7 +7,8 @@ MOLINFO STRUCTURE=helix.pdb
# ps: DISTANCE ATOMS=c,3 SCALED_COMPONENTS
# new way (resetting reference frame)
FIT_TO_TEMPLATE REFERENCE=align.pdb TYPE=SIMPLE
p: POSITION ATOM=3
s: COM ATOMS=3
p: POSITION ATOM=s
ps: POSITION SCALED_COMPONENTS ATOM=3
# using one or the other should give the same result and same forces
......
......@@ -46,10 +46,13 @@ ActionWithVirtualAtom::~ActionWithVirtualAtom(){
}
void ActionWithVirtualAtom::apply(){
const Vector & f(atoms.forces[index.index()]);
Vector & f(atoms.forces[index.index()]);
for(unsigned i=0;i<getNumberOfAtoms();i++) modifyForces()[i]=matmul(derivatives[i],f);
Tensor & v(modifyVirial());
for(unsigned i=0;i<3;i++) v+=boxDerivatives[i]*f[i];
f.zero(); // after propagating the force to the atoms used to compute the vatom, we reset this to zero
// this is necessary to avoid double counting if then one tries to compute the total force on the c.o.m. of the system.
// notice that this is currently done in FIT_TO_TEMPLATE
}
void ActionWithVirtualAtom::requestAtoms(const std::vector<AtomNumber> & a){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment