Inherit from here if you are calculating the position of a virtual atom (eg a center of mass). More...
#include <ActionWithVirtualAtom.h>

Public Member Functions | |
| ActionWithVirtualAtom (const ActionOptions &ao) | |
| ~ActionWithVirtualAtom () | |
| const std::map< AtomNumber, Tensor > & | getGradients () const |
| AtomNumber | getIndex () const |
| Return the atom id of the corresponding virtual atom. | |
| void | setGradients () |
| void | setGradientsIfNeeded () |
Static Public Member Functions | |
| static void | registerKeywords (Keywords &keys) |
Protected Member Functions | |
| void | requestAtoms (const std::vector< AtomNumber > &a) |
| Request atoms on which the calculation depends. | |
| void | setAtomsDerivatives (const std::vector< Tensor > &d) |
| Set the derivatives of virtual atom coordinate wrt atoms on which it dependes. | |
| void | setBoxDerivatives (const std::array< Tensor, 3 > &d) |
| Set the box derivatives. | |
| void | setBoxDerivativesNoPbc () |
| Set box derivatives automatically. | |
| void | setCharge (double) |
| Set its charge. | |
| void | setMass (double) |
| Set its mass. | |
| void | setPosition (const Vector &) |
| Set position of the virtual atom. | |
Private Member Functions | |
| void | apply () override |
| Apply an Action. | |
Private Attributes | |
| std::array< Tensor, 3 > | boxDerivatives |
| std::vector< Tensor > | derivatives |
| std::map< AtomNumber, Tensor > | gradients |
| const AtomNumber | index |
Inherit from here if you are calculating the position of a virtual atom (eg a center of mass).
Class to add a single virtual atom to the system. (it might be extended to add multiple virtual atoms).
|
explicit |
|
overrideprivatevirtual |
Apply an Action.
This method is called one time per step. The set of all Actions is applied in backward order.
Implements PLMD::Action.
|
inline |
|
inline |
Return the atom id of the corresponding virtual atom.
|
static |
|
protected |
Request atoms on which the calculation depends.
|
inlineprotected |
Set the derivatives of virtual atom coordinate wrt atoms on which it dependes.
|
protected |
Set the box derivatives.
This should be an array of size 3. First index corresponds to the components of the virtual atom. Notice that this routine subtract the trivial term coming from cell deformation since this term is already implicitly included. Indeed, if the vatom position is a linear function of atomic coordinates it is not necessary to call this function (implicit term is fine) (e.g. vatom::COM and vatom::Center). On the other hand if the vatom position is a non-linear function of atomic coordinates this should be called (see vatom::Ghost).
|
protected |
Set box derivatives automatically.
It should be called after the settomsDerivatives has been used for all single atoms.
|
inlineprotected |
Set its charge.
|
inlineprotected |
Set its mass.
|
inlineprotected |
Set position of the virtual atom.
|
private |
|
private |
|
private |
|
private |
Hosted by GitHub
|
1.17.0
|