Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

colvarproxy_system Class Reference

Methods for accessing the simulation system (PBCs, integrator, etc). More...

#include <colvarproxy_system.h>

Inheritance diagram for colvarproxy_system:

List of all members.

Public Methods

colvarproxy_system ()
Constructor. More...

virtual ~colvarproxy_system ()
Destructor. More...

virtual int set_unit_system (std::string const &units, bool check_only)
\brief Request to set the units used internally by Colvars. More...

cvm::real angstrom_to_internal (cvm::real l) const
\brief Convert a length from Angstrom to internal. More...

cvm::real internal_to_angstrom (cvm::real l) const
\brief Convert a length from internal to Angstrom. More...

cvm::real boltzmann () const
Boltzmann constant, with unit the same as energy / K. More...

cvm::real target_temperature () const
Current target temperature of the simulation (K units). More...

virtual int set_target_temperature (cvm::real T)
Set the current target temperature of the simulation (K units). More...

virtual cvm::real dt ()
\brief Time step of the simulation (fs). More...

virtual cvm::real rand_gaussian (void)
\brief Pseudo-random number with Gaussian distribution. More...

virtual void add_energy (cvm::real energy)
Pass restraint energy value for current timestep to MD engine. More...

virtual cvm::rvector position_distance (cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const
\brief Get the PBC-aware distance vector between two positions. More...

void update_pbc_lattice ()
Recompute PBC reciprocal lattice (assumes XYZ periodicity). More...

void reset_pbc_lattice ()
Set the lattice vectors to zero. More...

virtual void request_total_force (bool yesno)
\brief Tell the proxy whether total forces are needed (they may not always be available). More...

virtual bool total_forces_enabled () const
Are total forces being used? More...

virtual bool total_forces_same_step () const
Are total forces from the current step available? More...

virtual int get_molid (int &molid)
Get the molecule ID when called in VMD; raise error otherwise
Parameters:
molid Set this argument equal to the current VMD molid.
More...

virtual int get_alch_lambda (cvm::real *lambda)
Get value of alchemical lambda parameter from back-end (if available). More...

void set_alch_lambda (cvm::real lambda)
Set value of alchemical lambda parameter to be sent to back-end at end of timestep. More...

virtual int send_alch_lambda ()
Send cached value of alchemical lambda parameter to back-end (if available). More...

virtual int get_dE_dlambda (cvm::real *dE_dlambda)
Get energy derivative with respect to lambda (if available). More...

virtual int apply_force_dE_dlambda (cvm::real *force)
Apply a scalar force on dE_dlambda (back-end distributes it onto atoms). More...

virtual int get_d2E_dlambda2 (cvm::real *d2E_dlambda2)
Get energy second derivative with respect to lambda (if available). More...

virtual cvm::real get_accelMD_factor () const
Get weight factor from accelMD. More...

virtual bool accelMD_enabled () const

Public Attributes

std::string units
\brief Name of the unit system used internally by Colvars (by default, that of the back-end). Supported depending on the back-end: real (A, kcal/mol), metal (A, eV), electron (Bohr, Hartree), gromacs (nm, kJ/mol) Note: calls to back-end PBC functions assume back-end length unit We use different unit from back-end in VMD bc using PBC functions from colvarproxy base class Colvars internal units are user specified, because the module exchanges info in unknown composite dimensions with user input, while it only exchanges quantities of known dimension with the back-end (length and forces). More...

cvm::real indirect_lambda_biasing_force
Force to be applied onto alch. lambda, propagated from biasing forces on dE_dlambda. More...


Protected Types

enum Boundaries_type { boundaries_non_periodic, boundaries_pbc_ortho, boundaries_pbc_triclinic, boundaries_unsupported }
\brief Type of boundary conditions Orthogonal and triclinic cells are made available to objects. For any other conditions (mixed periodicity, triclinic cells in LAMMPS) minimum-image distances are computed by the host engine regardless. More...


Protected Attributes

cvm::real cached_alch_lambda
Next value of lambda to be sent to back-end. More...

bool cached_alch_lambda_changed
Whether lambda has been set and needs to be updated in backend. More...

cvm::real boltzmann_
Boltzmann constant in internal Colvars units. More...

cvm::real target_temperature_
Most up to date target temperature for the system (in K). More...

cvm::real angstrom_value_
\brief Value of 1 Angstrom in the internal (front-end) Colvars unit for atomic coordinates * defaults to 0 in the base class; derived proxy classes must set it * in VMD proxy, can only be changed when no variables are defined as user-defined values in composite units must be compatible with that system. More...

cvm::real kcal_mol_value_
\brief Value of 1 kcal/mol in the internal Colvars unit for energy. More...

bool total_force_requested
Whether the total forces have been requested. More...

Boundaries_type boundaries_type
Type of boundary conditions. More...

cvm::rvector unit_cell_x
Bravais lattice vectors. More...

cvm::rvector unit_cell_y
Bravais lattice vectors. More...

cvm::rvector unit_cell_z
Bravais lattice vectors. More...

cvm::rvector reciprocal_cell_x
Reciprocal lattice vectors. More...

cvm::rvector reciprocal_cell_y
Reciprocal lattice vectors. More...

cvm::rvector reciprocal_cell_z
Reciprocal lattice vectors. More...


Detailed Description

Methods for accessing the simulation system (PBCs, integrator, etc).

Definition at line 15 of file colvarproxy_system.h.


Member Enumeration Documentation

enum colvarproxy_system::Boundaries_type [protected]

\brief Type of boundary conditions Orthogonal and triclinic cells are made available to objects. For any other conditions (mixed periodicity, triclinic cells in LAMMPS) minimum-image distances are computed by the host engine regardless.

Enumeration values:
boundaries_non_periodic
boundaries_pbc_ortho
boundaries_pbc_triclinic
boundaries_unsupported

Definition at line 160 of file colvarproxy_system.h.


Constructor & Destructor Documentation

colvarproxy_system::colvarproxy_system ( )

colvarproxy_system::~colvarproxy_system ( ) [virtual]

Destructor.

Definition at line 32 of file colvarproxy_system.C.


Member Function Documentation

virtual bool colvarproxy_system::accelMD_enabled ( ) const [inline, virtual]

Definition at line 125 of file colvarproxy_system.h.

void colvarproxy_system::add_energy ( cvm::real energy ) [virtual]

Pass restraint energy value for current timestep to MD engine.

Reimplemented in colvarproxy_vmd.

Definition at line 63 of file colvarproxy_system.C.

Referenced by colvarmodule::update_colvar_forces.

cvm::real colvarproxy_system::angstrom_to_internal ( cvm::real l ) const [inline]

\brief Convert a length from Angstrom to internal.

Definition at line 38 of file colvarproxy_system.h.

References angstrom_value_.

Referenced by colvar::alpha_angles::alpha_angles, colvar::coordnum::coordnum, colvarproxy_vmd::load_coords, simple_scalar_dist_functions, and colvarproxy_vmd::update_input.

int colvarproxy_system::apply_force_dE_dlambda ( cvm::real * force ) [virtual]

Apply a scalar force on dE_dlambda (back-end distributes it onto atoms).

Definition at line 192 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

cvm::real colvarproxy_system::boltzmann ( ) const [inline]

cvm::real colvarproxy_system::dt ( ) [virtual]

\brief Time step of the simulation (fs).

Definition at line 49 of file colvarproxy_system.C.

virtual cvm::real colvarproxy_system::get_accelMD_factor ( ) const [inline, virtual]

Get weight factor from accelMD.

Definition at line 119 of file colvarproxy_system.h.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

int colvarproxy_system::get_alch_lambda ( cvm::real * lambda ) [virtual]

Get value of alchemical lambda parameter from back-end (if available).

Reimplemented in colvarproxy_vmd.

Definition at line 164 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

int colvarproxy_system::get_d2E_dlambda2 ( cvm::real * d2E_dlambda2 ) [virtual]

Get energy second derivative with respect to lambda (if available).

Definition at line 199 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

int colvarproxy_system::get_dE_dlambda ( cvm::real * dE_dlambda ) [virtual]

Get energy derivative with respect to lambda (if available).

Reimplemented in colvarproxy_vmd.

Definition at line 185 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

int colvarproxy_system::get_molid ( int & molid ) [virtual]

Get the molecule ID when called in VMD; raise error otherwise

Parameters:
molid Set this argument equal to the current VMD molid.

Reimplemented in colvarproxy_vmd.

Definition at line 156 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

cvm::real colvarproxy_system::internal_to_angstrom ( cvm::real l ) const [inline]

\brief Convert a length from internal to Angstrom.

Definition at line 44 of file colvarproxy_system.h.

References angstrom_value_.

Referenced by colvarproxy_vmd::compute_voldata.

cvm::rvector colvarproxy_system::position_distance ( cvm::atom_pos const & pos1,
cvm::atom_pos const & pos2
) const [virtual]

\brief Get the PBC-aware distance vector between two positions.

Definition at line 129 of file colvarproxy_system.C.

References COLVARS_INPUT_ERROR, colvarmodule::error, and round_to_integer.

Referenced by colvarproxy_vmd::compute_voldata.

cvm::real colvarproxy_system::rand_gaussian ( void ) [virtual]

\brief Pseudo-random number with Gaussian distribution.

Reimplemented in colvarproxy_vmd.

Definition at line 56 of file colvarproxy_system.C.

void colvarproxy_system::request_total_force ( bool yesno ) [virtual]

\brief Tell the proxy whether total forces are needed (they may not always be available).

Reimplemented in colvarproxy_vmd.

Definition at line 66 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

void colvarproxy_system::reset_pbc_lattice ( )

Set the lattice vectors to zero.

Definition at line 118 of file colvarproxy_system.C.

References reciprocal_cell_x, reciprocal_cell_y, reciprocal_cell_z, unit_cell_x, unit_cell_y, and unit_cell_z.

Referenced by colvarproxy_system, and colvarproxy_vmd::update_input.

int colvarproxy_system::send_alch_lambda ( ) [virtual]

Send cached value of alchemical lambda parameter to back-end (if available).

Reimplemented in colvarproxy_vmd.

Definition at line 178 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED, and colvarmodule::error.

Referenced by colvarproxy::end_of_step.

void colvarproxy_system::set_alch_lambda ( cvm::real lambda )

Set value of alchemical lambda parameter to be sent to back-end at end of timestep.

Definition at line 171 of file colvarproxy_system.C.

References cached_alch_lambda, and cached_alch_lambda_changed.

int colvarproxy_system::set_target_temperature ( cvm::real T ) [virtual]

Set the current target temperature of the simulation (K units).

Definition at line 42 of file colvarproxy_system.C.

References target_temperature_.

int colvarproxy_system::set_unit_system ( std::string const & units,
bool check_only
) [virtual]

\brief Request to set the units used internally by Colvars.

Reimplemented in colvarproxy_vmd.

Definition at line 35 of file colvarproxy_system.C.

References COLVARS_NOT_IMPLEMENTED.

Referenced by colvarmodule::parse_global_params.

cvm::real colvarproxy_system::target_temperature ( ) const [inline]

bool colvarproxy_system::total_forces_enabled ( ) const [virtual]

Are total forces being used?

Definition at line 74 of file colvarproxy_system.C.

Referenced by colvarmodule::read_restart.

bool colvarproxy_system::total_forces_same_step ( ) const [virtual]

Are total forces from the current step available?

Definition at line 80 of file colvarproxy_system.C.

Referenced by colvar::calc_cvcs, colvar::collect_cvc_data, colvarbias_abf::colvarbias_abf, colvarbias_ti::colvarbias_ti, and colvarbias_ti::update_system_forces.

void colvarproxy_system::update_pbc_lattice ( )

Member Data Documentation

cvm::real colvarproxy_system::angstrom_value_ [protected]

\brief Value of 1 Angstrom in the internal (front-end) Colvars unit for atomic coordinates * defaults to 0 in the base class; derived proxy classes must set it * in VMD proxy, can only be changed when no variables are defined as user-defined values in composite units must be compatible with that system.

Definition at line 147 of file colvarproxy_system.h.

Referenced by angstrom_to_internal, colvarproxy_system, colvarproxy_vmd::colvarproxy_vmd, internal_to_angstrom, and colvarproxy_vmd::set_unit_system.

cvm::real colvarproxy_system::boltzmann_ [protected]

Boltzmann constant in internal Colvars units.

Definition at line 138 of file colvarproxy_system.h.

Referenced by boltzmann, and colvarproxy_system.

Boundaries_type colvarproxy_system::boundaries_type [protected]

Type of boundary conditions.

Definition at line 168 of file colvarproxy_system.h.

Referenced by colvarproxy_system, colvarproxy_vmd::update_input, and update_pbc_lattice.

cvm::real colvarproxy_system::cached_alch_lambda [protected]

Next value of lambda to be sent to back-end.

Definition at line 132 of file colvarproxy_system.h.

Referenced by colvarproxy_system, and set_alch_lambda.

bool colvarproxy_system::cached_alch_lambda_changed [protected]

Whether lambda has been set and needs to be updated in backend.

Definition at line 135 of file colvarproxy_system.h.

Referenced by colvarproxy_system, colvarproxy::end_of_step, and set_alch_lambda.

cvm::real colvarproxy_system::indirect_lambda_biasing_force

Force to be applied onto alch. lambda, propagated from biasing forces on dE_dlambda.

Definition at line 116 of file colvarproxy_system.h.

Referenced by colvarproxy_system.

cvm::real colvarproxy_system::kcal_mol_value_ [protected]

\brief Value of 1 kcal/mol in the internal Colvars unit for energy.

Definition at line 150 of file colvarproxy_system.h.

Referenced by colvarproxy_system, colvarproxy_vmd::colvarproxy_vmd, and colvarproxy_vmd::set_unit_system.

cvm::rvector colvarproxy_system::reciprocal_cell_x [protected]

Reciprocal lattice vectors.

Definition at line 174 of file colvarproxy_system.h.

Referenced by reset_pbc_lattice, and update_pbc_lattice.

cvm::rvector colvarproxy_system::reciprocal_cell_y [protected]

Reciprocal lattice vectors.

Definition at line 174 of file colvarproxy_system.h.

Referenced by reset_pbc_lattice, and update_pbc_lattice.

cvm::rvector colvarproxy_system::reciprocal_cell_z [protected]

Reciprocal lattice vectors.

Definition at line 174 of file colvarproxy_system.h.

Referenced by reset_pbc_lattice, and update_pbc_lattice.

cvm::real colvarproxy_system::target_temperature_ [protected]

Most up to date target temperature for the system (in K).

Definition at line 141 of file colvarproxy_system.h.

Referenced by colvarproxy_system, set_target_temperature, and target_temperature.

bool colvarproxy_system::total_force_requested [protected]

Whether the total forces have been requested.

Definition at line 153 of file colvarproxy_system.h.

Referenced by colvarproxy_system, and colvarproxy_vmd::request_total_force.

cvm::rvector colvarproxy_system::unit_cell_x [protected]

Bravais lattice vectors.

Definition at line 171 of file colvarproxy_system.h.

Referenced by reset_pbc_lattice, colvarproxy_vmd::update_input, and update_pbc_lattice.

cvm::rvector colvarproxy_system::unit_cell_y [protected]

Bravais lattice vectors.

Definition at line 171 of file colvarproxy_system.h.

Referenced by reset_pbc_lattice, colvarproxy_vmd::update_input, and update_pbc_lattice.

cvm::rvector colvarproxy_system::unit_cell_z [protected]

Bravais lattice vectors.

Definition at line 171 of file colvarproxy_system.h.

Referenced by reset_pbc_lattice, colvarproxy_vmd::update_input, and update_pbc_lattice.

std::string colvarproxy_system::units

\brief Name of the unit system used internally by Colvars (by default, that of the back-end). Supported depending on the back-end: real (A, kcal/mol), metal (A, eV), electron (Bohr, Hartree), gromacs (nm, kJ/mol) Note: calls to back-end PBC functions assume back-end length unit We use different unit from back-end in VMD bc using PBC functions from colvarproxy base class Colvars internal units are user specified, because the module exchanges info in unknown composite dimensions with user input, while it only exchanges quantities of known dimension with the back-end (length and forces).

Definition at line 32 of file colvarproxy_system.h.

Referenced by colvarmodule::read_restart, colvarproxy_vmd::set_unit_system, and colvarmodule::write_restart.


The documentation for this class was generated from the following files:
Generated on Mon Nov 17 02:48:32 2025 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002

AltStyle によって変換されたページ (->オリジナル) /