|
OpenMD 3.2
Molecular Dynamics in the Open
|
Public Member Functions | |
| NEP (const std::string &model_filename, int N_atoms, std::vector< RealType > box, std::vector< std::string > atom_symbols, std::vector< RealType > positions, std::vector< RealType > masses) | |
| std::vector< RealType > | getDescriptors () |
| std::vector< RealType > | getDipole () |
| std::vector< RealType > | getDipoleGradient (RealType displacement, int method, RealType charge) |
| std::vector< RealType > | getPolarizability () |
| std::vector< RealType > | getPolarizabilityGradient (RealType displacement, std::vector< int > components) |
| std::vector< RealType > | getLatentSpace () |
| std::tuple< std::vector< RealType >, std::vector< RealType >, std::vector< RealType > > | getPotentialForcesAndVirials () |
| std::vector< std::string > | _getAtomSymbols (std::string model_filename) |
| void | _convertAtomTypeNEPIndex (int N, std::vector< std::string > atom_symbols, std::vector< std::string > model_atom_symbols, std::vector< int > &type) |
| void | _getCenterOfMass (std::vector< RealType > center_of_mass) |
| void | setPositions (std::vector< RealType > positions) |
| void | setCell (std::vector< RealType > cell) |
| void | setMasses (std::vector< RealType > masses) |
| void | setSymbols (std::vector< std::string > atom_symbols) |
| OpenMD::NEP::NEP | ( | const std::string & | model_filename, |
| int | N_atoms, | ||
| std::vector< RealType > | box, | ||
| std::vector< std::string > | atom_symbols, | ||
| std::vector< RealType > | positions, | ||
| std::vector< RealType > | masses ) |
Wrapper class for NEP3 in nep.cpp.
This class wraps the setup functionality of the NEP3 class in nep.cpp.
| model_filename | Path to the NEP model (/path/nep.txt). |
| N_atoms | The number of atoms in the structure. |
| cell | The cell vectors for the structure. |
| atom_symbols | The atomic symbol for each atom in the structure. |
| positions | The position for each atom in the structure. |
| masses | The mass for each atom in the structure. |
Definition at line 12 of file nep.cpp.
References _convertAtomTypeNEPIndex(), and _getAtomSymbols().
| void OpenMD::NEP::_convertAtomTypeNEPIndex | ( | int | N, |
| std::vector< std::string > | atom_symbols, | ||
| std::vector< std::string > | model_atom_symbols, | ||
| std::vector< int > & | type ) |
Converts atom species to NEP index.
Converts atomic species to indicies, which are used in NEP.
| atom_symbols | List of atom symbols. |
| model_atom_symbols | List of atom symbols used in the model. |
| type | List of indices corresponding to atom type. |
Definition at line 448 of file nep.cpp.
Referenced by NEP(), and setSymbols().
| std::vector< std::string > OpenMD::NEP::_getAtomSymbols | ( | std::string | model_filename | ) |
Fetches atomic symbols
This function fetches the atomic symbols from the header of a NEP model. These are later used to ensure consistent indices for the atom types.
| model_filename | Path to the NEP model (/path/nep.txt). |
Definition at line 421 of file nep.cpp.
Referenced by NEP(), and setSymbols().
| void OpenMD::NEP::_getCenterOfMass | ( | std::vector< RealType > | center_of_mass | ) |
Computes the center of mass for current atoms object.
Computes the center of mass (COM) for the structure with positions defined by atoms.position. The COM will be written as a three vector, with in the order [x_component, y_component, z_component].
| center_of_mass | Vector to hold the center of mass. |
Definition at line 69 of file nep.cpp.
Referenced by getDipoleGradient().
| std::vector< RealType > OpenMD::NEP::getDescriptors | ( | ) |
| std::vector< RealType > OpenMD::NEP::getDipole | ( | ) |
| std::vector< RealType > OpenMD::NEP::getDipoleGradient | ( | RealType | displacement, |
| int | method, | ||
| RealType | charge ) |
Get dipole gradient through finite differences.
Calculates the dipole gradient, a (N_atoms, 3, 3) tensor for the gradients dµ_k/dr_ij, for atom i, Cartesian direction j (x, y, z) and dipole moment component k. Mode is either forward difference (method=0) or first or second order central difference (method=1 and method=2 respectively). Before computing the gradient the dipoles are corrected using the center of mass and the total system charge, supplied via the parameter charge.
| displacement | Displacement in Å. |
| method | 0 or 1, corresponding to forward or central differences. |
| charge | Total system charge, used to correct dipoles. |
Definition at line 92 of file nep.cpp.
References _getCenterOfMass().
| std::vector< RealType > OpenMD::NEP::getLatentSpace | ( | ) |
| std::vector< RealType > OpenMD::NEP::getPolarizability | ( | ) |
| std::vector< RealType > OpenMD::NEP::getPolarizabilityGradient | ( | RealType | displacement, |
| std::vector< int > | components ) |
Get polarizability gradient through finite differences.
Calculates the polarizability gradient, a (N_atoms, 3, 6) tensor for the gradients dp_k/dr_ij, for atom i, Cartesian direction j (x, y, z) and polarizability component k, using second order finite differences.
| displacement | Displacement in Å. |
| std::tuple< std::vector< RealType >, std::vector< RealType >, std::vector< RealType > > OpenMD::NEP::getPotentialForcesAndVirials | ( | ) |
| void OpenMD::NEP::setCell | ( | std::vector< RealType > | cell | ) |
| void OpenMD::NEP::setMasses | ( | std::vector< RealType > | masses | ) |
| void OpenMD::NEP::setPositions | ( | std::vector< RealType > | positions | ) |
| void OpenMD::NEP::setSymbols | ( | std::vector< std::string > | atom_symbols | ) |
Sets symbols.
Sets the symbols of the atoms object from the ones used in the model.
| atom_symbols | List of symbols. |
Definition at line 514 of file nep.cpp.
References _convertAtomTypeNEPIndex(), and _getAtomSymbols().