NAMD
|
Communication between colvars and NAMD (implementation of colvarproxy) More...
#include <colvarproxy_namd.h>
Public Member Functions | |
colvarproxy_namd () | |
~colvarproxy_namd () | |
int | setup () |
int | reset () |
int | update_atoms_map (AtomIDList::const_iterator begin, AtomIDList::const_iterator end) |
void | calculate () |
void | log (std::string const &message) |
void | error (std::string const &message) |
int | set_unit_system (std::string const &units_in, bool check_only) |
void | exit (std::string const &message) |
void | add_energy (cvm::real energy) |
void | request_total_force (bool yesno) |
bool | total_forces_enabled () const |
int | run_force_callback () |
int | run_colvar_callback (std::string const &name, std::vector< const colvarvalue * > const &cvcs, colvarvalue &value) |
int | run_colvar_gradient_callback (std::string const &name, std::vector< const colvarvalue * > const &cvcs, std::vector< cvm::matrix2d< cvm::real > > &gradient) |
cvm::real | backend_angstrom_value () |
cvm::real | boltzmann () |
cvm::real | temperature () |
cvm::real | rand_gaussian () |
cvm::real | dt () |
virtual int | replica_enabled () |
virtual int | replica_index () |
virtual int | num_replicas () |
virtual void | replica_comm_barrier () |
virtual int | replica_comm_recv (char *msg_data, int buf_len, int src_rep) |
virtual int | replica_comm_send (char *msg_data, int msg_len, int dest_rep) |
int | init_atom (int atom_number) |
int | check_atom_id (int atom_number) |
int | init_atom (cvm::residue_id const &residue, std::string const &atom_name, std::string const &segment_id) |
int | check_atom_id (cvm::residue_id const &residue, std::string const &atom_name, std::string const &segment_id) |
void | clear_atom (int index) |
void | update_atom_properties (int index) |
cvm::rvector | position_distance (cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const |
int | load_atoms (char const *filename, cvm::atom_group &atoms, std::string const &pdb_field, double const pdb_field_value=0.0) |
int | load_coords (char const *filename, std::vector< cvm::atom_pos > &pos, const std::vector< int > &indices, std::string const &pdb_field, double const pdb_field_value=0.0) |
int | scalable_group_coms () |
int | init_atom_group (std::vector< int > const &atoms_ids) |
void | clear_atom_group (int index) |
int | update_group_properties (int index) |
int | init_volmap (int volmap_id) |
int | init_volmap (const char *volmap_name) |
void | clear_volmap (int index) |
std::ostream * | output_stream (std::string const &output_name, std::ios_base::openmode mode) |
int | flush_output_stream (std::ostream *os) |
int | close_output_stream (std::string const &output_name) |
int | backup_file (char const *filename) |
char const * | script_obj_to_str (unsigned char *obj) |
std::vector< std::string > | script_obj_to_str_vector (unsigned char *obj) |
![]() | |
void | processData (AtomIDList::iterator a_i, AtomIDList::iterator a_e, PositionList::iterator p_i, PositionList::iterator g_i, PositionList::iterator g_e, BigRealList::iterator gm_i, BigRealList::iterator gm_e, ForceList::iterator gtf_i, ForceList::iterator gtf_e, IntList::iterator goi_i, IntList::iterator goi_e, BigRealList::iterator gov_i, BigRealList::iterator gov_e, AtomIDList::iterator last_atoms_forced_i, AtomIDList::iterator last_atoms_forced_e, ForceList::iterator last_forces_i, AtomIDList::iterator, AtomIDList::iterator, ForceList::iterator) |
bool | changedAtoms () |
const AtomIDList & | requestedAtoms () |
bool | changedForces () |
const AtomIDList & | forcedAtoms () |
const ForceList & | appliedForces () |
bool | changedGroups () |
const ResizeArray< AtomIDList > & | requestedGroups () |
const ForceList & | groupForces () |
bool | changedGridObjs () |
const IntList & | requestedGridObjs () |
const BigRealList & | gridObjForces () |
bool | requestedTotalForces () |
void | clearChanged () |
virtual | ~GlobalMaster () |
void | check () const |
void | setLattice (const Lattice *lat) |
Friends | |
class | cvm::atom |
Additional Inherited Members | |
![]() | |
int | step |
int | old_num_groups_requested |
Communication between colvars and NAMD (implementation of colvarproxy)
Definition at line 34 of file colvarproxy_namd.h.
colvarproxy_namd::colvarproxy_namd | ( | ) |
Definition at line 38 of file colvarproxy_namd.C.
References COLVARPROXY_VERSION, Node::colvars, Node::configList, StringList::data, debug, endi(), error(), ConfigList::find(), first_timestep, SimParameters::firstTimestep, init_tcl_pointers(), iout, SimParameters::langevinOn, SimParameters::langevinTemp, SimParameters::loweAndersenOn, SimParameters::loweAndersenTemp, Node::Object(), ReductionMgr::Object(), SimParameters::outputFilename, random, SimParameters::randomSeed, SimParameters::reassignFreq, SimParameters::reassignTemp, reduction, REDUCTIONS_BASIC, GlobalMaster::requestTotalForce(), SimParameters::rescaleFreq, SimParameters::rescaleTemp, SimParameters::restartFilename, SimParameters::restartFrequency, Node::simParameters, simparams, SimParameters::stochRescaleOn, SimParameters::stochRescaleTemp, SimParameters::tCoupleOn, SimParameters::tCoupleTemp, thermostat_temperature, and ReductionMgr::willSubmit().
colvarproxy_namd::~colvarproxy_namd | ( | ) |
Definition at line 151 of file colvarproxy_namd.C.
References reduction.
void colvarproxy_namd::add_energy | ( | cvm::real | energy | ) |
Definition at line 596 of file colvarproxy_namd.C.
References SubmitReduction::item(), reduction, and REDUCTION_MISC_ENERGY.
|
inline |
Definition at line 95 of file colvarproxy_namd.h.
int colvarproxy_namd::backup_file | ( | char const * | filename | ) |
Definition at line 1076 of file colvarproxy_namd.C.
References NAMD_backup_file().
|
inline |
Definition at line 100 of file colvarproxy_namd.h.
|
virtual |
Reimplemented from GlobalMaster.
Definition at line 278 of file colvarproxy_namd.C.
References Lattice::a(), Lattice::a_p(), ResizeArray< T >::add(), atoms_map, Lattice::b(), Lattice::b_p(), ResizeArray< T >::begin(), Lattice::c(), Lattice::c_p(), ResizeArray< T >::clear(), debug, ResizeArray< T >::end(), first_timestep, GlobalMaster::getAtomIdBegin(), GlobalMaster::getAtomIdEnd(), GlobalMaster::getAtomPositionBegin(), GlobalMaster::getForceIdBegin(), GlobalMaster::getForceIdEnd(), GlobalMaster::getGridObjIndexBegin(), GlobalMaster::getGridObjIndexEnd(), GlobalMaster::getGridObjValueBegin(), GlobalMaster::getGridObjValueEnd(), GlobalMaster::getGroupPositionBegin(), GlobalMaster::getGroupPositionEnd(), GlobalMaster::getGroupTotalForceBegin(), GlobalMaster::getGroupTotalForceEnd(), GlobalMaster::getTotalForce(), GlobalMaster::lattice, log(), GlobalMaster::modifyAppliedForces(), GlobalMaster::modifyForcedAtoms(), GlobalMaster::modifyGridObjForces(), GlobalMaster::modifyGroupForces(), Node::molecule, SimParameters::N, Molecule::numAtoms, Node::Object(), Lattice::orthogonal(), previous_NAMD_step, reduction, GlobalMaster::requestedGridObjs(), GlobalMaster::requestedGroups(), ResizeArray< T >::resize(), Vector::set(), ResizeArray< T >::setall(), setup(), simparams, GlobalMaster::step, SubmitReduction::submit(), update_atoms_map(), Vector::x, Vector::y, and Vector::z.
int colvarproxy_namd::check_atom_id | ( | int | atom_number | ) |
Definition at line 652 of file colvarproxy_namd.C.
References debug, Node::molecule, Molecule::numAtoms, and Node::Object().
Referenced by init_atom().
int colvarproxy_namd::check_atom_id | ( | cvm::residue_id const & | residue, |
std::string const & | atom_name, | ||
std::string const & | segment_id | ||
) |
Definition at line 698 of file colvarproxy_namd.C.
References Molecule::get_atom_from_name(), Node::molecule, and Node::Object().
void colvarproxy_namd::clear_atom | ( | int | index | ) |
Definition at line 759 of file colvarproxy_namd.C.
void colvarproxy_namd::clear_atom_group | ( | int | index | ) |
Definition at line 1194 of file colvarproxy_namd.C.
void colvarproxy_namd::clear_volmap | ( | int | index | ) |
Definition at line 1290 of file colvarproxy_namd.C.
int colvarproxy_namd::close_output_stream | ( | std::string const & | output_name | ) |
Definition at line 1057 of file colvarproxy_namd.C.
|
inline |
Definition at line 115 of file colvarproxy_namd.h.
References SimParameters::dt, and simparams.
Referenced by Sequencer::addForceToMomentum(), Sequencer::addMovDragToPosition(), Sequencer::addRotDragToPosition(), Sequencer::addVelocityToPosition(), Sequencer::langevinVelocities(), Sequencer::langevinVelocitiesBBK1(), Sequencer::langevinVelocitiesBBK2(), Sequencer::maximumMove(), and Sequencer::tcoupleVelocities().
void colvarproxy_namd::error | ( | std::string const & | message | ) |
Definition at line 624 of file colvarproxy_namd.C.
References log(), NAMD_die(), and NAMD_err().
Referenced by colvarproxy_namd().
void colvarproxy_namd::exit | ( | std::string const & | message | ) |
int colvarproxy_namd::flush_output_stream | ( | std::ostream * | os | ) |
Definition at line 1043 of file colvarproxy_namd.C.
int colvarproxy_namd::init_atom | ( | int | atom_number | ) |
Definition at line 671 of file colvarproxy_namd.C.
References ResizeArray< T >::add(), check_atom_id(), GlobalMaster::modifyRequestedAtoms(), and update_atom_properties().
int colvarproxy_namd::init_atom | ( | cvm::residue_id const & | residue, |
std::string const & | atom_name, | ||
std::string const & | segment_id | ||
) |
For AMBER topologies, the segment id is automatically set to "MAIN" (the segment id assigned by NAMD's AMBER topology parser), and is therefore optional when an AMBER topology is used
Definition at line 731 of file colvarproxy_namd.C.
References ResizeArray< T >::add(), check_atom_id(), debug, GlobalMaster::modifyRequestedAtoms(), and update_atom_properties().
int colvarproxy_namd::init_atom_group | ( | std::vector< int > const & | atoms_ids | ) |
Definition at line 1124 of file colvarproxy_namd.C.
References debug, GlobalMaster::modifyGroupForces(), GlobalMaster::modifyRequestedGroups(), Node::molecule, Molecule::numAtoms, Node::Object(), ResizeArray< T >::resize(), ResizeArray< T >::size(), and update_group_properties().
|
protected |
Definition at line 565 of file colvarproxy_namd.C.
References Node::getScript(), and Node::Object().
Referenced by colvarproxy_namd().
int colvarproxy_namd::init_volmap | ( | int | volmap_id | ) |
Definition at line 1240 of file colvarproxy_namd.C.
References ResizeArray< T >::add(), GlobalMaster::modifyRequestedGridObjects(), Node::molecule, Molecule::numGridforceGrids, and Node::Object().
Referenced by init_volmap().
int colvarproxy_namd::init_volmap | ( | const char * | volmap_name | ) |
Definition at line 1264 of file colvarproxy_namd.C.
References Molecule::get_gridfrc_grid(), GridforceGrid::get_scale(), MGridforceParamsList::index_for_key(), init_volmap(), SimParameters::mgridforcelist, Node::molecule, Node::Object(), simparams, Vector::x, Vector::y, and Vector::z.
int colvarproxy_namd::load_atoms | ( | char const * | filename, |
cvm::atom_group & | atoms, | ||
std::string const & | pdb_field, | ||
double const | pdb_field_value = 0.0 |
||
) |
Definition at line 961 of file colvarproxy_namd.C.
References PDB::atom(), cvm::atom, e_pdb_beta, e_pdb_occ, e_pdb_x, e_pdb_y, e_pdb_z, PDB::num_atoms(), and pdb_field_str2enum().
int colvarproxy_namd::load_coords | ( | char const * | filename, |
std::vector< cvm::atom_pos > & | pos, | ||
const std::vector< int > & | indices, | ||
std::string const & | pdb_field, | ||
double const | pdb_field_value = 0.0 |
||
) |
Definition at line 849 of file colvarproxy_namd.C.
References PDB::atom(), e_pdb_beta, e_pdb_occ, e_pdb_x, e_pdb_y, e_pdb_z, PDB::num_atoms(), and pdb_field_str2enum().
void colvarproxy_namd::log | ( | std::string const & | message | ) |
Definition at line 614 of file colvarproxy_namd.C.
Referenced by calculate(), error(), exit(), setup(), and update_atom_properties().
|
virtual |
Definition at line 1399 of file colvarproxy_namd.C.
std::ostream * colvarproxy_namd::output_stream | ( | std::string const & | output_name, |
std::ios_base::openmode | mode | ||
) |
Definition at line 1018 of file colvarproxy_namd.C.
References debug, and ofstream_namd::is_open().
cvm::rvector colvarproxy_namd::position_distance | ( | cvm::atom_pos const & | pos1, |
cvm::atom_pos const & | pos2 | ||
) | const |
Definition at line 782 of file colvarproxy_namd.C.
References Lattice::delta(), GlobalMaster::lattice, Vector::x, Vector::y, and Vector::z.
|
inline |
|
virtual |
|
virtual |
Definition at line 1409 of file colvarproxy_namd.C.
References DataMessage::data, replica_recv(), and DataMessage::size.
|
virtual |
Definition at line 1425 of file colvarproxy_namd.C.
References replica_send().
|
virtual |
Definition at line 1385 of file colvarproxy_namd.C.
|
virtual |
Definition at line 1394 of file colvarproxy_namd.C.
void colvarproxy_namd::request_total_force | ( | bool | yesno | ) |
Definition at line 601 of file colvarproxy_namd.C.
References debug, and GlobalMaster::requestTotalForce().
int colvarproxy_namd::reset | ( | ) |
Definition at line 258 of file colvarproxy_namd.C.
References atoms_map, ResizeArray< T >::clear(), GlobalMaster::modifyRequestedAtoms(), GlobalMaster::modifyRequestedGridObjects(), and GlobalMaster::modifyRequestedGroups().
int colvarproxy_namd::run_colvar_callback | ( | std::string const & | name, |
std::vector< const colvarvalue * > const & | cvcs, | ||
colvarvalue & | value | ||
) |
Definition at line 578 of file colvarproxy_namd.C.
int colvarproxy_namd::run_colvar_gradient_callback | ( | std::string const & | name, |
std::vector< const colvarvalue * > const & | cvcs, | ||
std::vector< cvm::matrix2d< cvm::real > > & | gradient | ||
) |
Definition at line 586 of file colvarproxy_namd.C.
int colvarproxy_namd::run_force_callback | ( | ) |
Definition at line 573 of file colvarproxy_namd.C.
|
inline |
Definition at line 208 of file colvarproxy_namd.h.
char const * colvarproxy_namd::script_obj_to_str | ( | unsigned char * | obj | ) |
Definition at line 1087 of file colvarproxy_namd.C.
std::vector< std::string > colvarproxy_namd::script_obj_to_str_vector | ( | unsigned char * | obj | ) |
int colvarproxy_namd::set_unit_system | ( | std::string const & | units_in, |
bool | check_only | ||
) |
Definition at line 1228 of file colvarproxy_namd.C.
int colvarproxy_namd::setup | ( | ) |
Definition at line 200 of file colvarproxy_namd.C.
References log(), GlobalMaster::modifyGridObjForces(), GlobalMaster::modifyRequestedGroups(), simparams, ResizeArray< T >::size(), update_atom_properties(), update_group_properties(), and SimParameters::wrapAll.
Referenced by calculate().
|
inline |
Definition at line 105 of file colvarproxy_namd.h.
References thermostat_temperature.
|
inline |
Definition at line 82 of file colvarproxy_namd.h.
void colvarproxy_namd::update_atom_properties | ( | int | index | ) |
Definition at line 766 of file colvarproxy_namd.C.
References Molecule::atomcharge(), Molecule::atommass(), log(), Node::molecule, and Node::Object().
Referenced by init_atom(), setup(), and update_atoms_map().
int colvarproxy_namd::update_atoms_map | ( | AtomIDList::const_iterator | begin, |
AtomIDList::const_iterator | end | ||
) |
Definition at line 165 of file colvarproxy_namd.C.
References atoms_map, debug, and update_atom_properties().
Referenced by calculate().
int colvarproxy_namd::update_group_properties | ( | int | index | ) |
Definition at line 1201 of file colvarproxy_namd.C.
References Molecule::atomcharge(), Molecule::atommass(), debug, GlobalMaster::modifyRequestedGroups(), Node::molecule, Node::Object(), and ResizeArray< T >::size().
Referenced by init_atom_group(), and setup().
|
friend |
Definition at line 61 of file colvarproxy_namd.h.
Referenced by load_atoms().
|
protected |
Array of atom indices (relative to the colvarproxy arrays), usedfor faster copy of atomic data.
Definition at line 40 of file colvarproxy_namd.h.
Referenced by calculate(), reset(), and update_atoms_map().
|
protected |
Definition at line 51 of file colvarproxy_namd.h.
Referenced by calculate(), and colvarproxy_namd().
|
protected |
Definition at line 52 of file colvarproxy_namd.h.
Referenced by calculate().
|
protected |
NAMD-style PRNG object.
Definition at line 49 of file colvarproxy_namd.h.
Referenced by colvarproxy_namd(), and rand_gaussian().
|
protected |
Used to submit restraint energy as MISC.
Definition at line 55 of file colvarproxy_namd.h.
Referenced by add_energy(), calculate(), colvarproxy_namd(), and ~colvarproxy_namd().
|
protected |
Pointer to the NAMD simulation input object.
Definition at line 43 of file colvarproxy_namd.h.
Referenced by calculate(), colvarproxy_namd(), dt(), init_volmap(), and setup().
|
protected |
Self-explained.
Definition at line 46 of file colvarproxy_namd.h.
Referenced by colvarproxy_namd(), and temperature().