NAMD
|
Communication between colvars and NAMD (implementation of colvarproxy) More...
#include <colvarproxy_namd.h>
Public Member Functions | |
void | init_tcl_pointers () override |
colvarproxy_namd () | |
~colvarproxy_namd () | |
int | setup () override |
int | reset () override |
int | update_target_temperature () |
Get the target temperature from the NAMD thermostats supported so far. More... | |
void | init_atoms_map () |
Allocate an atoms map with the same size as the NAMD topology. More... | |
int | update_atoms_map (AtomIDList::const_iterator begin, AtomIDList::const_iterator end) |
void | calculate () |
void | log (std::string const &message) override |
void | error (std::string const &message) override |
int | set_unit_system (std::string const &units_in, bool check_only) override |
void | add_energy (cvm::real energy) override |
void | request_total_force (bool yesno) override |
bool | total_forces_enabled () const override |
int | run_force_callback () override |
int | run_colvar_callback (std::string const &name, std::vector< const colvarvalue *> const &cvcs, colvarvalue &value) override |
int | run_colvar_gradient_callback (std::string const &name, std::vector< const colvarvalue *> const &cvcs, std::vector< cvm::matrix2d< cvm::real > > &gradient) override |
cvm::real | rand_gaussian () override |
cvm::real | get_accelMD_factor () const override |
bool | accelMD_enabled () const override |
int | check_replicas_enabled () override |
int | replica_index () override |
int | num_replicas () override |
void | replica_comm_barrier () override |
int | replica_comm_recv (char *msg_data, int buf_len, int src_rep) override |
int | replica_comm_send (char *msg_data, int msg_len, int dest_rep) override |
int | check_atom_name_selections_available () override |
int | init_atom (int atom_number) override |
int | check_atom_id (int atom_number) override |
int | init_atom (cvm::residue_id const &residue, std::string const &atom_name, std::string const &segment_id) override |
int | check_atom_id (cvm::residue_id const &residue, std::string const &atom_name, std::string const &segment_id) override |
void | clear_atom (int index) override |
void | update_atom_properties (int index) |
cvm::rvector | position_distance (cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const |
int | load_atoms_pdb (char const *filename, cvm::atom_group &atoms, std::string const &pdb_field, double const pdb_field_value) override |
int | load_coords_pdb (char const *filename, std::vector< cvm::atom_pos > &pos, const std::vector< int > &indices, std::string const &pdb_field, double const pdb_field_value) override |
int | scalable_group_coms () override |
int | init_atom_group (std::vector< int > const &atoms_ids) override |
void | clear_atom_group (int index) override |
int | update_group_properties (int index) |
int | check_volmaps_available () override |
int | init_volmap_by_id (int volmap_id) override |
int | init_volmap_by_name (const char *volmap_name) override |
int | check_volmap_by_id (int volmap_id) override |
int | check_volmap_by_name (char const *volmap_name) override |
int | get_volmap_id_from_name (char const *volmap_name) override |
void | clear_volmap (int index) override |
int | compute_volmap (int flags, int volmap_id, cvm::atom_iter atom_begin, cvm::atom_iter atom_end, cvm::real *value, cvm::real *atom_field) override |
template<class T > | |
void | getGridForceGridValue (int flags, T const *grid, cvm::atom_iter atom_begin, cvm::atom_iter atom_end, cvm::real *value, cvm::real *atom_field) |
Abstraction of the two types of NAMD volumetric maps. More... | |
template<class T , int flags> | |
void | GridForceGridLoop (T const *g, cvm::atom_iter atom_begin, cvm::atom_iter atom_end, cvm::real *value, cvm::real *atom_field) |
Implementation of inner loop; allows for atom list computation and use. More... | |
std::ostream & | output_stream (std::string const &output_name, std::string const description) override |
int | flush_output_stream (std::string const &output_name) override |
int | flush_output_streams () override |
int | close_output_stream (std::string const &output_name) override |
int | close_output_streams () override |
int | backup_file (char const *filename) override |
![]() | |
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 | globalMasterStep |
int | old_num_groups_requested |
Communication between colvars and NAMD (implementation of colvarproxy)
Definition at line 38 of file colvarproxy_namd.h.
colvarproxy_namd::colvarproxy_namd | ( | ) |
Definition at line 47 of file colvarproxy_namd.C.
References accelMDOn, SimParameters::accelMDOn, amd_weight_factor, COLVARPROXY_VERSION, Node::colvars, Node::configList, StringList::data, debug, SimParameters::dt, endi(), error(), ConfigList::find(), first_timestep, SimParameters::firstTimestep, GLOBAL_MASTER_CKLOOP_CALC_BIASES, GLOBAL_MASTER_CKLOOP_CALC_ITEM, GLOBAL_MASTER_CKLOOP_CALC_SCRIPTED_BIASES, init_atoms_map(), iout, StringList::next, Node::Object(), ReductionMgr::Object(), SimParameters::outputFilename, random, SimParameters::randomSeed, reduction, PatchData::reduction, REDUCTIONS_BASIC, GlobalMaster::requestTotalForce(), SimParameters::restartFilename, SimParameters::restartFrequency, setup(), Node::simParameters, simparams, update_target_temperature(), and ReductionMgr::willSubmit().
colvarproxy_namd::~colvarproxy_namd | ( | ) |
Definition at line 153 of file colvarproxy_namd.C.
References reduction.
|
inlineoverride |
Definition at line 118 of file colvarproxy_namd.h.
References accelMDOn.
|
override |
Definition at line 654 of file colvarproxy_namd.C.
References SimParameters::CUDASOAintegrate, SubmitReduction::item(), reduction, REDUCTION_MISC_ENERGY, and simparams.
|
override |
Definition at line 1175 of file colvarproxy_namd.C.
References NAMD_backup_file().
Referenced by output_stream().
|
virtual |
Reimplemented from GlobalMaster.
Definition at line 336 of file colvarproxy_namd.C.
References Lattice::a(), Lattice::a_p(), ResizeArray< Elem >::add(), atoms_map, Lattice::b(), Lattice::b_p(), ResizeArray< Elem >::begin(), Lattice::c(), Lattice::c_p(), ResizeArray< Elem >::clear(), SimParameters::CUDASOAintegrate, debug, ResizeArray< Elem >::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(), SimParameters::outputFilename, previous_NAMD_step, reduction, GlobalMaster::requestedGridObjs(), GlobalMaster::requestedGroups(), ResizeArray< Elem >::resize(), SimParameters::restartFilename, SimParameters::restartFrequency, Vector::set(), ResizeArray< Elem >::setall(), setup(), simparams, GlobalMaster::step, SubmitReduction::submit(), update_accelMD_info(), update_atoms_map(), Vector::x, Vector::y, and Vector::z.
|
override |
Definition at line 711 of file colvarproxy_namd.C.
References debug, Node::molecule, Molecule::numAtoms, and Node::Object().
Referenced by init_atom().
|
override |
Definition at line 764 of file colvarproxy_namd.C.
References Molecule::get_atom_from_name(), Node::molecule, and Node::Object().
|
override |
Definition at line 730 of file colvarproxy_namd.C.
|
override |
Definition at line 1609 of file colvarproxy_namd.C.
|
override |
Definition at line 1374 of file colvarproxy_namd.C.
References Node::molecule, Molecule::numGridforceGrids, and Node::Object().
Referenced by init_volmap_by_id().
|
override |
Definition at line 1386 of file colvarproxy_namd.C.
References MGridforceParamsList::index_for_key(), SimParameters::mgridforcelist, and simparams.
Referenced by get_volmap_id_from_name(), and init_volmap_by_name().
|
override |
Definition at line 1305 of file colvarproxy_namd.C.
|
override |
Definition at line 826 of file colvarproxy_namd.C.
|
override |
Definition at line 1258 of file colvarproxy_namd.C.
|
override |
Definition at line 1401 of file colvarproxy_namd.C.
|
override |
Definition at line 1141 of file colvarproxy_namd.C.
|
override |
Definition at line 1158 of file colvarproxy_namd.C.
|
override |
Definition at line 1473 of file colvarproxy_namd.C.
References GridforceGrid::get_grid_type(), Molecule::get_gridfrc_grid(), GridforceGrid::GridforceGridTypeFull, GridforceGrid::GridforceGridTypeLite, Node::molecule, and Node::Object().
|
override |
Definition at line 690 of file colvarproxy_namd.C.
References log(), NAMD_die(), and NAMD_err().
Referenced by colvarproxy_namd().
|
override |
Definition at line 1109 of file colvarproxy_namd.C.
|
override |
Definition at line 1125 of file colvarproxy_namd.C.
|
inlineoverride |
|
override |
Definition at line 1408 of file colvarproxy_namd.C.
References check_volmap_by_name(), MGridforceParamsList::index_for_key(), SimParameters::mgridforcelist, and simparams.
void colvarproxy_namd::getGridForceGridValue | ( | int | flags, |
T const * | grid, | ||
cvm::atom_iter | atom_begin, | ||
cvm::atom_iter | atom_end, | ||
cvm::real * | value, | ||
cvm::real * | atom_field | ||
) |
Abstraction of the two types of NAMD volumetric maps.
Definition at line 1454 of file colvarproxy_namd.C.
void colvarproxy_namd::GridForceGridLoop | ( | T const * | g, |
cvm::atom_iter | atom_begin, | ||
cvm::atom_iter | atom_end, | ||
cvm::real * | value, | ||
cvm::real * | atom_field | ||
) |
Implementation of inner loop; allows for atom list computation and use.
Definition at line 1421 of file colvarproxy_namd.C.
References Vector::x, Vector::y, and Vector::z.
|
override |
Definition at line 736 of file colvarproxy_namd.C.
References ResizeArray< Elem >::add(), atoms_map, check_atom_id(), GlobalMaster::modifyRequestedAtoms(), and update_atom_properties().
|
override |
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 797 of file colvarproxy_namd.C.
References ResizeArray< Elem >::add(), atoms_map, check_atom_id(), debug, GlobalMaster::modifyRequestedAtoms(), and update_atom_properties().
|
override |
Definition at line 1186 of file colvarproxy_namd.C.
References debug, GlobalMaster::modifyGroupForces(), GlobalMaster::modifyRequestedGroups(), Node::molecule, Molecule::numAtoms, Node::Object(), ResizeArray< Elem >::resize(), ResizeArray< Elem >::size(), and update_group_properties().
void colvarproxy_namd::init_atoms_map | ( | ) |
Allocate an atoms map with the same size as the NAMD topology.
Definition at line 182 of file colvarproxy_namd.C.
References atoms_map, Node::molecule, Molecule::numAtoms, and Node::Object().
Referenced by colvarproxy_namd(), and update_atoms_map().
|
override |
|
override |
Definition at line 1311 of file colvarproxy_namd.C.
References ResizeArray< Elem >::add(), check_volmap_by_id(), and GlobalMaster::modifyRequestedGridObjects().
|
override |
Definition at line 1332 of file colvarproxy_namd.C.
References ResizeArray< Elem >::add(), check_volmap_by_name(), Molecule::get_gridfrc_grid(), GridforceGrid::get_scale(), MGridforceParamsList::index_for_key(), SimParameters::mgridforcelist, GlobalMaster::modifyRequestedGridObjects(), Node::molecule, Node::Object(), simparams, Vector::x, Vector::y, and Vector::z.
|
override |
Definition at line 1023 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().
|
override |
Definition at line 911 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().
|
override |
Definition at line 680 of file colvarproxy_namd.C.
Referenced by calculate(), error(), setup(), and update_atom_properties().
|
override |
Definition at line 1623 of file colvarproxy_namd.C.
|
override |
Definition at line 1080 of file colvarproxy_namd.C.
References backup_file(), and debug.
cvm::rvector colvarproxy_namd::position_distance | ( | cvm::atom_pos const & | pos1, |
cvm::atom_pos const & | pos2 | ||
) | const |
Definition at line 849 of file colvarproxy_namd.C.
References Lattice::delta(), GlobalMaster::lattice, Vector::x, Vector::y, and Vector::z.
|
inlineoverride |
|
override |
|
override |
Definition at line 1633 of file colvarproxy_namd.C.
References DataMessage::data, replica_recv(), and DataMessage::size.
|
override |
Definition at line 1649 of file colvarproxy_namd.C.
References replica_send().
|
override |
Definition at line 1618 of file colvarproxy_namd.C.
|
override |
Definition at line 667 of file colvarproxy_namd.C.
References debug, and GlobalMaster::requestTotalForce().
|
override |
Definition at line 304 of file colvarproxy_namd.C.
References atoms_map, ResizeArray< Elem >::clear(), debug, GlobalMaster::modifyAppliedForces(), GlobalMaster::modifyForcedAtoms(), GlobalMaster::modifyGridObjForces(), GlobalMaster::modifyGroupForces(), GlobalMaster::modifyRequestedAtoms(), GlobalMaster::modifyRequestedGridObjects(), GlobalMaster::modifyRequestedGroups(), and GlobalMaster::requestTotalForce().
|
override |
Definition at line 636 of file colvarproxy_namd.C.
|
override |
Definition at line 644 of file colvarproxy_namd.C.
|
override |
Definition at line 631 of file colvarproxy_namd.C.
|
inlineoverride |
Definition at line 205 of file colvarproxy_namd.h.
|
override |
Definition at line 1292 of file colvarproxy_namd.C.
|
override |
Definition at line 225 of file colvarproxy_namd.C.
References SimParameters::dt, log(), GlobalMaster::modifyGridObjForces(), GlobalMaster::modifyRequestedGroups(), simparams, ResizeArray< Elem >::size(), update_atom_properties(), update_group_properties(), update_target_temperature(), and SimParameters::wrapAll.
Referenced by calculate(), and colvarproxy_namd().
|
inlineoverride |
Definition at line 96 of file colvarproxy_namd.h.
|
protected |
Definition at line 607 of file colvarproxy_namd.C.
References Controller::accelMDdV, accelMDOn, amd_weight_factor, NamdState::getController(), Node::Object(), and Node::state.
Referenced by calculate().
void colvarproxy_namd::update_atom_properties | ( | int | index | ) |
Definition at line 833 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 189 of file colvarproxy_namd.C.
References ResizeArray< Elem >::add(), atoms_map, debug, init_atoms_map(), GlobalMaster::modifyRequestedAtoms(), Node::molecule, Molecule::numAtoms, Node::Object(), and update_atom_properties().
Referenced by calculate().
int colvarproxy_namd::update_group_properties | ( | int | index | ) |
Definition at line 1265 of file colvarproxy_namd.C.
References Molecule::atomcharge(), Molecule::atommass(), debug, GlobalMaster::modifyRequestedGroups(), Node::molecule, Node::Object(), and ResizeArray< Elem >::size().
Referenced by init_atom_group(), and setup().
int colvarproxy_namd::update_target_temperature | ( | ) |
Get the target temperature from the NAMD thermostats supported so far.
Definition at line 159 of file colvarproxy_namd.C.
References SimParameters::langevinOn, SimParameters::langevinTemp, SimParameters::loweAndersenOn, SimParameters::loweAndersenTemp, SimParameters::reassignFreq, SimParameters::reassignTemp, SimParameters::rescaleFreq, SimParameters::rescaleTemp, simparams, SimParameters::stochRescaleOn, SimParameters::stochRescaleTemp, SimParameters::tCoupleOn, and SimParameters::tCoupleTemp.
Referenced by colvarproxy_namd(), and setup().
|
friend |
Definition at line 70 of file colvarproxy_namd.h.
Referenced by load_atoms_pdb().
|
protected |
Accelerated MD reweighting factor.
Definition at line 62 of file colvarproxy_namd.h.
Referenced by accelMD_enabled(), colvarproxy_namd(), and update_accelMD_info().
|
protected |
Definition at line 63 of file colvarproxy_namd.h.
Referenced by colvarproxy_namd(), get_accelMD_factor(), and update_accelMD_info().
|
protected |
Array of atom indices (relative to the colvarproxy arrays), usedfor faster copy of atomic data.
Definition at line 44 of file colvarproxy_namd.h.
Referenced by calculate(), init_atom(), init_atoms_map(), reset(), and update_atoms_map().
|
protected |
Definition at line 52 of file colvarproxy_namd.h.
Referenced by calculate(), and colvarproxy_namd().
|
protected |
Definition at line 53 of file colvarproxy_namd.h.
Referenced by calculate().
|
protected |
NAMD-style PRNG object.
Definition at line 50 of file colvarproxy_namd.h.
Referenced by colvarproxy_namd(), and rand_gaussian().
|
protected |
Used to submit restraint energy as MISC.
Definition at line 56 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 47 of file colvarproxy_namd.h.
Referenced by add_energy(), calculate(), check_volmap_by_name(), colvarproxy_namd(), get_volmap_id_from_name(), init_volmap_by_name(), setup(), and update_target_temperature().