occ
|
Storage class for relevant information of a dimer (pair) of Molecule objects. More...
#include <dimer.h>
Public Types | |
enum class | MoleculeOrder : bool { AB = true , BA = false } |
An enum to clarify the order of information presented when for merged arrays e.g. More... | |
Public Member Functions | |
Dimer ()=default | |
Dimer (const Molecule &mol_A, const Molecule &mol_B) | |
Constructor from two Molecule objects. | |
Dimer (const std::vector< occ::core::Atom > &atoms_A, const std::vector< occ::core::Atom > &atoms_B) | |
Constructor from two std::vector<Atom> objects. | |
Vec3 | centroid () const |
const Molecule & | a () const |
Convenience wrapper to access the Molecule instance for Molecule A. | |
const Molecule & | b () const |
Convenience wrapper to access the Molecule instance for Molecule B. | |
double | centroid_distance () const |
Calculate the centroid - centroid distance between A & B. | |
double | center_of_mass_distance () const |
Calculate the distance between centre of mass of Molecules A & B. | |
double | nearest_distance () const |
Calculate the distance between closest pair of Atoms in Molecules A & B. | |
std::optional< occ::Mat4 > | symmetry_relation () const |
The symmetry operation to transform from Molecule A to Molecule B, if there is one. | |
Vec3 | v_ab () const |
The vector from centroid of Molecule A to the centroid of Molecule B. | |
Vec | vdw_radii (MoleculeOrder order=MoleculeOrder::AB) const |
Vector of van der Waals radii for the atoms in this Dimer. | |
IVec | atomic_numbers (MoleculeOrder order=MoleculeOrder::AB) const |
Vector of atomic numbers for the atoms in this Dimer. | |
Mat3N | positions (MoleculeOrder order=MoleculeOrder::AB) const |
The positions of all atoms in this Dimer. | |
int | num_electrons () const |
The total number of electrons in this Dimer. | |
int | charge () const |
The net charge of this Dimer. | |
int | multiplicity () const |
The net spin multiplicity of this Dimer. | |
void | set_interaction_id (size_t i) |
Set the index or identifier for which interaction this Dimer represents. | |
size_t | interaction_id () const |
Get the index or identifier for which interaction this Dimer represents. | |
void | set_interaction_energy (double e, const std::string &key="Total") |
Set the value of the interaction energy for this Dimer. | |
double | interaction_energy (const std::string &key="Total") const |
Get the stored interaction energy for this Dimer. | |
void | set_interaction_energies (const ankerl::unordered_dense::map< std::string, double > &e) |
const auto & | interaction_energies () const |
Get the stored interaction energy components for this Dimer. | |
bool | same_asymmetric_molecule_idxs (const Dimer &rhs) const |
Check if two dimers have the same asymmetric molecul indexes. | |
bool | operator== (const Dimer &rhs) const |
Check if two dimers are identical under some transformation. | |
bool | operator!= (const Dimer &rhs) const |
Check if two dimers are not identical under some transformation. | |
bool | equivalent_in_opposite_frame (const Dimer &b, const Mat3 &rot=Mat3::Identity()) const |
Check if two dimers are identical in the opposite reference frame. | |
bool | equivalent (const Dimer &b, const Mat3 &rot=Mat3::Identity()) const |
Check if two dimers are identical in the same reference frame. | |
const auto & | name () const |
void | set_name (const std::string &name) |
std::string | xyz_string () const |
void | set_property (const std::string &key, const std::string &value) |
Set the value of a property for this Dimer. | |
const auto & | properties () const |
void | set_properties (const ankerl::unordered_dense::map< std::string, std::string > &p) |
Storage class for relevant information of a dimer (pair) of Molecule objects.
The role of the Dimer class is to store information about a pair of molecules which represents a dimer, and to calculate relevant properties.
|
strong |
An enum to clarify the order of information presented when for merged arrays e.g.
atomic_numbers(), positions() etc.
Enumerator | |
---|---|
AB | The A molecule data is first, then B. |
BA | The B molecule data is first, then A. |
|
default |
occ::core::Dimer::Dimer | ( | const std::vector< occ::core::Atom > & | atoms_A, |
const std::vector< occ::core::Atom > & | atoms_B | ||
) |
Constructor from two std::vector<Atom> objects.
atoms_A | atoms representing/constituting Molecule A |
atoms_B | atoms representing/constituting Molecule B |
The data from these two vectors is copied internally, so they need not exist outside this Dimer. Further, any changes to those Atom objects after Dimer construction will not appear here.
|
inline |
IVec occ::core::Dimer::atomic_numbers | ( | MoleculeOrder | order = MoleculeOrder::AB | ) | const |
|
inline |
double occ::core::Dimer::center_of_mass_distance | ( | ) | const |
Vec3 occ::core::Dimer::centroid | ( | ) | const |
double occ::core::Dimer::centroid_distance | ( | ) | const |
|
inline |
Check if two dimers are identical in the same reference frame.
b | another Dimer object |
rot | a Matrix representing a rotation, applied to A. |
This is defined such that that Dimer b will be equivalent if Molecule B from the reference frame of Molecule A is equivalent to Molecule rhs.B in the reference frame of rhs.A
bool occ::core::Dimer::equivalent_in_opposite_frame | ( | const Dimer & | b, |
const Mat3 & | rot = Mat3::Identity() |
||
) | const |
Check if two dimers are identical in the opposite reference frame.
b | another Dimer object |
rot | a Matrix representing a rotation, applied to A. |
The opposite reference frame here is that Dimer b will be equivalent if Molecule B from the reference frame of Molecule A is equivalent to Molecule rhs.A in the reference frame of rhs.B
|
inline |
Get the stored interaction energy components for this Dimer.
double occ::core::Dimer::interaction_energy | ( | const std::string & | key = "Total" | ) | const |
Get the stored interaction energy for this Dimer.
key | a string labelling the component of the interaction energy. |
|
inline |
Get the index or identifier for which interaction this Dimer represents.
|
inline |
|
inline |
double occ::core::Dimer::nearest_distance | ( | ) | const |
Calculate the distance between closest pair of Atoms in Molecules A & B.
O(Na * Nb)
for the number of atoms Na
in Molecule A and Nb
for the number of atoms in Molecule B
|
inline |
|
inline |
Check if two dimers are not identical under some transformation.
rhs | another Dimer object |
Uses Dimer::operator== to find the result.
bool occ::core::Dimer::operator== | ( | const Dimer & | rhs | ) | const |
Check if two dimers are identical under some transformation.
rhs | another Dimer object |
The working definition of equality here is such that all the following must be true:
Mat3N occ::core::Dimer::positions | ( | MoleculeOrder | order = MoleculeOrder::AB | ) | const |
|
inline |
bool occ::core::Dimer::same_asymmetric_molecule_idxs | ( | const Dimer & | rhs | ) | const |
|
inline |
void occ::core::Dimer::set_interaction_energy | ( | double | e, |
const std::string & | key = "Total" |
||
) |
Set the value of the interaction energy for this Dimer.
e | a double representing the interaction energy. |
key | a string labelling the component of the interaction energy. |
|
inline |
Set the index or identifier for which interaction this Dimer represents.
i | the interaction index. |
|
inline |
|
inline |
|
inline |
Set the value of a property for this Dimer.
key | a string labelling the property. |
value | a string containing the value of the property |
std::optional< occ::Mat4 > occ::core::Dimer::symmetry_relation | ( | ) | const |
The symmetry operation to transform from Molecule A to Molecule B, if there is one.
Under the hood, this uses the Kabsch algorithm
Vec3 occ::core::Dimer::v_ab | ( | ) | const |
Vec occ::core::Dimer::vdw_radii | ( | MoleculeOrder | order = MoleculeOrder::AB | ) | const |
std::string occ::core::Dimer::xyz_string | ( | ) | const |