Documentation
Molecule is a class which contains a vector of AtomBasedClusterables.
Molecule is a recursively-clustered collection of atoms.
Public Member Functions | |
Molecule ()=default | |
Molecule (const Molecule &)=default | |
Molecule (Molecule &&)=default | |
Molecule & | operator= (Molecule &&)=default |
Molecule & | operator= (const Molecule &)=default |
Molecule (const KeyVal &kv) | |
The KeyVal constructor. More... | |
Molecule (std::istream &file_stream, bool sort_input=true, Vector3d const &sort_origin=Vector3d::Zero(), std::array< Vector3d, 3 > frame={ {Vector3d{1, 0, 0}, Vector3d{0, 1, 0}, Vector3d{0, 0, 1}}}) | |
Constructs Molecule from an XYZ-format stream. More... | |
Molecule (std::vector< AtomBasedClusterable > c, bool sort_input=true) | |
Constructor to build Molecule from a vector of clusterables. More... | |
Molecule (const std::vector< Atom > &atoms) | |
virtual | ~Molecule ()=default |
virtual void | in_units_of (const std::string &units) |
Reinterprets coordinates of atoms as having different units. More... | |
void | sort_from_point (Vector3d const &point) |
A function to sort the clusters from a given point. More... | |
void | set_mass (double mass) |
Function to set the mass of the Molecule. More... | |
int64_t | total_atomic_number () const |
double | mass () const |
Mass of the Molecule. More... | |
std::vector< AtomBasedClusterable >::const_iterator | begin () const |
Iterator to the first clusterable in the Molecule. More... | |
std::vector< AtomBasedClusterable >::const_iterator | end () const |
Iterator to one past the final clusterable in the Molecule. More... | |
int64_t | nclusters () const |
Number of clusters in the Molecule. More... | |
std::vector< AtomBasedClusterable > const & | clusterables () const |
Vector containing the Clusterable that make up the Molecule. More... | |
int64_t | core_electrons () const |
Computes the number of core electrons in the Molecule. More... | |
double | nuclear_repulsion_energy () const |
std::vector< Atom > | atoms () const |
A vector of all atoms in the Molecule. More... | |
size_t | natoms () const |
Vector3d const & | com () const |
Center of mass of the Molecule. More... | |
Public Member Functions inherited from mpqc::DescribedClass | |
DescribedClass ()=default | |
virtual | ~DescribedClass () |
std::string | class_key () const |
Public Member Functions inherited from mpqc::enable_shared_from_this< DescribedClass > | |
virtual | ~enable_shared_from_this ()=default |
std::shared_ptr< DescribedClass > | shared_from_this () |
returns the pointer to this object More... | |
std::shared_ptr< std::add_const_t< DescribedClass > > | shared_from_this () const |
returns the pointer to this object More... | |
Public Member Functions inherited from mpqc::detail::virt_base_of_enable_shared_from_this | |
virtual | ~virt_base_of_enable_shared_from_this ()=default |
bool | shared_from_this_possible () const |
template<typename Target , typename = std::enable_if_t<!std::is_const_v<Target>>> | |
std::shared_ptr< Target > | cast_shared_from_this_to () |
returns the pointer to this cast to a particular type More... | |
template<typename Target > | |
std::shared_ptr< std::add_const_t< Target > > | cast_shared_from_this_to () const |
returns the pointer to this cast to a particular type More... | |
Public Member Functions inherited from mpqc::utility::Observable< Molecule > | |
std::shared_ptr< void *const > | register_message (Observer *observer, std::function< void()> message) const |
Public Member Functions inherited from mpqc::enable_shared_from_this< Molecule > | |
virtual | ~enable_shared_from_this ()=default |
std::shared_ptr< Molecule > | shared_from_this () |
returns the pointer to this object More... | |
std::shared_ptr< std::add_const_t< Molecule > > | shared_from_this () const |
returns the pointer to this object More... | |
Static Public Member Functions | |
static std::vector< AtomBasedClusterable > | read_xyz (std::istream &file, const std::array< Vector3d, 3 > &frame={ {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}}) |
Reads atoms from an XYZ file. More... | |
Static Public Member Functions inherited from mpqc::DescribedClass | |
static keyval_ctor_wrapper_type | type_to_keyval_ctor (const std::string &type_name) |
template<typename T > | |
static void | register_keyval_ctor () |
template<typename T > | |
static bool | is_registered () |
template<typename T > | |
static std::string | class_key () |
static const keyval_ctor_registry_type & | keyval_ctor_registry () |
returns const ref to the keyval ctor registry More... | |
Friends | |
class | MolecularCoordinates |
the only way to mutate coordinates is via MolecularCoordinates More... | |
Additional Inherited Members | |
Public Types inherited from mpqc::DescribedClass | |
typedef std::shared_ptr< DescribedClass >(* | keyval_ctor_wrapper_type) (const KeyVal &) |
Public Types inherited from mpqc::utility::Observable< Molecule > | |
typedef std::map< void *, std::function< void()> > | messages_type |
Protected Member Functions inherited from mpqc::utility::Observable< Molecule > | |
void | message () |
Constructor & Destructor Documentation
◆ Molecule() [1/7]
|
default |
◆ Molecule() [2/7]
|
default |
◆ Molecule() [3/7]
|
default |
◆ Molecule() [4/7]
|
explicit |
The KeyVal constructor.
- Parameters
-
kv the KeyVal object. The following keywords will be queried in kv
:
Keyword | Type | Default | Description |
---|---|---|---|
file_name | string | none | This gives the name of a XYZ file, from which the nuclear coordinates will be read (the XYZ format is described here). Only rank 0 in the current madness::World will read the file. |
atoms | array | none | Will query this if file_name not given. Each element of the array must specify an Atom object (see the KeyVal ctor of Atom for more info). |
units | string | angstrom | If atoms given, will use this to determine the units in which the coordinates are given. Valid choices are "angstrom" and "bohr" See UnitFactory for more information. |
sort_input | boolean | true | If true, sort atoms in the order of increasing distance from the center of mass |
n_cluster | int | 0 | If nonzero, divide the Molecule into n_cluster clusters |
attach_hydrogen | boolean | true | use attach_hydrogen_kmeans when clustering |
"$:world" | pointer | the value returned by mpqc::get_default_world() | the default madness::World object to use |
example input 1:
example input 2:
◆ Molecule() [5/7]
mpqc::Molecule::Molecule | ( | std::istream & | file_stream, |
bool | sort_input = true , |
||
Vector3d const & | sort_origin = Vector3d::Zero() , |
||
std::array< Vector3d, 3 > | frame = { {Vector3d{1, 0, 0}, Vector3d{0, 1, 0}, Vector3d{0, 0, 1}}} |
||
) |
Constructs Molecule from an XYZ-format stream.
- Parameters
-
file_stream the XYZ-format stream sort_input if true, will resort atoms in the order of increasing distance from the point given by sort_origin@param
sort_origin the reference point to use for sorting the atomsframe coordinate frame basis (in Angstroms) used to compute atomic coordinates.
- Note
- This is a non-clustering ctor, i.e. produces a Molecule consisting of 1 cluster.
◆ Molecule() [6/7]
mpqc::Molecule::Molecule | ( | std::vector< AtomBasedClusterable > | c, |
bool | sort_input = true |
||
) |
◆ Molecule() [7/7]
|
explicit |
Constructs a Molecule from a sequence of Atom objects atoms
- Parameters
-
[in] atoms a sequence of atoms
- Note
- does not resort atoms, use Molecule::sort_from_point if needed
◆ ~Molecule()
|
virtualdefault |
Member Function Documentation
◆ atoms()
std::vector< Atom > mpqc::Molecule::atoms | ( | ) | const |
◆ begin()
|
inline |
Iterator to the first clusterable in the Molecule.
◆ clusterables()
|
inline |
Vector containing the Clusterable that make up the Molecule.
◆ com()
|
inline |
Center of mass of the Molecule.
Necessary to satisfy the AtomBasedClusterable interface so Molecules are also clusterable.
◆ core_electrons()
int64_t mpqc::Molecule::core_electrons | ( | ) | const |
Computes the number of core electrons in the Molecule.
◆ end()
|
inline |
Iterator to one past the final clusterable in the Molecule.
◆ in_units_of()
|
virtual |
Reinterprets coordinates of atoms as having different units.
Converts current coordinates of atoms to atomic units assuming that they are currently given in units
- Parameters
-
[in] units the units that the current Atom objects use; see UnitsFactory::make_unit
Reimplemented in mpqc::UnitCell.
◆ mass()
|
inline |
Mass of the Molecule.
◆ natoms()
size_t mpqc::Molecule::natoms | ( | ) | const |
- Returns
- the number of atoms returned by atoms()
◆ nclusters()
|
inline |
Number of clusters in the Molecule.
◆ nuclear_repulsion_energy()
double mpqc::Molecule::nuclear_repulsion_energy | ( | ) | const |
- Returns
- the nuclear repulsion energy of the Molecule.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ read_xyz()
|
static |
Reads atoms from an XYZ file.
- Parameters
-
file the XYZ-format stream frame coordinate frame basis (in Angstroms) used to compute atomic coordinates.
- Returns
- the vector of Atom objects opaqued as AtomBasedClusterable objects
◆ set_mass()
|
inline |
Function to set the mass of the Molecule.
◆ sort_from_point()
void mpqc::Molecule::sort_from_point | ( | Vector3d const & | point | ) |
A function to sort the clusters from a given point.
◆ total_atomic_number()
|
inline |
- Returns
- the sum of atomic numbers of all atoms
- See also
- Atom::atomic_number()
Friends And Related Function Documentation
◆ MolecularCoordinates
|
friend |
the only way to mutate coordinates is via MolecularCoordinates
The documentation for this class was generated from the following files:
- mpqc/chemistry/molecule/molecule.h
- mpqc/chemistry/molecule/molecule.cpp