Unverified Commit 7d5bf968 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1728 from evoyiatzis/patch-2

Update compute_gyration_shape.cpp
parents d02f8067 10031e91
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -84,3 +84,6 @@ package"_Build_package.html doc page for more info.
:link(Theodorou)
[(Theodorou)] Theodorou, Suter, Macromolecules, 18, 1206 (1985).

:link(Mattice)
[(Mattice)] Mattice, Suter, Conformational Theory of Large Molecules, Wiley, New York, 1994. 
+1 −0
Original line number Diff line number Diff line
@@ -1582,6 +1582,7 @@ Materias
mathbf
matlab
matplotlib
Mattice
Mattox
Mattson
maxangle
+7 −11
Original line number Diff line number Diff line
@@ -112,19 +112,15 @@ void ComputeGyrationShape::compute_vector()
  }

  // compute the shape parameters of the gyration tensor
  double sq_eigen_x = MathSpecial::square(evalues[0]);
  double sq_eigen_y = MathSpecial::square(evalues[1]);
  double sq_eigen_z = MathSpecial::square(evalues[2]);

  double nominator = MathSpecial::square(sq_eigen_x)
    + MathSpecial::square(sq_eigen_y)
    + MathSpecial::square(sq_eigen_z);
  double denominator = MathSpecial::square(sq_eigen_x+sq_eigen_y+sq_eigen_z);
  double nominator = MathSpecial::square(evalues[0])
    + MathSpecial::square(evalues[1])
    + MathSpecial::square(evalues[2]);
  double denominator = MathSpecial::square(evalues[0]+evalues[1]+evalues[2]);

  vector[0] = evalues[0];
  vector[1] = evalues[1];
  vector[2] = evalues[2];
  vector[3] = sq_eigen_z - 0.5*(sq_eigen_x + sq_eigen_y);
  vector[4] = sq_eigen_y - sq_eigen_x;
  vector[5] = 0.5*(3*nominator/denominator - 1.0);
  vector[3] = evalues[0] - 0.5*(evalues[1] + evalues[2]);
  vector[4] = evalues[1] - evalues[2];
  vector[5] = 1.5*nominator/denominator - 0.5;
}