git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11969 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -591,11 +591,12 @@ void colvar::enable (colvar::task const &t)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case task_output_value:
|
case task_output_value:
|
||||||
case task_runave:
|
case task_runave:
|
||||||
case task_corrfunc:
|
case task_corrfunc:
|
||||||
case task_ntot:
|
case task_ntot:
|
||||||
|
case task_langevin:
|
||||||
|
case task_output_energy:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case task_gradients:
|
case task_gradients:
|
||||||
@ -612,6 +613,7 @@ void colvar::enable (colvar::task const &t)
|
|||||||
build_atom_list();
|
build_atom_list();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -660,6 +662,9 @@ void colvar::disable (colvar::task const &t)
|
|||||||
case task_lower_wall:
|
case task_lower_wall:
|
||||||
case task_upper_wall:
|
case task_upper_wall:
|
||||||
case task_ntot:
|
case task_ntot:
|
||||||
|
case task_langevin:
|
||||||
|
case task_output_energy:
|
||||||
|
case task_collect_gradients:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,8 @@
|
|||||||
cvm::atom_group::atom_group (std::string const &conf,
|
cvm::atom_group::atom_group (std::string const &conf,
|
||||||
char const *key)
|
char const *key)
|
||||||
: b_center (false), b_rotate (false), b_user_defined_fit (false),
|
: b_center (false), b_rotate (false), b_user_defined_fit (false),
|
||||||
ref_pos_group (NULL),
|
|
||||||
b_fit_gradients (false),
|
b_fit_gradients (false),
|
||||||
|
ref_pos_group (NULL),
|
||||||
noforce (false)
|
noforce (false)
|
||||||
{
|
{
|
||||||
cvm::log ("Defining atom group \""+
|
cvm::log ("Defining atom group \""+
|
||||||
@ -27,7 +27,7 @@ cvm::atom_group::atom_group (std::string const &conf,
|
|||||||
|
|
||||||
cvm::atom_group::atom_group (std::vector<cvm::atom> const &atoms)
|
cvm::atom_group::atom_group (std::vector<cvm::atom> const &atoms)
|
||||||
: b_dummy (false), b_center (false), b_rotate (false),
|
: b_dummy (false), b_center (false), b_rotate (false),
|
||||||
ref_pos_group (NULL), b_fit_gradients (false),
|
b_fit_gradients (false), ref_pos_group (NULL),
|
||||||
noforce (false)
|
noforce (false)
|
||||||
{
|
{
|
||||||
this->reserve (atoms.size());
|
this->reserve (atoms.size());
|
||||||
@ -44,7 +44,7 @@ cvm::atom_group::atom_group (std::vector<cvm::atom> const &atoms)
|
|||||||
|
|
||||||
cvm::atom_group::atom_group()
|
cvm::atom_group::atom_group()
|
||||||
: b_dummy (false), b_center (false), b_rotate (false),
|
: b_dummy (false), b_center (false), b_rotate (false),
|
||||||
ref_pos_group (NULL), b_fit_gradients (false),
|
b_fit_gradients (false), ref_pos_group (NULL),
|
||||||
noforce (false)
|
noforce (false)
|
||||||
{
|
{
|
||||||
total_mass = 0.0;
|
total_mass = 0.0;
|
||||||
|
|||||||
@ -121,8 +121,8 @@ std::ostream & colvarbias::write_traj (std::ostream &os)
|
|||||||
colvarbias_harmonic::colvarbias_harmonic (std::string const &conf,
|
colvarbias_harmonic::colvarbias_harmonic (std::string const &conf,
|
||||||
char const *key)
|
char const *key)
|
||||||
: colvarbias (conf, key),
|
: colvarbias (conf, key),
|
||||||
target_nsteps (0),
|
target_nstages (0),
|
||||||
target_nstages (0)
|
target_nsteps (0)
|
||||||
{
|
{
|
||||||
get_keyval (conf, "forceConstant", force_k, 1.0);
|
get_keyval (conf, "forceConstant", force_k, 1.0);
|
||||||
for (size_t i = 0; i < colvars.size(); i++) {
|
for (size_t i = 0; i < colvars.size(); i++) {
|
||||||
|
|||||||
@ -25,16 +25,16 @@
|
|||||||
|
|
||||||
colvarbias_meta::colvarbias_meta()
|
colvarbias_meta::colvarbias_meta()
|
||||||
: colvarbias(),
|
: colvarbias(),
|
||||||
state_file_step (0),
|
new_hills_begin (hills.end()),
|
||||||
new_hills_begin (hills.end())
|
state_file_step (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
colvarbias_meta::colvarbias_meta (std::string const &conf, char const *key)
|
colvarbias_meta::colvarbias_meta (std::string const &conf, char const *key)
|
||||||
: colvarbias (conf, key),
|
: colvarbias (conf, key),
|
||||||
state_file_step (0),
|
new_hills_begin (hills.end()),
|
||||||
new_hills_begin (hills.end())
|
state_file_step (0)
|
||||||
{
|
{
|
||||||
if (cvm::n_abf_biases > 0)
|
if (cvm::n_abf_biases > 0)
|
||||||
cvm::log ("Warning: running ABF and metadynamics together is not recommended unless applyBias is off for ABF.\n");
|
cvm::log ("Warning: running ABF and metadynamics together is not recommended unless applyBias is off for ABF.\n");
|
||||||
|
|||||||
@ -8,18 +8,18 @@
|
|||||||
colvar::cvc::cvc()
|
colvar::cvc::cvc()
|
||||||
: sup_coeff (1.0), sup_np (1),
|
: sup_coeff (1.0), sup_np (1),
|
||||||
b_periodic (false),
|
b_periodic (false),
|
||||||
b_debug_gradients (false),
|
|
||||||
b_inverse_gradients (false),
|
b_inverse_gradients (false),
|
||||||
b_Jacobian_derivative (false)
|
b_Jacobian_derivative (false),
|
||||||
|
b_debug_gradients (false)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
colvar::cvc::cvc (std::string const &conf)
|
colvar::cvc::cvc (std::string const &conf)
|
||||||
: sup_coeff (1.0), sup_np (1),
|
: sup_coeff (1.0), sup_np (1),
|
||||||
b_periodic (false),
|
b_periodic (false),
|
||||||
b_debug_gradients (false),
|
|
||||||
b_inverse_gradients (false),
|
b_inverse_gradients (false),
|
||||||
b_Jacobian_derivative (false)
|
b_Jacobian_derivative (false),
|
||||||
|
b_debug_gradients (false)
|
||||||
{
|
{
|
||||||
if (cvm::debug())
|
if (cvm::debug())
|
||||||
cvm::log ("Initializing cvc base object.\n");
|
cvm::log ("Initializing cvc base object.\n");
|
||||||
|
|||||||
@ -173,19 +173,19 @@ public:
|
|||||||
/// \brief "Almost copy-constructor": only copies configuration
|
/// \brief "Almost copy-constructor": only copies configuration
|
||||||
/// parameters from another grid, but doesn't reallocate stuff;
|
/// parameters from another grid, but doesn't reallocate stuff;
|
||||||
/// create() must be called after that;
|
/// create() must be called after that;
|
||||||
colvar_grid (colvar_grid<T> const &g) : has_data (false),
|
colvar_grid (colvar_grid<T> const &g) : nd (g.nd),
|
||||||
nd (g.nd),
|
|
||||||
nx (g.nx),
|
nx (g.nx),
|
||||||
mult (g.mult),
|
mult (g.mult),
|
||||||
|
data(),
|
||||||
cv (g.cv),
|
cv (g.cv),
|
||||||
|
actual_value (g.actual_value),
|
||||||
lower_boundaries (g.lower_boundaries),
|
lower_boundaries (g.lower_boundaries),
|
||||||
upper_boundaries (g.upper_boundaries),
|
upper_boundaries (g.upper_boundaries),
|
||||||
|
periodic (g.periodic),
|
||||||
hard_lower_boundaries (g.hard_lower_boundaries),
|
hard_lower_boundaries (g.hard_lower_boundaries),
|
||||||
hard_upper_boundaries (g.hard_upper_boundaries),
|
hard_upper_boundaries (g.hard_upper_boundaries),
|
||||||
periodic (g.periodic),
|
|
||||||
widths (g.widths),
|
widths (g.widths),
|
||||||
actual_value (g.actual_value),
|
has_data (false)
|
||||||
data()
|
|
||||||
{
|
{
|
||||||
save_delimiters = false;
|
save_delimiters = false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -815,6 +815,41 @@ void cvm::read_index_file (char const *filename)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void cvm::load_atoms (char const *file_name,
|
||||||
|
std::vector<cvm::atom> &atoms,
|
||||||
|
std::string const &pdb_field,
|
||||||
|
double const pdb_field_value)
|
||||||
|
{
|
||||||
|
proxy->load_atoms (file_name, atoms, pdb_field, pdb_field_value);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cvm::load_coords (char const *file_name,
|
||||||
|
std::vector<cvm::atom_pos> &pos,
|
||||||
|
const std::vector<int> &indices,
|
||||||
|
std::string const &pdb_field,
|
||||||
|
double const pdb_field_value)
|
||||||
|
{
|
||||||
|
// Differentiate between PDB and XYZ files
|
||||||
|
// for XYZ files, use CVM internal parser
|
||||||
|
// otherwise call proxy function for PDB
|
||||||
|
|
||||||
|
std::string const ext (strlen(file_name) > 4 ? (file_name + (strlen(file_name) - 4)) : file_name);
|
||||||
|
if (colvarparse::to_lower_cppstr (ext) == std::string (".xyz")) {
|
||||||
|
if ( pdb_field.size() > 0 ) {
|
||||||
|
cvm::fatal_error ("Error: PDB column may not be specified for XYZ coordinate file.\n");
|
||||||
|
}
|
||||||
|
cvm::load_coords_xyz (file_name, pos, indices);
|
||||||
|
} else {
|
||||||
|
proxy->load_coords (file_name, pos, indices, pdb_field, pdb_field_value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void cvm::backup_file (char const *filename)
|
||||||
|
{
|
||||||
|
proxy->backup_file (filename);
|
||||||
|
}
|
||||||
|
|
||||||
void cvm::load_coords_xyz (char const *filename,
|
void cvm::load_coords_xyz (char const *filename,
|
||||||
std::vector<atom_pos> &pos,
|
std::vector<atom_pos> &pos,
|
||||||
const std::vector<int> &indices)
|
const std::vector<int> &indices)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define COLVARMODULE_H
|
#define COLVARMODULE_H
|
||||||
|
|
||||||
#ifndef COLVARS_VERSION
|
#ifndef COLVARS_VERSION
|
||||||
#define COLVARS_VERSION "2013-12-13"
|
#define COLVARS_VERSION "2014-05-08"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef COLVARS_DEBUG
|
#ifndef COLVARS_DEBUG
|
||||||
@ -483,40 +483,6 @@ inline cvm::real cvm::position_dist2 (cvm::atom_pos const &pos1,
|
|||||||
return proxy->position_dist2 (pos1, pos2);
|
return proxy->position_dist2 (pos1, pos2);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void cvm::load_atoms (char const *file_name,
|
|
||||||
std::vector<cvm::atom> &atoms,
|
|
||||||
std::string const &pdb_field,
|
|
||||||
double const pdb_field_value)
|
|
||||||
{
|
|
||||||
proxy->load_atoms (file_name, atoms, pdb_field, pdb_field_value);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void cvm::load_coords (char const *file_name,
|
|
||||||
std::vector<cvm::atom_pos> &pos,
|
|
||||||
const std::vector<int> &indices,
|
|
||||||
std::string const &pdb_field,
|
|
||||||
double const pdb_field_value)
|
|
||||||
{
|
|
||||||
// Differentiate between PDB and XYZ files
|
|
||||||
// for XYZ files, use CVM internal parser
|
|
||||||
// otherwise call proxy function for PDB
|
|
||||||
|
|
||||||
char const *ext = strlen(file_name) > 4 ? file_name + (strlen(file_name) - 4) : file_name;
|
|
||||||
if ( !strncmp(ext, ".xyz", 4) || !strncmp(ext, ".XYZ", 4) ) {
|
|
||||||
if ( pdb_field.size() > 0 ) {
|
|
||||||
cvm::fatal_error ("Error: PDB column may not be specified for XYZ coordinate file.\n");
|
|
||||||
}
|
|
||||||
cvm::load_coords_xyz (file_name, pos, indices);
|
|
||||||
} else {
|
|
||||||
proxy->load_coords (file_name, pos, indices, pdb_field, pdb_field_value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void cvm::backup_file (char const *filename)
|
|
||||||
{
|
|
||||||
proxy->backup_file (filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline cvm::real cvm::rand_gaussian (void)
|
inline cvm::real cvm::rand_gaussian (void)
|
||||||
{
|
{
|
||||||
return proxy->rand_gaussian();
|
return proxy->rand_gaussian();
|
||||||
|
|||||||
@ -595,7 +595,7 @@ std::istream & operator>> (std::istream &is, colvarparse::read_block const &rb)
|
|||||||
size_t brace_count = 1;
|
size_t brace_count = 1;
|
||||||
std::string line;
|
std::string line;
|
||||||
while (colvarparse::getline_nocomments (is, line)) {
|
while (colvarparse::getline_nocomments (is, line)) {
|
||||||
size_t br = 0, br_old;
|
size_t br = 0, br_old = 0;
|
||||||
while ( (br = line.find_first_of ("{}", br)) != std::string::npos) {
|
while ( (br = line.find_first_of ("{}", br)) != std::string::npos) {
|
||||||
if (line[br] == '{') brace_count++;
|
if (line[br] == '{') brace_count++;
|
||||||
if (line[br] == '}') brace_count--;
|
if (line[br] == '}') brace_count--;
|
||||||
|
|||||||
Reference in New Issue
Block a user