Commit f8f13d92 authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #693 from giacomofiorin/colvars-update

Update Colvars to version 2017-10-11
parents a973c65d 3e89b270
Loading
Loading
Loading
Loading
+8.94 KiB (566 KiB)

File changed.

No diff preview for this file type.

+1 −2
Original line number Diff line number Diff line
@@ -59,8 +59,7 @@ LEPTON_OBJS = \
COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o) $(LEPTON_OBJS)

%.o: %.cpp
	$(CXX) $(CXXFLAGS) $(COLVARS_INCFLAGS) \
	-Ilepton/include -DLEPTON -c -o $@ $<
	$(CXX) $(CXXFLAGS) $(COLVARS_INCFLAGS) -Ilepton/include -DLEPTON -c -o $@ $<

$(COLVARS_LIB):	Makefile.deps $(COLVARS_OBJS)
	$(AR) $(ARFLAGS) $(COLVARS_LIB) $(COLVARS_OBJS) $(LEPTON_OBJS)
+6 −5
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@ $(COLVARS_OBJ_DIR)colvarbias_abf.o: colvarbias_abf.cpp colvarmodule.h \
 lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \
 lepton/include/lepton/Exception.h \
 lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \
 colvarbias_abf.h colvarbias.h colvargrid.h
 colvarbias_abf.h colvarbias.h colvargrid.h colvar_UIestimator.h
$(COLVARS_OBJ_DIR)colvarbias_alb.o: colvarbias_alb.cpp colvarmodule.h \
 colvars_version.h colvartypes.h colvarproxy.h colvarvalue.h \
 colvarbias_alb.h colvar.h colvarparse.h colvardeps.h \
@@ -39,7 +39,8 @@ $(COLVARS_OBJ_DIR)colvarbias.o: colvarbias.cpp colvarmodule.h \
 lepton/include/lepton/ExpressionTreeNode.h \
 lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \
 lepton/include/lepton/Exception.h \
 lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h
 lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \
 colvargrid.h
$(COLVARS_OBJ_DIR)colvarbias_histogram.o: colvarbias_histogram.cpp \
 colvarmodule.h colvars_version.h colvartypes.h colvarproxy.h \
 colvarvalue.h colvar.h colvarparse.h colvardeps.h \
@@ -198,9 +199,9 @@ $(COLVARS_OBJ_DIR)colvarmodule.o: colvarmodule.cpp colvarmodule.h \
 lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \
 lepton/include/lepton/Exception.h \
 lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \
 colvarbias.h colvarbias_abf.h colvargrid.h colvarbias_alb.h \
 colvarbias_histogram.h colvarbias_meta.h colvarbias_restraint.h \
 colvarscript.h colvaratoms.h
 colvarbias.h colvarbias_abf.h colvargrid.h colvar_UIestimator.h \
 colvarbias_alb.h colvarbias_histogram.h colvarbias_meta.h \
 colvarbias_restraint.h colvarscript.h colvaratoms.h colvarcomp.h
$(COLVARS_OBJ_DIR)colvarparse.o: colvarparse.cpp colvarmodule.h \
 colvars_version.h colvartypes.h colvarproxy.h colvarvalue.h \
 colvarparse.h
+18 −5
Original line number Diff line number Diff line
@@ -1008,6 +1008,8 @@ int colvar::calc()

int colvar::calc_cvcs(int first_cvc, size_t num_cvcs)
{
  colvarproxy *proxy = cvm::main()->proxy;

  int error_code = COLVARS_OK;
  if (cvm::debug())
    cvm::log("Calculating colvar \""+this->name+"\", components "+
@@ -1018,14 +1020,18 @@ int colvar::calc_cvcs(int first_cvc, size_t num_cvcs)
    return error_code;
  }

  if (cvm::step_relative() > 0) {
    // Total force depends on Jacobian derivative from previous timestep
  if ((cvm::step_relative() > 0) && (!proxy->total_forces_same_step())){
    // Use Jacobian derivative from previous timestep
    error_code |= calc_cvc_total_force(first_cvc, num_cvcs);
  }
  // atom coordinates are updated by the next line
  error_code |= calc_cvc_values(first_cvc, num_cvcs);
  error_code |= calc_cvc_gradients(first_cvc, num_cvcs);
  error_code |= calc_cvc_Jacobians(first_cvc, num_cvcs);
  if (proxy->total_forces_same_step()){
    // Use Jacobian derivative from this timestep
    error_code |= calc_cvc_total_force(first_cvc, num_cvcs);
  }

  if (cvm::debug())
    cvm::log("Done calculating colvar \""+this->name+"\".\n");
@@ -1043,6 +1049,7 @@ int colvar::collect_cvc_data()

  if (cvm::step_relative() > 0) {
    // Total force depends on Jacobian derivative from previous timestep
    // collect_cvc_total_forces() uses the previous value of jd
    error_code |= collect_cvc_total_forces();
  }
  error_code |= collect_cvc_values();
@@ -1471,9 +1478,15 @@ cvm::real colvar::update_forces_energy()
    // Coupling force is a slow force, to be applied to atomic coords impulse-style
    f *= cvm::real(time_step_factor);

    if (is_enabled(f_cv_subtract_applied_force)) {
      // Report a "system" force without the biases on this colvar
      // that is, just the spring force
      ft_reported = (-0.5 * ext_force_k) * this->dist2_lgrad(xr, x);
    } else {
      // The total force acting on the extended variable is f_ext
      // This will be used in the next timestep
      ft_reported = f_ext;
    }

    // leapfrog: starting from x_i, f_i, v_(i-1/2)
    vr  += (0.5 * dt) * f_ext / ext_mass;
+14 −1
Original line number Diff line number Diff line
@@ -61,6 +61,9 @@ public:
  /// \brief Current actual value (not extended DOF)
  colvarvalue const & actual_value() const;
  
  /// \brief Force constant of the spring
  cvm::real const & force_constant() const;
   
  /// \brief Current velocity (previously set by calc() or by read_traj())
  colvarvalue const & velocity() const;

@@ -96,6 +99,12 @@ public:
  {
    return cv_features;
  }
  static void delete_features() {
    for (size_t i=0; i < cv_features.size(); i++) {
      delete cv_features[i];
    }
    cv_features.clear();
  }

  /// Implements possible actions to be carried out
  /// when a given feature is enabled
@@ -592,6 +601,10 @@ public:
  }
};

inline cvm::real const & colvar::force_constant() const
{
  return ext_force_k;
}

inline colvarvalue const & colvar::value() const
{
Loading