Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
integrate_potential Class Reference

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

#include <colvargrid.h>

Inheritance diagram for integrate_potential:
Inheritance graph
[legend]
Collaboration diagram for integrate_potential:
Collaboration graph
[legend]

Public Member Functions

 integrate_potential (std::vector< colvar * > &colvars, std::shared_ptr< colvar_grid_gradient > gradients)
 Constructor from a vector of colvars + gradient grid.
 
 integrate_potential (std::shared_ptr< colvar_grid_gradient > gradients)
 Constructor from a gradient grid (for processing grid files without a Colvars config)
 
int integrate (const int itmax, const cvm::real &tol, cvm::real &err, bool verbose=true)
 Calculate potential from divergence (in 2D); return number of steps.
 
void update_div_neighbors (const std::vector< int > &ix)
 Update matrix containing divergence and boundary conditions based on new gradient point value, in neighboring bins.
 
void update_div_local (const std::vector< int > &ix)
 Update matrix containing divergence and boundary conditions called by update_div_neighbors and by colvarbias_abf::adiabatic_reweighting_update_gradient_pmf.
 
void set_div ()
 Set matrix containing divergence and boundary conditions based on complete gradient grid.
 
void set_zero_minimum ()
 Add constant to potential so that its minimum value is zero Useful e.g. for output.
 
- Public Member Functions inherited from colvar_grid_scalar
 colvar_grid_scalar ()
 Default constructor.
 
 colvar_grid_scalar (colvar_grid_scalar const &g)
 Copy constructor (needed because of the grad pointer)
 
virtual ~colvar_grid_scalar ()
 Destructor.
 
 colvar_grid_scalar (std::vector< int > const &nx_i)
 Constructor from specific sizes arrays.
 
 colvar_grid_scalar (std::vector< colvar * > &colvars, bool add_extra_bin=false)
 Constructor from a vector of colvars.
 
void acc_value (std::vector< int > const &ix, cvm::real const &new_value, size_t const &imult=0)
 Accumulate the value.
 
std::string get_state_params () const
 Write the current grid parameters to a string.
 
int parse_params (std::string const &conf, colvarparse::Parse_Mode const parse_mode=colvarparse::parse_normal)
 Read new grid parameters from a string.
 
std::istream & read_restart (std::istream &is)
 Read all grid parameters and data from a formatted stream.
 
cvm::memory_streamread_restart (cvm::memory_stream &is)
 Read all grid parameters and data from an unformatted stream.
 
std::ostream & write_restart (std::ostream &os)
 Write all grid parameters and data to a formatted stream.
 
cvm::memory_streamwrite_restart (cvm::memory_stream &os)
 Write all grid parameters and data to an unformatted stream.
 
std::istream & read_raw (std::istream &is)
 Read all grid parameters and data from a formatted stream.
 
cvm::memory_streamread_raw (cvm::memory_stream &is)
 Read all grid parameters and data from an unformatted stream.
 
std::ostream & write_raw (std::ostream &os, size_t const buf_size=3) const
 
cvm::memory_streamwrite_raw (cvm::memory_stream &os, size_t const buf_size=3) const
 
std::istream & read_multicol (std::istream &is, bool add=false)
 Read a grid written by write_multicol(), incrementin if data is true.
 
int read_multicol (std::string const &filename, std::string description="grid file", bool add=false)
 Read a grid written by write_multicol(), incrementing if add is true.
 
std::ostream & write_multicol (std::ostream &os) const
 Write grid in a format which is both human-readable and gnuplot-friendly.
 
int write_multicol (std::string const &filename, std::string description="grid file") const
 Write grid in a format which is both human-readable and gnuplot-friendly.
 
std::ostream & write_opendx (std::ostream &os) const
 Write the grid data without labels, as they are represented in memory.
 
int write_opendx (std::string const &filename, std::string description="grid file") const
 Write the grid data without labels, as they are represented in memory.
 
void vector_gradient_finite_diff (const std::vector< int > &ix0, std::vector< cvm::real > &grad)
 Return the gradient of the scalar field from finite differences Input coordinates are those of gradient grid, shifted wrt scalar grid Should not be called on edges of scalar grid, provided the latter has margins wrt gradient grid.
 
cvm::real log_gradient_finite_diff (const std::vector< int > &ix0, int n=0, int offset=0)
 Return the log-gradient from finite differences on the same grid for dimension n (colvar_grid_scalar)
 
cvm::real gradient_finite_diff (const std::vector< int > &ix0, int n=0)
 Return the gradient of discrete count from finite differences on the same grid for dimension n (colvar_grid_scalar)
 
virtual cvm::real value_output (std::vector< int > const &ix, size_t const &imult=0) const override
 Return the value of the function at ix divided by its number of samples (if the count grid is defined) More...
 
virtual void value_input (std::vector< int > const &ix, cvm::real const &new_value, size_t const &imult=0, bool add=false) override
 Enter or add value but also deal with count grid. More...
 
cvm::real maximum_value () const
 Return the highest value.
 
cvm::real minimum_value () const
 Return the lowest value.
 
cvm::real minimum_pos_value () const
 Return the lowest positive value.
 
cvm::real integral () const
 Calculates the integral of the map (uses widths if they are defined)
 
cvm::real entropy () const
 Assuming that the map is a normalized probability density, calculates the entropy (uses widths if they are defined)
 
cvm::real grid_rmsd (colvar_grid_scalar const &other_grid) const
 Return the RMSD between this grid's data and another one Grids must have the same dimensions.
 
- Public Member Functions inherited from colvar_grid< cvm::real >
size_t address (std::vector< int > const &ix) const
 Get the low-level index corresponding to an index.
 
size_t num_variables () const
 Return the number of colvar objects.
 
std::vector< int > const & number_of_points_vec () const
 Return the numbers of points in all dimensions.
 
size_t number_of_points (int const icv=-1) const
 
std::vector< int > const & sizes () const
 Get the sizes in each direction.
 
void set_sizes (std::vector< int > const &new_sizes)
 Set the sizes in each direction.
 
size_t multiplicity () const
 Return the multiplicity of the type used.
 
void request_actual_value (bool b=true)
 Request grid to use actual values of extended coords.
 
int setup (std::vector< int > const &nx_i, cvm::real const &t=cvm::real(), size_t const &mult_i=1)
 Allocate data.
 
int setup ()
 Allocate data (allow initialization also after construction)
 
void reset (cvm::real const &t=cvm::real())
 Reset data (in case the grid is being reused)
 
 colvar_grid ()
 Default constructor.
 
 colvar_grid (colvar_grid< cvm::real > const &g)
 "Almost copy-constructor": only copies configuration parameters from another grid, but doesn't reallocate stuff; setup() must be called after that;
 
 colvar_grid (std::vector< int > const &nx_i, cvm::real const &t=cvm::real(), size_t mult_i=1)
 Constructor from explicit grid sizes. More...
 
 colvar_grid (std::vector< colvar * > const &colvars, cvm::real const &t=cvm::real(), size_t mult_i=1, bool add_extra_bin=false)
 Constructor from a vector of colvars. More...
 
virtual ~colvar_grid ()
 Destructor.
 
int init_from_colvars (std::vector< colvar * > const &colvars, size_t mult_i=1, bool add_extra_bin=false)
 
int init_from_boundaries ()
 
void wrap (std::vector< int > &ix) const
 
bool wrap_detect_edge (std::vector< int > &ix) const
 
bool wrap_to_edge (std::vector< int > &ix, std::vector< int > &edge_bin) const
 
int current_bin_scalar (int const i) const
 Report the bin corresponding to the current value of variable i.
 
int current_bin_scalar (int const i, int const iv) const
 Report the bin corresponding to the current value of item iv in variable i.
 
int current_bin_flat_bound () const
 Report the flattened bin address corresponding to the current value of all variables and assign first or last bin if out of boundaries.
 
int current_bin_scalar_bound (int const i) const
 Report the bin corresponding to the current value of variable i and assign first or last bin if out of boundaries.
 
int value_to_bin_scalar (colvarvalue const &value, const int i) const
 Use the lower boundary and the width to report which bin the provided value is in.
 
int value_to_bin_scalar (colvarvalue const &value, colvarvalue const &new_offset, cvm::real const &new_width) const
 Same as the standard version, but uses another grid definition.
 
cvm::real current_bin_scalar_fraction (int const i) const
 Report the fraction of bin beyond current_bin_scalar()
 
cvm::real value_to_bin_scalar_fraction (colvarvalue const &value, const int i) const
 Use the lower boundary and the width to report the fraction of bin beyond value_to_bin_scalar() that the provided value is in.
 
int value_to_bin_scalar_bound (colvarvalue const &value, const int i) const
 Use the lower boundary and the width to report which bin the provided value is in and assign first or last bin if out of boundaries.
 
colvarvalue bin_to_value_scalar (int const &i_bin, int const i) const
 Use the two boundaries and the width to report the central value corresponding to a bin index.
 
colvarvalue bin_to_value_scalar (int const &i_bin, colvarvalue const &new_offset, cvm::real const &new_width) const
 Same as the standard version, but uses different parameters.
 
void set_value (std::vector< int > const &ix, cvm::real const &t, size_t const &imult=0)
 Set the value at the point with index ix.
 
void set_value (size_t i, cvm::real const &t)
 Set the value at the point with linear address i (for speed)
 
cvm::real get_value (size_t i) const
 Get the value at the point with linear address i (for speed)
 
void delta_grid (colvar_grid< cvm::real > const &other_grid)
 Get the change from this to other_grid and store the result in this. this_grid := other_grid - this_grid Grids must have the same dimensions.
 
void copy_grid (colvar_grid< cvm::real > const &other_grid)
 Copy data from another grid of the same type, AND identical definition (boundaries, widths) Added for shared ABF.
 
void raw_data_out (cvm::real *out_data) const
 Extract the grid data as they are represented in memory. Put the results in "out_data".
 
void raw_data_out (std::vector< cvm::real > &out_data) const
 
void raw_data_in (const cvm::real *in_data)
 Input the data as they are represented in memory.
 
void raw_data_in (const std::vector< cvm::real > &in_data)
 
size_t raw_data_num () const
 Size of the data as they are represented in memory.
 
cvm::real const & value (std::vector< int > const &ix, size_t const &imult=0) const
 Get the binned value indexed by ix, or the first of them if the multiplicity is larger than 1.
 
cvm::real const & value (size_t i) const
 Get the binned value indexed by linear address i.
 
void add_constant (cvm::real const &t)
 Add a constant to all elements (fast loop)
 
void multiply_constant (cvm::real const &a)
 Multiply all elements by a scalar constant (fast loop)
 
void remove_small_values (cvm::real const &a)
 Assign values that are smaller than scalar constant the latter value (fast loop)
 
std::vector< int > const get_colvars_index (std::vector< colvarvalue > const &values) const
 Get the bin indices corresponding to the provided values of the colvars.
 
std::vector< int > const get_colvars_index () const
 Get the bin indices corresponding to the current values of the colvars.
 
std::vector< int > const get_colvars_index_bound () const
 Get the bin indices corresponding to the provided values of the colvars and assign first or last bin if out of boundaries.
 
cvm::real bin_distance_from_boundaries (std::vector< colvarvalue > const &values, bool skip_hard_boundaries=false)
 Get the minimal distance (in number of bins) from the boundaries; a negative number is returned if the given point is off-grid.
 
void map_grid (colvar_grid< cvm::real > const &other_grid)
 Add data from another grid of the same type. More...
 
void add_grid (colvar_grid< cvm::real > const &other_grid, cvm::real scale_factor=1.0)
 Add data from another grid of the same type, AND identical definition (boundaries, widths)
 
virtual cvm::real value_output (std::vector< int > const &ix, size_t const &imult=0) const
 Return the value suitable for output purposes (so that it may be rescaled or manipulated without changing it permanently) More...
 
virtual void value_input (std::vector< int > const &ix, cvm::real const &t, size_t const &imult=0, bool add=false)
 Get the value from a formatted output and transform it into the internal representation (the two may be different, e.g. when using colvar_grid_count) More...
 
std::vector< int > const new_index () const
 Get the index corresponding to the "first" bin, to be used as the initial value for an index in looping.
 
bool index_ok (std::vector< int > const &ix) const
 Check that the index is within range in each of the dimensions.
 
void incr (std::vector< int > &ix) const
 Increment the index, in a way that will make it loop over the whole nd-dimensional array.
 
std::string get_state_params () const
 Write the current grid parameters to a string.
 
int parse_params (std::string const &conf, colvarparse::Parse_Mode const parse_mode=colvarparse::parse_normal)
 Read new grid parameters from a string.
 
void check_consistency ()
 Check that the grid information inside (boundaries, widths, ...) is consistent with the current setting of the colvars.
 
void check_consistency (colvar_grid< cvm::real > const &other_grid)
 Check that the grid information inside (boundaries, widths, ...) is consistent with that of another grid.
 
std::istream & read_restart (std::istream &is)
 Read all grid parameters and data from a formatted stream.
 
cvm::memory_streamread_restart (cvm::memory_stream &is)
 Read all grid parameters and data from an unformatted stream.
 
std::ostream & write_restart (std::ostream &os)
 Write all grid parameters and data to a formatted stream.
 
cvm::memory_streamwrite_restart (cvm::memory_stream &os)
 Write all grid parameters and data to an unformatted stream.
 
std::istream & read_raw (std::istream &is)
 Read all grid parameters and data from a formatted stream.
 
cvm::memory_streamread_raw (cvm::memory_stream &is)
 Read all grid parameters and data from an unformatted stream.
 
std::ostream & write_raw (std::ostream &os, size_t const buf_size=3) const
 
cvm::memory_streamwrite_raw (cvm::memory_stream &os, size_t const buf_size=3) const
 
std::istream & read_multicol (std::istream &is, bool add=false)
 Read a grid written by write_multicol(), incrementing if add is true.
 
int read_multicol (std::string const &filename, std::string description="grid file", bool add=false)
 Read a grid written by write_multicol(), incrementing if add is true.
 
std::ostream & write_multicol (std::ostream &os) const
 Write grid in a format which is both human-readable and gnuplot-friendly.
 
int write_multicol (std::string const &filename, std::string description="grid file") const
 Write grid in a format which is both human-readable and gnuplot-friendly.
 
std::ostream & write_opendx (std::ostream &os) const
 Write the grid data without labels, as they are represented in memory.
 
int write_opendx (std::string const &filename, std::string description="grid file") const
 Write the grid data without labels, as they are represented in memory.
 
- Public Member Functions inherited from colvarparse
 colvarparse ()
 Default constructor.
 
 colvarparse (const std::string &conf)
 Constructor that stores the object's config string.
 
void clear ()
 Set the object ready to parse a new configuration string.
 
void set_string (std::string const &conf)
 Set a new config string for this object.
 
 ~colvarparse () override
 Default destructor.
 
std::string const & get_config () const
 Get the configuration string (includes comments)
 
int check_keywords (std::string &conf, char const *key)
 Check that all the keywords within "conf" are in the list of allowed keywords; this will invoke strip_values() first and then loop over all words.
 
void clear_keyword_registry ()
 Use this after parsing a config string (note that check_keywords() calls it already)
 
bool get_keyval (std::string const &conf, char const *key, int &value, int const &def_value=0, Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, size_t &value, size_t const &def_value=0, Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, long &value, long const &def_value=0, Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, cvm::step_number &value, cvm::step_number const &def_value=0, Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::string &value, std::string const &def_value=std::string(""), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, cvm::real &value, cvm::real const &def_value=0.0, Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, cvm::rvector &value, cvm::rvector const &def_value=cvm::rvector(), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, cvm::quaternion &value, cvm::quaternion const &def_value=cvm::quaternion(), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, colvarvalue &value, colvarvalue const &def_value=colvarvalue(colvarvalue::type_notset), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, bool &value, bool const &def_value=false, Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< int > &values, std::vector< int > const &def_values=std::vector< int >(0, 0), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< size_t > &values, std::vector< size_t > const &def_values=std::vector< size_t >(0, 0), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< long > &values, std::vector< long > const &def_values=std::vector< long >(0, 0), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< std::string > &values, std::vector< std::string > const &def_values=std::vector< std::string >(0, std::string("")), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< cvm::real > &values, std::vector< cvm::real > const &def_values=std::vector< cvm::real >(0, 0.0), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< cvm::rvector > &values, std::vector< cvm::rvector > const &def_values=std::vector< cvm::rvector >(0, cvm::rvector()), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< cvm::quaternion > &values, std::vector< cvm::quaternion > const &def_values=std::vector< cvm::quaternion >(0, cvm::quaternion()), Parse_Mode const parse_mode=parse_normal)
 
bool get_keyval (std::string const &conf, char const *key, std::vector< colvarvalue > &values, std::vector< colvarvalue > const &def_values=std::vector< colvarvalue >(0, colvarvalue(colvarvalue::type_notset)), Parse_Mode const parse_mode=parse_normal)
 
bool key_lookup (std::string const &conf, char const *key, std::string *data=nullptr, size_t *save_pos=nullptr)
 Low-level function for parsing configuration strings; automatically adds the requested keyword to the list of valid ones. More...
 
std::istream & read_config_line (std::istream &is, std::string &line)
 Reads a configuration line, adds it to config_string, and returns the stream. More...
 
template<>
int _get_keyval_scalar_value_ (std::string const &key_str, std::string const &data, bool &value, bool const &)
 
template<>
int _get_keyval_scalar_novalue_ (std::string const &key_str, bool &value, Parse_Mode const &parse_mode)
 
- Public Member Functions inherited from colvarparams
int param_exists (std::string const &param_name)
 Whether the parameter param_name exists.
 
virtual std::vector< std::string > get_param_names ()
 Get a copy of the names of registered parameters.
 
virtual std::vector< std::string > get_param_grad_names ()
 Get a copy of the names of registered parameter gradients.
 
virtual void const * get_param_ptr (std::string const &param_name)
 Pointer to the parameter param_name.
 
virtual void const * get_param_grad_ptr (std::string const &param_name)
 Pointer to the gradient of parameter param_name.
 
virtual cvm::real get_param (std::string const &param_name)
 Value of the parameter param_name (must be a scalar)
 
virtual int set_param (std::string const &param_name, void const *new_value)
 Set the named parameter to the given value. More...
 

Public Attributes

bool b_smoothed
 Flag requesting the use of a smoothed version of the gradient (default: false)
 
- Public Attributes inherited from colvar_grid_scalar
colvar_grid_countsamples
 Provide the associated sample count by which each binned value should be divided.
 
- Public Attributes inherited from colvar_grid< cvm::real >
size_t nd
 Number of dimensions.
 
std::vector< int > nx
 Number of points along each dimension.
 
std::vector< int > nxc
 Cumulative number of points along each dimension.
 
size_t mult
 Multiplicity of each datum (allow the binning of non-scalar types such as atomic gradients)
 
size_t nt
 Total number of grid points.
 
std::vector< cvm::realdata
 Low-level array of values.
 
std::vector< size_t > new_data
 Newly read data (used for count grids, when adding several grids read from disk)
 
std::vector< colvar * > cv
 Colvars collected in this grid.
 
std::vector< bool > use_actual_value
 Do we request actual value (for extended-system colvars)?
 
std::vector< colvarvaluelower_boundaries
 Lower boundaries of the colvars in this grid.
 
std::vector< colvarvalueupper_boundaries
 Upper boundaries of the colvars in this grid.
 
std::vector< bool > periodic
 Whether some colvars are periodic.
 
std::vector< bool > hard_lower_boundaries
 Whether some colvars have hard lower boundaries.
 
std::vector< bool > hard_upper_boundaries
 Whether some colvars have hard upper boundaries.
 
std::vector< cvm::realwidths
 Widths of the colvars in this grid.
 
bool has_parent_data
 True if this is a count grid related to another grid of data.
 
bool has_data
 Whether this grid has been filled with data or is still empty.
 

Protected Member Functions

void get_grad (cvm::real *g, std::vector< int > &ix)
 
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)
 Solve linear system based on CG, valid for symmetric matrices only.
 
cvm::real l2norm (const std::vector< cvm::real > &x)
 l2 norm of a vector
 
void atimes (const std::vector< cvm::real > &x, std::vector< cvm::real > &r)
 Multiplication by sparse matrix representing Lagrangian (or its transpose) More...
 
- Protected Member Functions inherited from colvarparse
bool get_key_string_value (std::string const &conf, char const *key, std::string &data)
 Get the string value of a keyword, and save it for later parsing.
 
bool get_key_string_multi_value (std::string const &conf, char const *key, std::vector< std::string > &data)
 Get multiple strings from repeated instances of a same keyword.
 
template<typename TYPE >
bool _get_keyval_scalar_ (std::string const &conf, char const *key, TYPE &value, TYPE const &def_value, Parse_Mode const &parse_mode)
 Template for single-value keyword parsers.
 
template<typename TYPE >
bool _get_keyval_vector_ (std::string const &conf, char const *key, std::vector< TYPE > &values, std::vector< TYPE > const &def_values, Parse_Mode const &parse_mode)
 Template for multiple-value keyword parsers.
 
template<typename TYPE >
int _get_keyval_scalar_value_ (std::string const &key_str, std::string const &data, TYPE &value, TYPE const &def_value)
 Extract the value of a variable from a string.
 
template<typename TYPE >
int _get_keyval_scalar_novalue_ (std::string const &key_str, TYPE &value, Parse_Mode const &parse_mode)
 Handle the case where the user provides a keyword without value.
 
template<typename TYPE >
void mark_key_set_user (std::string const &key_str, TYPE const &value, Parse_Mode const &parse_mode)
 Record that the keyword has just been user-defined.
 
template<typename TYPE >
void mark_key_set_default (std::string const &key_str, TYPE const &def_value, Parse_Mode const &parse_mode)
 Record that the keyword has just been set to its default value.
 
void error_key_required (std::string const &key_str, Parse_Mode const &parse_mode)
 Raise error condition due to the keyword being required!
 
bool key_already_set (std::string const &key_str)
 True if the keyword has been set already.
 
void add_keyword (char const *key)
 Add a new valid keyword to the list.
 
void strip_values (std::string &conf)
 Remove all the values from the config string.
 
- Protected Member Functions inherited from colvarparams
 colvarparams ()
 Default constructor.
 
virtual ~colvarparams ()
 Default destructor.
 
void register_param (std::string const &param_name, void *param_ptr)
 Register the given parameter.
 
void register_param_grad (std::string const &param_name, colvarvalue *param_grad_ptr)
 Register the gradient of the given parameter.
 

Protected Attributes

std::shared_ptr< colvar_grid_gradientgradients
 
std::vector< cvm::realdivergence
 Array holding divergence + boundary terms (modified Neumann) if not periodic.
 
- Protected Attributes inherited from colvarparse
std::string const keyword_delimiters_left
 Characters allowed immediately to the left of a kewyord.
 
std::string const keyword_delimiters_right
 Characters allowed immediately to the right of a kewyord.
 
std::list< std::string > allowed_keywords
 List of legal keywords for this object: this is updated by each call to colvarparse::get_keyval() or colvarparse::key_lookup()
 
std::map< std::string, key_set_modekey_set_modes
 Track which keywords have been already set, and how.
 
std::list< size_t > data_begin_pos
 List of delimiters for the values of each keyword in the configuration string; all keywords will be stripped of their values before the keyword check is performed.
 
std::list< size_t > data_end_pos
 List of delimiters for the values of each keyword in the configuration string; all keywords will be stripped of their values before the keyword check is performed.
 
std::string config_string
 Configuration string of the object (includes comments)
 
- Protected Attributes inherited from colvarparams
std::map< std::string, void const * > param_map
 Pointers to relevant parameters that may be accessed by other objects.
 
std::map< std::string, colvarvalue const * > param_grad_map
 Derivatives of the object with respect to internal parameters.
 

Additional Inherited Members

- Public Types inherited from colvarparse
enum  Parse_Mode {
  parse_null = 0 , parse_echo = (1<<1) , parse_echo_default = (1<<2) , parse_deprecation_warning = (1<<3) ,
  parse_silent = 0 , parse_required = (1<<16) , parse_override = (1<<17) , parse_restart = (1<<18) ,
  parse_normal = (1<<1) | (1<<2) | (1<<17) , parse_deprecated = (1<<1) | (1<<3) | (1<<17)
}
 How a keyword is parsed in a string. More...
 
- Static Public Member Functions inherited from colvarparse
static std::string to_lower_cppstr (std::string const &in)
 Return a lowercased copy of the string.
 
static std::istream & getline_nocomments (std::istream &is, std::string &s)
 Works as std::getline() but also removes everything between a comment character and the following newline.
 
static int check_braces (std::string const &conf, size_t const start_pos)
 Check if the content of a config string has matching braces. More...
 
static int check_ascii (std::string const &conf)
 Check that a config string contains non-ASCII characters. More...
 
static void split_string (const std::string &data, const std::string &delim, std::vector< std::string > &dest)
 Split a string with a specified delimiter into a vector. More...
 
- Static Public Attributes inherited from colvarparse
static const char *const white_space = " \t"
 Accepted white space delimiters, used in key_lookup()
 
- Protected Types inherited from colvarparse
enum  key_set_mode { key_not_set = 0 , key_set_user = 1 , key_set_default = 2 }
 How a keyword has been set.
 

Detailed Description

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

Member Function Documentation

◆ atimes()

void integrate_potential::atimes ( const std::vector< cvm::real > &  A,
std::vector< cvm::real > &  LA 
)
protected

Multiplication by sparse matrix representing Lagrangian (or its transpose)

Multiplication by sparse matrix representing Laplacian NOTE: Laplacian must be symmetric for solving with CG

◆ get_grad()

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


The documentation for this class was generated from the following files: