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

Small fix to ensure virial is consistent with forces

parent f13c7e99
No related branches found
No related tags found
No related merge requests found
......@@ -171,8 +171,14 @@ void ERMSD::calculate(){
for(unsigned i=0;i<derivs.size();++i) {derivs[i].zero();}
double ermsdist;
Tensor virial;
// This is a trick to avoid explicit virial calculation
// 1. we make the molecule whole
makeWhole();
ermsdist=ermsd.calculate(getPositions(),getPbc(),derivs,virial);
// 2. we ignore pbcs
Pbc fake_pbc;
// Notice that this might have problems when having 2 RNA molecules (hybridization).
ermsdist=ermsd.calculate(getPositions(),fake_pbc,derivs,virial);
setValue(ermsdist);
for(unsigned i=0;i<derivs.size();++i) {setAtomsDerivatives(i,derivs[i]);}
......
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