From 59711b33532580ff2df92c9bd1ff5b748c7b00f2 Mon Sep 17 00:00:00 2001 From: Giovanni Bussi <giovanni.bussi@gmail.com> Date: Wed, 1 Oct 2014 13:00:46 +0200 Subject: [PATCH] Fixed bug in replica exchange I fixed a bug occurring when using replicas with different Hamiltonians (either lamdba dynamics or plumed -hrex branch). The acceptance was wrong when using a CV that depends on charges or masses (if charges or masses were changed in the Hamiltonian, respectively). --- src/core/Atoms.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/core/Atoms.cpp b/src/core/Atoms.cpp index f53a705e1..36f1841bd 100644 --- a/src/core/Atoms.cpp +++ b/src/core/Atoms.cpp @@ -393,16 +393,12 @@ void Atoms::removeGroup(const std::string&name){ void Atoms::writeBinary(std::ostream&o)const{ o.write(reinterpret_cast<const char*>(&positions[0][0]),natoms*3*sizeof(double)); - o.write(reinterpret_cast<const char*>(&masses[0]),natoms*sizeof(double)); - o.write(reinterpret_cast<const char*>(&charges[0]),natoms*sizeof(double)); o.write(reinterpret_cast<const char*>(&box(0,0)),9*sizeof(double)); o.write(reinterpret_cast<const char*>(&energy),sizeof(double)); } void Atoms::readBinary(std::istream&i){ i.read(reinterpret_cast<char*>(&positions[0][0]),natoms*3*sizeof(double)); - i.read(reinterpret_cast<char*>(&masses[0]),natoms*sizeof(double)); - i.read(reinterpret_cast<char*>(&charges[0]),natoms*sizeof(double)); i.read(reinterpret_cast<char*>(&box(0,0)),9*sizeof(double)); i.read(reinterpret_cast<char*>(&energy),sizeof(double)); pbc.setBox(box); -- GitLab