Commit f3cf407a authored by Giacomo Fiorin's avatar Giacomo Fiorin
Browse files

Collected fixes and updates to Colvars library

This commit includes several fixes to moving restraints; also added is support
for runtime integration of 2D and 3D PMFs from ABF.

Mostly changes to existing member functions, with few additions in classes not
directly accessible by LAMMPS.  Also removed are calls to std::pow(), replaced
by a copy of MathSpecial::powint().

Relevant commits in Colvars repository:

7307b5c 2017-12-14 Doc improvements [Giacomo Fiorin]
7f86f37 2017-12-14 Allow K-changing restraints computing accumulated work; fix staged-k TI estimator [Giacomo Fiorin]
7c1c175 2017-12-14 Fix 1D ABF trying to do pABF [Jérôme Hénin]
b94aa7e 2017-11-16 Unify PMF output for 1D, 2D and 3D in ABF [Jérôme Hénin]
771a88f 2017-11-15 Poisson integration for all BC in 2d and 3d [Jérôme Hénin]
6af4d60 2017-12-01 Print message when issuing cv delete in VMD [Giacomo Fiorin]
4413972 2017-11-30 Check for homogeneous colvar to set it periodic [Jérôme Hénin]
95fe4b2 2017-11-06 Allow abf_integrate to start in bin with 1 sample [Jérôme Hénin]
06eea27 2017-10-23 Shorten a few constructs by using the power function [Giacomo Fiorin]
3165dfb 2017-10-20 Move includes of colvarproxy.h from headers to files [Giacomo Fiorin]
32a867b 2017-10-20 Add optimized powint function from LAMMPS headers [Giacomo Fiorin]
3ad070a 2017-10-20 Remove some unused includes, isolate calls to std::pow() [Giacomo Fiorin]
0aaf540 2017-10-20 Replace all calls to std::pow() where the exponent is not an integer [Giacomo Fiorin]
parent 77efd3df
Loading
Loading
Loading
Loading
+7.51 KiB (594 KiB)

File changed.

No diff preview for this file type.

+1 −1
Original line number Diff line number Diff line
@@ -195,7 +195,7 @@ int colvar::init(std::string const &conf)
  // - it is homogeneous
  // - all cvcs are periodic
  // - all cvcs have the same period
  if (cvcs[0]->b_periodic) { // TODO make this a CVC feature
  if (is_enabled(f_cv_homogeneous) && cvcs[0]->b_periodic) { // TODO make this a CVC feature
    bool b_periodic = true;
    period = cvcs[0]->period;
    for (i = 1; i < cvcs.size(); i++) {
+10 −6
Original line number Diff line number Diff line
@@ -11,8 +11,6 @@
#define COLVAR_H

#include <iostream>
#include <iomanip>
#include <cmath>

#include "colvarmodule.h"
#include "colvarvalue.h"
@@ -61,6 +59,9 @@ public:
  /// \brief Current actual value (not extended DOF)
  colvarvalue const & actual_value() const;

  /// \brief Current running average (if calculated as set by analysis flag)
  colvarvalue const & run_ave() const;

  /// \brief Force constant of the spring
  cvm::real const & force_constant() const;

@@ -516,7 +517,7 @@ public:
  // collective variable component base class
  class cvc;

  // currently available collective variable components
  // list of available collective variable components

  // scalar colvar components
  class distance;
@@ -611,12 +612,15 @@ inline colvarvalue const & colvar::value() const
  return x_reported;
}


inline colvarvalue const & colvar::actual_value() const
{
  return x;
}

inline colvarvalue const & colvar::run_ave() const
{
  return runave;
}

inline colvarvalue const & colvar::velocity() const
{
+2 −2
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ namespace UIestimator {
            this->width = width;
            this->dimension = lowerboundary.size();
            this->y_size = y_size;     // keep in mind the internal (spare) matrix is stored in diagonal form
            this->y_total_size = int(pow(double(y_size), dimension) + EPSILON);
            this->y_total_size = int(std::pow(double(y_size), double(dimension)) + EPSILON);

            // the range of the matrix is [lowerboundary, upperboundary]
            x_total_size = 1;
@@ -121,7 +121,7 @@ namespace UIestimator {
            int index = 0;
            for (i = 0; i < dimension; i++) {
                if (i + 1 < dimension)
                    index += temp[i] * int(pow(double(y_size), dimension - i - 1) + EPSILON);
                    index += temp[i] * int(std::pow(double(y_size), double(dimension - i - 1)) + EPSILON);
                else
                    index += temp[i];
            }
+2 −0
Original line number Diff line number Diff line
@@ -8,9 +8,11 @@
// Colvars repository at GitHub.

#include "colvarmodule.h"
#include "colvarproxy.h"
#include "colvarparse.h"
#include "colvaratoms.h"


cvm::atom::atom()
{
  index = -1;
Loading