Skip to content

Commit

Permalink
Addresses #247
Browse files Browse the repository at this point in the history
Only for
RMSD TYPE=OPTIMAL
  • Loading branch information
GiovanniBussi committed Mar 1, 2018
1 parent d7590f5 commit 1687971
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/tools/RMSD.cpp
Expand Up @@ -117,6 +117,7 @@ void RMSD::setAlign(const vector<double> & align, bool normalize_weights, bool r
double w=0.0;
#pragma omp simd reduction(+:w)
for(unsigned i=0; i<n; i++) w+=this->align[i];
plumed_massert(w>epsilon,"It looks like weights used for alignment are zero. Check your reference PDB file.");
double inv=1.0/w;
#pragma omp simd
for(unsigned i=0; i<n; i++) this->align[i]*=inv;
Expand Down Expand Up @@ -150,6 +151,7 @@ void RMSD::setDisplace(const vector<double> & displace, bool normalize_weights)
double w=0.0;
#pragma omp simd reduction(+:w)
for(unsigned i=0; i<n; i++) w+=this->displace[i];
plumed_massert(w>epsilon,"It looks like weights used for displacement are zero. Check your reference PDB file.");
double inv=1.0/w;
if(normalize_weights) {
#pragma omp simd
Expand Down

0 comments on commit 1687971

Please sign in to comment.