Files
lammps/lib/colvars/colvarcomp_volmaps.cpp
Giacomo Fiorin 85c394453c Update Colvars to version 2020-07-07
This update contains several fixes and small new features or usability
improvements.  Descriptions and authorship information can be accessed from
the pull requests listed below.

Skip the zero-step also when multiple run commands are executed in sequence (@giacomofiorin)
https://github.com/Colvars/colvars/pull/357

Do not accumulate data at step 0 (@giacomofiorin)
https://github.com/Colvars/colvars/pull/345

Support for symmetry permutations of atoms in RMSD (@jhenin)
https://github.com/Colvars/colvars/pull/344

Detect new grid parameters (@jhenin)
https://github.com/Colvars/colvars/pull/341

Only access the output streams in non-threaded regions (@giacomofiorin)
https://github.com/Colvars/colvars/pull/338

Fix incomplete setting of default colvarsRestartFrequency (@giacomofiorin)
https://github.com/Colvars/colvars/pull/334

Fix typo (@e-kwsm)
https://github.com/Colvars/colvars/pull/333

Convert the input keyword to lowercase in read_state_data_key (@HanatoK)
https://github.com/Colvars/colvars/pull/332

Implement reflecting b.c. for ext Lagrangian (@jhenin)
https://github.com/Colvars/colvars/pull/329
2020-09-09 18:19:21 -04:00

61 lines
1.4 KiB
C++

// -*- c++ -*-
// This file is part of the Collective Variables module (Colvars).
// The original version of Colvars and its updates are located at:
// https://github.com/Colvars/colvars
// Please update all Colvars source files before making any changes.
// If you wish to distribute your changes, please submit them to the
// Colvars repository at GitHub.
#include "colvarmodule.h"
#include "colvarvalue.h"
#include "colvarparse.h"
#include "colvar.h"
#include "colvarcomp.h"
colvar::map_total::map_total()
: cvc(), volmap_index(-1)
{
function_type = "map_total";
x.type(colvarvalue::type_scalar);
}
colvar::map_total::map_total(std::string const &conf)
: cvc(), volmap_index(-1)
{
function_type = "map_total";
x.type(colvarvalue::type_scalar);
map_total::init(conf);
}
int colvar::map_total::init(std::string const &conf)
{
int error_code = cvc::init(conf);
get_keyval(conf, "mapName", map_name, map_name);
volmap_index = (cvm::proxy)->init_volmap(map_name);
error_code |= volmap_index > 0 ? COLVARS_OK : INPUT_ERROR;
return error_code;
}
void colvar::map_total::calc_value()
{
x.real_value = (cvm::proxy)->get_volmap_value(volmap_index);
}
void colvar::map_total::calc_gradients()
{
// Atomic coordinates are not available here
}
void colvar::map_total::apply_force(colvarvalue const &force)
{
(cvm::proxy)->apply_volmap_force(volmap_index, force.real_value);
}