#include <forceField.h>
Inheritance diagram for ForceField:
Public Types | |
Type Definitions | |
typedef std::vector< std::pair< Atom *, Atom * > > | PairVector |
Atom pair vector. | |
Public Member Functions | |
Constructors and Destructors | |
ForceField () | |
Default constructor. | |
ForceField (System &system) | |
Constructor. | |
ForceField (System &system, const Options &options) | |
Constructor. | |
ForceField (const ForceField &force_field) | |
Copy constructor. | |
virtual | ~ForceField () |
Destructor. | |
virtual void | clear () throw () |
Clear method. | |
Assignments | |
ForceField & | operator= (const ForceField &force_field) |
Assignment operator. | |
Debugging and Diagnostics | |
bool | isValid () const throw () |
Check the force field's validity. | |
Setup methods | |
bool | setup (System &system) |
Sets up the force field and its components. | |
bool | setup (System &system, const Options &options) |
Sets up the force field and its components. | |
virtual bool | specificSetup () throw (Exception::TooManyErrors) |
Force field specific setup. | |
void | setMaximumNumberOfErrors (Size nr) |
Set the number of atoms, for which the setup of the forcefield can fail, until the setup() methods aborts and return false. | |
Size | getMaximumNumberOfErrors () const |
Get the number of atoms, for which the setup of the forcefield can fail, until the setup() methods aborts and return false. | |
HashSet< const Atom * > & | getUnassignedAtoms () |
Get the atoms, for which the force field setup failed. | |
Accessors | |
void | setName (const String &name) |
Sets the force field name. | |
String | getName () const |
Returns the force field name. | |
Size | getNumberOfAtoms () const |
Returns the number of atoms stored in the force field. | |
Size | getNumberOfMovableAtoms () const |
Returns the number of non-fixed atoms stored in the force field. | |
const AtomVector & | getAtoms () const throw () |
Returns a reference to the atom vector. | |
System * | getSystem () throw () |
Returns a pointer to the system. | |
const System * | getSystem () const throw () |
Returns a const pointer to the system. | |
bool | getUseSelection () const throw () |
Return the status of the selection mechanism. | |
void | disableSelection () throw () |
Set the status of the selection mechanism. | |
void | enableSelection () throw () |
Set the status of the selection mechanism. | |
bool | isSelectionEnabled () const throw () |
Return the status of the selection mechanism. | |
ForceFieldParameters & | getParameters () |
Returns a pointer to the parameter file. | |
Size | countComponents () const |
Returns the number of components registered by the force field. | |
const TimeStamp & | getUpdateTime () const throw () |
Return the point of time of the last call to update. | |
const TimeStamp & | getSetupTime () const throw () |
Return the point of time of the last call to setup. | |
void | insertComponent (ForceFieldComponent *force_field_component) |
Insert a new component into the force field's component list. | |
void | removeComponent (const ForceFieldComponent *force_field_component) |
Remove a component from the force field's component list. | |
void | removeComponent (const String &name) |
Remove a component from the force field's component list. | |
ForceFieldComponent * | getComponent (const Size index) const |
Return a pointer to the specified force field component. | |
ForceFieldComponent * | getComponent (const String &name) const |
Return a pointer to the specified force field component. | |
double | getEnergy () const |
Return the sum of energies of all registered force field components. | |
double | updateEnergy () |
Calculate the sum of energies of all force field components and returns its value. | |
void | updateForces () |
Calculate the forces caused by each component and updates the current forces. | |
double | getRMSGradient () const |
Calculates the RMS of the current gradient. | |
virtual Size | getUpdateFrequency () const |
Return the update frequency for pair lists etc. | |
virtual void | update () throw (Exception::TooManyErrors) |
Update internal data structures. | |
virtual String | getResults () const throw () |
Get the current results in String form (Generic function to be overloaded in derived classes.). | |
std::ostream & | error () throw (Exception::TooManyErrors) |
Public Attributes | |
Public Attributes | |
Options | options |
Force field options. | |
PeriodicBoundary | periodic_boundary |
Periodic boundary. | |
Protected Member Functions | |
void | collectAtoms_ (const System &system) |
void | sortSelectedAtomVector_ () |
Protected Attributes | |
System * | system_ |
AtomVector | atoms_ |
ForceFieldParameters | parameters_ |
bool | valid_ |
String | name_ |
double | energy_ |
vector< ForceFieldComponent * > | components_ |
Size | number_of_movable_atoms_ |
bool | use_selection_ |
bool | selection_enabled_ |
TimeStamp | update_time_stamp_ |
TimeStamp | setup_time_stamp_ |
HashSet< const Atom * > | unassigned_atoms_ |
Size | max_number_of_errors_ |
Size | number_of_errors_ |
Friends | |
class | ForceFieldComponent |
This class is used to represent a general force field. Each force field by itself is composed by several different force field components which are represented by ForceFieldComponent objects.
|
Atom pair vector.
This type is used to represent "pair lists". In fact, it is a |
|
Default constructor. A default-constructed force field is not valid! It becomes valid after a successful call to setup. |
|
Constructor. The successful setup of the force field can be verified by the isValid method. |
|
Constructor. The successful setup of the force field can be verified by the isValid method. |
|
Destructor.
|
|
Clear method.
|
|
Returns the number of components registered by the force field.
|
|
Return a pointer to the specified force field component. If a component with the specified name does not exist, 0 is returned. |
|
Return a pointer to the specified force field component. If the specified index does not exist, 0 is returned. The given index should be smaller than the value returned by countComponents. The first component in the list has the index zero. |
|
Return the sum of energies of all registered force field components. No calculation will be performed. This method simply returns the last value for the total energy calculated by updateEnergy.
|
|
Get the number of atoms, for which the setup of the forcefield can fail, until the setup() methods aborts and return false.
|
|
Returns the number of non-fixed atoms stored in the force field.
If the option |
|
Return the point of time of the last call to setup. ForceField contains a time stamp which is used to determine whether the selection or even the topology of the system has changed. Every time update is called, the update_time_stamp_ is updated. Similarly, all setup methods update the setup_time_stamp_ |
|
Return the update frequency for pair lists etc. This method is used by minimizers or the MD simulation to determine the number of iterations between two calls to update . |
|
Return the point of time of the last call to update. ForceField contains a time stamp which is used to determine whether the selection or even the topology of the system has changed. Every time update is called, the update_time_stamp_ is updated. Similarly, all setup methods update the setup_time_stamp_ |
|
Insert a new component into the force field's component list. Responsability for the destruction of the component is passed on to the ForceField instance. |
|
Check the force field's validity. A force field is valid if it is bound to a system and setup was successful. |
|
Remove a component from the force field's component list.
|
|
Remove a component from the force field's component list. The ForceFieldComponent will be destructed and removed from the component list. |
|
Set the number of atoms, for which the setup of the forcefield can fail, until the setup() methods aborts and return false. By default, there is no limit set. |
|
Sets the force field name.
|
|
Sets up the force field and its components.
|
|
Sets up the force field and its components.
|
|
Force field specific setup. This method is called by setup. |
|
Update internal data structures. The force field may use this method to update internal data structures (e.g. pair lists) periodically. The MD simulation class as well as the minimizer classes use getUpdateFrequency to determine the number of iterations between two calls to update.
|
|
Calculate the sum of energies of all force field components and returns its value.
|
|
Calculate the forces caused by each component and updates the current forces.
|