Collective Variables Module - Developer Documentation
Loading...
Searching...
No Matches
colvarbias_histogram.h
1// -*- c++ -*-
2
3// This file is part of the Collective Variables module (Colvars).
4// The original version of Colvars and its updates are located at:
5// https://github.com/Colvars/colvars
6// Please update all Colvars source files before making any changes.
7// If you wish to distribute your changes, please submit them to the
8// Colvars repository at GitHub.
9
10#ifndef COLVARBIAS_HISTOGRAM_H
11#define COLVARBIAS_HISTOGRAM_H
12
13#include <vector>
14#include <list>
15#include <sstream>
16#include <iomanip>
17
18#include "colvarbias.h"
19#include "colvargrid.h"
20
23
24public:
25
26 colvarbias_histogram(char const *key);
27 virtual ~colvarbias_histogram();
28 virtual int init(std::string const &conf);
29 virtual int update();
30 virtual int write_output_files();
31
32 virtual std::ostream & write_state_data(std::ostream &os);
34 virtual std::istream & read_state_data(std::istream &is);
36
37protected:
38
41 std::vector<int> bin;
42 std::string out_name, out_name_dx;
43
47 std::vector<cvm::real> weights;
48};
49
50#endif
Class for accumulating a scalar function on a grid.
Definition: colvargrid.h:1242
Histogram "bias" (does as the name says)
Definition: colvarbias_histogram.h:22
size_t colvar_array_size
If one or more of the variables are colvarvalue::type_vector, treat them as arrays of this length.
Definition: colvarbias_histogram.h:45
virtual int update()
Definition: colvarbias_histogram.cpp:121
virtual std::istream & read_state_data(std::istream &is)
Read all mutable data not already set by set_state_params() from a formatted stream.
Definition: colvarbias_histogram.cpp:198
virtual int init(std::string const &conf)
Parse config string and (re)initialize.
Definition: colvarbias_histogram.cpp:27
virtual int write_output_files()
Write any output files that this bias may have (e.g. PMF files)
Definition: colvarbias_histogram.cpp:165
virtual std::ostream & write_state_data(std::ostream &os)
Write all mutable data not already written by get_state_params() to a formatted stream.
Definition: colvarbias_histogram.cpp:216
std::vector< cvm::real > weights
If colvar_array_size is larger than 1, weigh each one by this number before accumulating the histogra...
Definition: colvarbias_histogram.h:47
colvar_grid_scalar * grid
n-dim histogram
Definition: colvarbias_histogram.h:40
Collective variable bias, base class.
Definition: colvarbias.h:23
Definition: colvars_memstream.h:30