Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

integrate_potential Class Reference

Integrate (1D, 2D or 3D) gradients. More...

#include <colvargrid.h>

Inheritance diagram for integrate_potential:

colvar_grid_scalar colvar_grid< cvm::real > colvarparse colvarparams List of all members.

Public Methods

 integrate_potential ()
virtual ~integrate_potential ()
 integrate_potential (std::vector< colvar * > &colvars, colvar_grid_gradient *gradients)
 Constructor from a vector of colvars + gradient grid. More...

 integrate_potential (colvar_grid_gradient *gradients)
 Constructor from a gradient grid (for processing grid files without a Colvars config). More...

int integrate (const int itmax, const cvm::real &tol, cvm::real &err)
 \brief Calculate potential from divergence (in 2D); return number of steps. More...

void update_div_neighbors (const std::vector< int > &ix)
 \brief Update matrix containing divergence and boundary conditions based on new gradient point value, in neighboring bins. More...

void set_div ()
 \brief Set matrix containing divergence and boundary conditions based on complete gradient grid. More...

void set_zero_minimum ()
 \brief Add constant to potential so that its minimum value is zero Useful e.g. for output. More...


Protected Methods

void update_div_local (const std::vector< int > &ix)
 \brief Update matrix containing divergence and boundary conditions called by update_div_neighbors. More...

void get_grad (cvm::real *g, std::vector< int > &ix)
 Obtain the gradient vector at given location ix, if available or zero if it is on the edge of the gradient grid ix gets wrapped in PBC. More...

void nr_linbcg_sym (const std::vector< cvm::real > &b, std::vector< cvm::real > &x, const cvm::real &tol, const int itmax, int &iter, cvm::real &err)
 \brief Solve linear system based on CG, valid for symmetric matrices only. More...

cvm::real l2norm (const std::vector< cvm::real > &x)
 l2 norm of a vector. More...

void atimes (const std::vector< cvm::real > &x, std::vector< cvm::real > &r)
 Multiplication by sparse matrix representing Lagrangian (or its transpose). More...


Protected Attributes

colvar_grid_gradientgradients
std::vector< cvm::realdivergence
 Array holding divergence + boundary terms (modified Neumann) if not periodic. More...


Detailed Description

Integrate (1D, 2D or 3D) gradients.

Definition at line 1619 of file colvargrid.h.


Constructor & Destructor Documentation

integrate_potential::integrate_potential  
 

virtual integrate_potential::~integrate_potential   [inline, virtual]
 

Definition at line 1625 of file colvargrid.h.

integrate_potential::integrate_potential std::vector< colvar * > &    colvars,
colvar_grid_gradient   gradients
 

Constructor from a vector of colvars + gradient grid.

Definition at line 375 of file colvargrid.C.

References colvarmodule::cite_feature, divergence, colvarmodule::main, colvar_grid< cvm::real >::nd, and colvar_grid< cvm::real >::nt.

integrate_potential::integrate_potential colvar_grid_gradient   gradients
 

Constructor from a gradient grid (for processing grid files without a Colvars config).

Definition at line 405 of file colvargrid.C.

References divergence, gradients, colvar_grid< cvm::real >::lower_boundaries, colvar_grid< cvm::real >::nd, colvar_grid< cvm::real >::nt, colvar_grid< cvm::real >::num_variables, colvar_grid< cvm::real >::number_of_points_vec, colvar_grid< cvm::real >::nx, colvar_grid< cvm::real >::periodic, colvar_grid< cvm::real >::setup, and colvar_grid< cvm::real >::widths.


Member Function Documentation

void integrate_potential::atimes const std::vector< cvm::real > &    x,
std::vector< cvm::real > &    r
[protected]
 

Multiplication by sparse matrix representing Lagrangian (or its transpose).

Definition at line 588 of file colvargrid.C.

References colvar_grid< cvm::real >::nd, colvar_grid< cvm::real >::nx, colvar_grid< cvm::real >::periodic, and colvar_grid< cvm::real >::widths.

Referenced by nr_linbcg_sym.

void integrate_potential::get_grad cvm::real   g,
std::vector< int > &    ix
[protected]
 

Obtain the gradient vector at given location ix, if available or zero if it is on the edge of the gradient grid ix gets wrapped in PBC.

Definition at line 512 of file colvargrid.C.

References gradients, colvar_grid< cvm::real >::nd, colvar_grid_gradient::samples, colvar_grid< cvm::real >::value, colvar_grid< size_t >::value, and colvar_grid< cvm::real >::wrap_edge.

Referenced by update_div_local.

int integrate_potential::integrate const int    itmax,
const cvm::real   tol,
cvm::real   err
 

\brief Calculate potential from divergence (in 2D); return number of steps.

Definition at line 428 of file colvargrid.C.

References colvar_grid_gradient::average, colvar_grid< cvm::real >::data, divergence, colvarmodule::error, gradients, colvar_grid< cvm::real >::incr, colvar_grid< cvm::real >::index_ok, colvarmodule::log, colvar_grid< cvm::real >::nd, colvar_grid< cvm::real >::new_index, nr_linbcg_sym, colvar_grid< cvm::real >::periodic, colvar_grid< cvm::real >::set_value, colvar_grid_gradient::value_output, and colvar_grid< cvm::real >::widths.

Referenced by colvarbias_abf::update.

cvm::real integrate_potential::l2norm const std::vector< cvm::real > &    x [protected]
 

l2 norm of a vector.

Definition at line 1057 of file colvargrid.C.

Referenced by nr_linbcg_sym.

void integrate_potential::nr_linbcg_sym const std::vector< cvm::real > &    b,
std::vector< cvm::real > &    x,
const cvm::real   tol,
const int    itmax,
int &    iter,
cvm::real   err
[protected]
 

\brief Solve linear system based on CG, valid for symmetric matrices only.

Definition at line 1004 of file colvargrid.C.

References atimes, colvarmodule::debug, l2norm, colvar_grid< cvm::real >::nt, and z.

Referenced by integrate.

void integrate_potential::set_div  
 

\brief Set matrix containing divergence and boundary conditions based on complete gradient grid.

Definition at line 466 of file colvargrid.C.

References colvar_grid< cvm::real >::incr, colvar_grid< cvm::real >::index_ok, colvar_grid< cvm::real >::nd, colvar_grid< cvm::real >::new_index, and update_div_local.

Referenced by colvarbias_abf::init.

void integrate_potential::set_zero_minimum   [inline]
 

\brief Add constant to potential so that its minimum value is zero Useful e.g. for output.

Definition at line 1647 of file colvargrid.h.

References colvar_grid< cvm::real >::add_constant, and colvar_grid_scalar::minimum_value.

Referenced by colvarbias_abf::update.

void integrate_potential::update_div_local const std::vector< int > &    ix [protected]
 

\brief Update matrix containing divergence and boundary conditions called by update_div_neighbors.

Definition at line 536 of file colvargrid.C.

References colvar_grid< cvm::real >::address, divergence, get_grad, colvar_grid< cvm::real >::nd, and colvar_grid< cvm::real >::widths.

Referenced by set_div, and update_div_neighbors.

void integrate_potential::update_div_neighbors const std::vector< int > &    ix
 

\brief Update matrix containing divergence and boundary conditions based on new gradient point value, in neighboring bins.

Definition at line 475 of file colvargrid.C.

References colvar_grid< cvm::real >::nd, update_div_local, and colvar_grid< cvm::real >::wrap.

Referenced by colvarbias_abf::update.


Member Data Documentation

std::vector<cvm::real> integrate_potential::divergence [protected]
 

Array holding divergence + boundary terms (modified Neumann) if not periodic.

Definition at line 1657 of file colvargrid.h.

Referenced by integrate, integrate_potential, and update_div_local.

colvar_grid_gradient* integrate_potential::gradients [protected]
 

Definition at line 1654 of file colvargrid.h.

Referenced by get_grad, integrate, and integrate_potential.


The documentation for this class was generated from the following files:
Generated on Thu Dec 5 02:44:59 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002