MPQC  3.0.0-alpha
sc::MolecularFragment Class Reference

MolecularFragment is a Molecule that is a fragment of another Molecule object. More...

#include <chemistry/molecule/frag.h>

Inheritance diagram for sc::MolecularFragment:
sc::Molecule sc::SavableState sc::DescribedClass sc::RefCount

Public Member Functions

 MolecularFragment (const Ref< KeyVal > &kv)
 A KeyVal constructor is used to generate a MolecularFragment object from the input. More...
 
 MolecularFragment (StateIn &)
 
void save_data_state (StateOut &)
 Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them. More...
 
- Public Member Functions inherited from sc::Molecule
 Molecule (const Molecule &)
 
 Molecule (StateIn &)
 
 Molecule (const Ref< KeyVal > &input)
 The Molecule KeyVal constructor is used to generate a Molecule object from the input. More...
 
Moleculeoperator= (const Molecule &)
 
void add_atom (int Z, double x, double y, double z, const std::string &label="", double mass=0.0, int have_charge=0, double charge=0.0, int have_fragment=0, int fragment=0)
 Add an AtomicCenter to the Molecule.
 
const Atomatom (size_t i) const
 
const std::vector< Atom > & atoms () const
 
virtual void print (std::ostream &=ExEnv::out0()) const
 Print information about the molecule.
 
virtual void print_parsedkeyval (std::ostream &=ExEnv::out0(), int print_pg=1, int print_unit=1, int number_atoms=1) const
 
Ref< Unitsgeometry_units () const
 in which units Molecule was specified and in which units it will be reported
 
size_t natom () const
 Returns the number of atoms in the molecule.
 
int Z (int atom) const
 
double & r (int atom, int xyz)
 
const double & r (int atom, int xyz) const
 
const double * r (int atom) const
 
double mass (int atom) const
 
const char * label (int atom) const
 Returns the label explicitly assigned to atom. More...
 
int fragment (int atom) const
 returns the fragment to which atom belongs to
 
int atom_at_position (double *, double tol=0.05) const
 Takes an (x, y, z) postion and finds an atom within the given tolerance distance. More...
 
int atom_label_to_index (const std::string &label) const
 Returns the index of the atom with the given label. More...
 
std::vector< double > charges () const
 Returns a vector of the nuclear charges of the atoms.
 
double charge (int iatom) const
 Return the charge of the atom.
 
bool is_Q (int iatom) const
 Return true if iatom is a simple point charge.
 
double total_charge () const
 Returns the total nuclear charge. More...
 
int total_Z () const
 Returns the sum of atomic numbers of nuclei.
 
void set_point_group (const Ref< PointGroup > &, double tol=1.0e-7)
 Sets the PointGroup of the molecule.
 
const Ref< PointGroup > & point_group () const
 Returns the PointGroup of the molecule.
 
Ref< PointGrouphighest_point_group (double tol=1.0e-8) const
 Find this molecules true point group (limited to abelian groups). More...
 
int is_axis (SCVector3 &origin, SCVector3 &udirection, int order, double tol=1.0e-8) const
 Return 1 if this given axis is a symmetry element for the molecule. More...
 
int is_plane (SCVector3 &origin, SCVector3 &uperp, double tol=1.0e-8) const
 Return 1 if the given plane is a symmetry element for the molecule. More...
 
int has_inversion (SCVector3 &origin, double tol=1.0e-8) const
 Return 1 if the molecule has an inversion center.
 
int is_linear (double tolerance=1.0e-5) const
 Returns 1 if the molecule is linear, 0 otherwise.
 
int is_planar (double tolerance=1.0e-5) const
 Returns 1 if the molecule is planar, 0 otherwise.
 
void is_linear_planar (int &linear, int &planar, double tol=1.0e-5) const
 Sets linear to 1 if the molecular is linear, 0 otherwise. More...
 
SCVector3 center_of_mass () const
 Returns a SCVector3 containing the cartesian coordinates of the center of mass for the molecule.
 
double nuclear_repulsion_energy ()
 Returns the nuclear repulsion energy for the molecule.
 
void nuclear_repulsion_1der (int center, double xyz[3])
 Compute the nuclear repulsion energy first derivative with respect to the given center.
 
void nuclear_efield (const double *position, double *efield)
 Compute the electric field due to the nuclei at the given point.
 
void nuclear_charge_efield (const double *charges, const double *position, double *efield)
 Compute the electric field due to the given charges at the positions of the nuclei at the given point.
 
void symmetrize (double tol=0.5)
 If the molecule contains only symmetry unique atoms, this function will generate the other, redundant atoms. More...
 
void symmetrize (const Ref< PointGroup > &pg, double tol=0.5)
 Set the point group and then symmetrize.
 
void cleanup_molecule (double tol=0.1)
 This will try to carefully correct symmetry errors in molecules. More...
 
void translate (const double *r)
 
void move_to_com ()
 
void transform_to_principal_axes (int trans_frame=1)
 
void transform_to_symmetry_frame ()
 
void print_xyz (std::ostream &=ExEnv::out0(), const char *title=0) const
 
void principal_moments_of_inertia (double *evals, double **evecs=0) const
 Compute the principal moments of inertia and, possibly, the principal axes.
 
int nunique () const
 Return information about symmetry unique and equivalent atoms. More...
 
int unique (int iuniq) const
 Returns the overall number of the iuniq'th unique atom.
 
int nequivalent (int iuniq) const
 Returns the number of atoms equivalent to iuniq.
 
int equivalent (int iuniq, int j) const
 Returns the j'th atom equivalent to iuniq.
 
int atom_to_unique (int iatom) const
 Converts an atom number to the number of its generating unique atom. More...
 
int atom_to_unique_offset (int iatom) const
 Converts an atom number to the offset of this atom in the list of generated atoms. More...
 
int n_core_electrons ()
 Return the number of core electrons.
 
int max_z ()
 Return the maximum atomic number.
 
Ref< AtomInfoatominfo () const
 Return the molecule's AtomInfo object.
 
std::string atom_name (int iatom) const
 Returns the element name of the atom.
 
std::string atom_symbol (int iatom) const
 Returns the element symbol of the atom.
 
void set_include_q (bool iq)
 If include_q is true, then include the "Q" atoms in the charge and efield routines.
 
bool include_q () const
 Returns include_q. See set_include_q.
 
void set_include_qq (bool iqq)
 If include_qq is true, include the coupling between pairs of "Q" atoms when computing nuclear repulsion energy and gradients.
 
bool include_qq () const
 Returns include_qq. See set_include_qq.
 
int n_q_atom () const
 Retrieve the number of "Q" atoms.
 
int q_atom (int i) const
 Retrieve the "Q" atoms.
 
int n_non_q_atom () const
 Retrieve the number of non-"Q" atoms.
 
int non_q_atom (int i) const
 Retrieve the of non-"Q" atoms.
 
bool any_atom_has_charge () const
 Determine if any of the atoms have non-standard charge.
 
bool any_atom_has_fragment () const
 Determine if any of the atoms have a fragment label.
 
bool any_atom_has_label () const
 Determine if any of the atoms have a user defined label.
 
SCVector3 ref_origin () const
 returns the origin of the reference coordinate system (the system in which atoms were specified before the center-of-mass shift
 
void save_data_state (StateOut &)
 Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them. More...
 
- Public Member Functions inherited from sc::SavableState
SavableStateoperator= (const SavableState &)
 
void save_state (StateOut &)
 Save the state of the object as specified by the StateOut object. More...
 
void save_object_state (StateOut &)
 This can be used for saving state when the exact type of the object is known for both the save and the restore. More...
 
virtual void save_vbase_state (StateOut &)
 Save the virtual bases for the object. More...
 
- Public Member Functions inherited from sc::DescribedClass
 DescribedClass (const DescribedClass &)
 
DescribedClassoperator= (const DescribedClass &)
 
ClassDescclass_desc () const MPQC__NOEXCEPT
 This returns the unique pointer to the ClassDesc corresponding to the given type_info object. More...
 
const char * class_name () const
 Return the name of the object's exact type.
 
int class_version () const
 Return the version of the class.
 
Ref< DescribedClassref ()
 Return this object wrapped up in a Ref smart pointer. More...
 
- Public Member Functions inherited from sc::RefCount
size_t identifier () const
 Return the unique identifier for this object that can be compared for different objects of different types. More...
 
int lock_ptr () const
 Lock this object.
 
int unlock_ptr () const
 Unlock this object.
 
void use_locks (bool inVal)
 start and stop using locks on this object
 
refcount_t nreference () const
 Return the reference count.
 
refcount_t reference ()
 Increment the reference count and return the new count.
 
refcount_t dereference ()
 Decrement the reference count and return the new count.
 
int managed () const
 
void unmanage ()
 Turn off the reference counting mechanism for this object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from sc::SavableState
static void save_state (SavableState *s, StateOut &)
 
static SavableStaterestore_state (StateIn &si)
 Restores objects saved with save_state. More...
 
static SavableStatekey_restore_state (StateIn &si, const char *keyword)
 Like restore_state, but keyword is used to override values while restoring.
 
static SavableStatedir_restore_state (StateIn &si, const char *objectname, const char *keyword=0)
 
- Protected Member Functions inherited from sc::Molecule
void init_symmetry_info (double tol=0.5)
 
void clear_symmetry_info ()
 
void clear ()
 
void throw_if_atom_duplicated (int begin=0, double tol=1e-3)
 
- Protected Member Functions inherited from sc::SavableState
 SavableState (const SavableState &)
 
 SavableState (StateIn &)
 Each derived class StateIn CTOR handles the restore corresponding to calling save_object_state, save_vbase_state, and save_data_state listed above. More...
 
- Protected Member Functions inherited from sc::RefCount
 RefCount (const RefCount &)
 
RefCountoperator= (const RefCount &)
 
- Protected Attributes inherited from sc::Molecule
std::vector< Atomatoms_
 
Ref< AtomInfoatominfo_
 
Ref< PointGrouppg_
 
Ref< Unitsgeometry_units_
 
double ref_origin_ [3]
 
int nuniq_
 
int * nequiv_
 
int ** equiv_
 
int * atom_to_uniq_
 
int q_Z_
 
bool include_q_
 
bool include_qq_
 
std::vector< int > q_atoms_
 
std::vector< int > non_q_atoms_
 

Detailed Description

MolecularFragment is a Molecule that is a fragment of another Molecule object.

Constructor & Destructor Documentation

◆ MolecularFragment()

sc::MolecularFragment::MolecularFragment ( const Ref< KeyVal > &  kv)

A KeyVal constructor is used to generate a MolecularFragment object from the input.

The full list of keywords that are accepted is below.

KeywordTypeDefault

Description

moleculeMoleculenone

the Molecule object that this molecule is part of (proto-molecule).

fragmentinteger0

Specifies atoms of which fragment defined in the proto-molecule object will be considered for including into this molecule (see Molecule KeyVal documentation). By default, all atoms will be considered.

includes_atomsinteger[]

none<td>(optional) only atoms connected by "normal" chemical bonds to the atoms specified by this keyword will be considered (atomic indices are 0-based). The normal chemical bonds are generated for the proto-molecule object using the same distance criterion as that used by IntCoorGen object to generate bonds (see IntCoorGen documentation).

excludes_atomsinteger[]

none<td>(optional) only atoms NOT connected by "normal" chemical bonds to the atoms specified by this keyword will be considered. See documentation for includes_atoms.

symmetrystringauto

The Schoenflies symbol of the point group. This is case insensitive. It should be a subgroup of D2h. If it is auto, then the appropriate subgroup of D2h will be found.

symmetry_tolerancedouble1.0e-4

When a molecule has symmetry, some atoms may be related by symmetry operations. The distance between given atoms and atoms generated by symmetry operations is compared to this threshold to determine if they are the same. If they are the same, then the coordinates are cleaned up to make them exactly symmetry equivalent. If the given molecule was produced by a optimization that started in C1 symmetry, but produced a roughly symmetric structure and you would like to begin using symmetry, then this may need to be increased a bit to properly symmetrize the molecule.

symmetry_framedouble[3][3][[1 0 0][0 1 0][0 0 1]]

The symmetry frame. Ignored for symmetry = auto.

origindouble[3][0 0 0]

The origin of the symmetry frame. Specified in the same units as used by proto-molecule. Ignored for symmetry = auto.

add_ghostsbooleanfalse

If true, the atoms in proto-molecule that are not of this fragment will be included as ghosts (zero-charge atoms that carry basis functions; see documentation for ghost keyword for Molecule).

Note that although MolecularFragment is derived from Molecule, its KeyVal constructor does not accept all Molecule keywords.

Member Function Documentation

◆ save_data_state()

void sc::MolecularFragment::save_data_state ( StateOut )
virtual

Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them.

This must be implemented by the derived class if the class has data.

Reimplemented from sc::SavableState.


The documentation for this class was generated from the following file:

Generated at Sun Jan 26 2020 23:24:07 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.