28#ifndef _chemistry_molecule_coor_h
29#define _chemistry_molecule_coor_h
34#include <math/scmat/matrix.h>
35#include <math/optimize/transform.h>
36#include <chemistry/molecule/molecule.h>
48 static double bohr_conv;
49 static double radian_conv;
80 virtual const char*
label()
const;
88 virtual const char*
ctype()
const = 0;
121 std::vector<double> coef_;
122 std::vector<Ref<IntCoor> > coor_;
190 std::vector<Ref<IntCoor> > coor_;
255 double linear_bend_thres_;
256 double linear_tors_thres_;
257 double radius_scale_factor_;
259 void init_constants();
261 double cos_ijk(
Molecule& m,
int i,
int j,
int k);
263 int nearest_contact(
int i,
Molecule& m);
337 double radius_scaling_factor = 1.1);
392 virtual void print_simples(std::ostream& =
ExEnv::out0())
const = 0;
465 int*& is_totally_symmetric);
493 int only_totally_symmetric_;
494 double symmetry_tolerance_;
495 double simple_tolerance_;
496 double coordinate_tolerance_;
497 double cartesian_tolerance_;
506 int given_fixed_values_;
511 int max_update_steps_;
512 double max_update_disp_;
525 int form_print_simples_;
526 int form_print_variable_;
527 int form_print_constant_;
528 int form_print_molecule_;
662 virtual void print_simples(std::ostream& =
ExEnv::out0())
const;
663 virtual void print_variable(std::ostream& =
ExEnv::out0())
const;
664 virtual void print_constant(std::ostream& =
ExEnv::out0())
const;
683 int change_coordinates_;
685 int transform_hessian_;
790 virtual void print_simples(std::ostream& =
ExEnv::out0())
const;
The CartMolecularCoor class implements Cartesian coordinates in a way suitable for use in geometry op...
Definition coor.h:764
virtual int to_internal(RefSymmSCMatrix &internal, RefSymmSCMatrix &cart)
Convert the Cartesian coordinate Hessian cartesian'' to internal coordinates and copy the result toin...
virtual int to_internal(RefSCVector &internal, RefSCVector &cartesian)
Convert the Cartesian coordinate gradients in cartesian'' to internal coordinates and copy these inte...
virtual RefSCDimension dim()
These implement the virtual functions inherited from MolecularCoor.
virtual int to_cartesian(RefSymmSCMatrix &cart, RefSymmSCMatrix &internal)
Convert the internal coordinate Hessian internal'' to Cartesian coordinates and copy the result tocar...
RefSymmSCMatrix inverse_hessian(RefSymmSCMatrix &)
Calculate an approximate hessian and place the result in `‘hessian’'.
virtual int to_cartesian(RefSCVector &cartesian, RefSCVector &internal)
Convert the internal coordinate gradients in internal'' to Cartesian coordinates and copy these Carte...
virtual void init()
Initializes the dimensions.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
virtual int to_internal(RefSCVector &internal)
Fill in the vector `‘internal’' with the current internal coordinates.
CartMolecularCoor(const Ref< KeyVal > &)
The KeyVal constructor.
virtual void print(std::ostream &=ExEnv::out0()) const
Print the coordinate.
static std::ostream & out0()
Return an ostream that writes from node 0.
IntCoorGen generates a set of simple internal coordinates for a molecule.
Definition coor.h:245
IntCoorGen(const Ref< KeyVal > &)
The KeyVal constructor.
static std::vector< std::set< int > > find_disconnected_subgraphs(const BitArrayLTri &adjmat)
given the adjacency matrix find all disconnected subgraphs, each subgraph is specified by a set of ve...
static BitArrayLTri adjacency_matrix(const Molecule &mol, double radius_scaling_factor=1.1)
computes the adjacency matrix for this molecule using atomic radii and the scaling_factor
virtual void print(std::ostream &out=ExEnv::out0()) const
Print out information about this.
void save_data_state(StateOut &)
Standard member.
IntCoorGen(const Ref< Molecule > &, int nextra=0, int *extra=0)
Create an IntCoorGen given a Molecule and, optionally, extra bonds.
void connect_subgraphs(const Molecule &mol, BitArrayLTri &adjacency_matrix)
(potentially) modifies the adjacency matrix to make sure that there are no disconnected subgraphs
virtual void generate(const Ref< SetIntCoor > &)
This generates a set of internal coordinates.
The IntCoor abstract class describes an internal coordinate of a molecule.
Definition coor.h:45
virtual const char * ctype() const =0
Returns a string representation of the type of coordinate this is.
virtual double preferred_value() const
Returns the value of the coordinate in more familiar units.
IntCoor(const Ref< KeyVal > &)
The KeyVal constructor.
virtual int equivalent(Ref< IntCoor > &)=0
Test to see if this internal coordinate is equivalent to that one.
virtual double value() const
Returns the value of the coordinate in atomic units or radians.
virtual void print(std::ostream &o=ExEnv::out0()) const
Print information about the coordinate.
virtual void set_value(double)
Sets the value of the coordinate in atomic units or radians.
virtual double force_constant(Ref< Molecule > &)=0
Returns the value of the force constant associated with this coordinate.
virtual void bmat(const Ref< Molecule > &, RefSCVector &bmat, double coef=1.0)=0
Fill in a row the the B matrix.
virtual void update_value(const Ref< Molecule > &)=0
Recalculate the value of the coordinate.
IntCoor(const char *label=0)
This constructor takes a string containing a label for the internal coordinate.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
virtual const char * label() const
Returns the string containing the label for the internal coordinate.
The IntMolecularCoor abstract class describes a molecule's coordinates in terms of internal coordinat...
Definition coor.h:458
virtual void new_coords()
Allocates memory for the SetIntCoor's used to store the simple and internal coordinates.
IntMolecularCoor(const Ref< KeyVal > &)
The KeyVal constructor.
virtual void read_keyval(const Ref< KeyVal > &)
Reads the KeyVal input.
virtual int all_to_internal(const Ref< Molecule > &, RefSCVector &internal)
Like to_internal(), except all internal coordinates are considered, not just the variable ones.
int nconstrained()
Returns the number of constrained coordinates.
virtual int to_internal(RefSCVector &internal, RefSCVector &cartesian)
Convert the Cartesian coordinate gradients in cartesian'' to internal coordinates and copy these inte...
virtual void print(std::ostream &=ExEnv::out0()) const
Print the coordinate.
virtual int all_to_cartesian(const Ref< Molecule > &, RefSCVector &internal)
Like to_cartesians(), except all internal coordinates are considered, not just the variable ones.
virtual void form_coordinates(int keep_variable=0)=0
Actually form the variable and constant internal coordinates from the simple internal coordinates.
virtual int to_cartesian(RefSymmSCMatrix &cart, RefSymmSCMatrix &internal)
Convert the internal coordinate Hessian internal'' to Cartesian coordinates and copy the result tocar...
virtual int to_internal(RefSCVector &internal)
Fill in the vector `‘internal’' with the current internal coordinates.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
virtual RefSCDimension dim()
These implement the virtual functions inherited from MolecularCoor.
virtual void init()
This is called by the constructors of classes derived from IntMolecularCoor.
virtual int to_internal(RefSymmSCMatrix &internal, RefSymmSCMatrix &cart)
Convert the Cartesian coordinate Hessian cartesian'' to internal coordinates and copy the result toin...
virtual int to_cartesian(RefSCVector &cartesian, RefSCVector &internal)
Convert the internal coordinate gradients in internal'' to Cartesian coordinates and copy these Carte...
The MolecularCoor abstract class describes the coordinate system used to describe a molecule.
Definition coor.h:351
virtual int to_internal(RefSCVector &internal)=0
Fill in the vector `‘internal’' with the current internal coordinates.
virtual int nconstrained()
Returns the number of constrained coordinates.
Ref< Molecule > molecule() const
Returns the molecule.
Definition coor.h:388
virtual int to_internal(RefSCVector &internal, RefSCVector &cartesian)=0
Convert the Cartesian coordinate gradients in cartesian'' to internal coordinates and copy these inte...
virtual Ref< NonlinearTransform > change_coordinates()
When this is called, MoleculeCoor may select a new internal coordinate system and return a transform ...
MolecularCoor(const Ref< KeyVal > &)
The KeyVal constructor.
virtual int to_cartesian(RefSCVector &cartesian, RefSCVector &internal)=0
Convert the internal coordinate gradients in internal'' to Cartesian coordinates and copy these Carte...
virtual int to_cartesian(RefSymmSCMatrix &cartesian, RefSymmSCMatrix &internal)=0
Convert the internal coordinate Hessian internal'' to Cartesian coordinates and copy the result tocar...
virtual void print(std::ostream &=ExEnv::out0()) const =0
Print the coordinate.
RefSCDimension dim_natom3()
Returns a smart reference to an SCDimension equal to the number of atoms in the molecule times 3.
Definition coor.h:385
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
virtual RefSymmSCMatrix inverse_hessian(RefSymmSCMatrix &)=0
Calculate an approximate hessian and place the result in `‘hessian’'.
virtual int to_internal(RefSymmSCMatrix &internal, RefSymmSCMatrix &cartesian)=0
Convert the Cartesian coordinate Hessian cartesian'' to internal coordinates and copy the result toin...
int to_cartesian(const RefSCVector &internal)
Given a set of displaced internal coordinates, update the cartesian coordinates of the Molecule conta...
virtual RefSCDimension dim()=0
Returns a smart reference to an SCDimension equal to the number of coordinates (be they Cartesian,...
The Molecule class contains information about molecules.
Definition molecule.h:153
The RedundMolecularCoor class provides a redundant set of simple internal coordinates.
Definition coor.h:737
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void form_coordinates(int keep_variable=0)
Actually form the variable and constant internal coordinates from the simple internal coordinates.
RedundMolecularCoor(const Ref< KeyVal > &)
The KeyVal constructor.
void guess_hessian(RefSymmSCMatrix &hessian)
Form the approximate hessian.
RefSymmSCMatrix inverse_hessian(RefSymmSCMatrix &)
Invert the hessian.
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:152
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition matrix.h:135
The RefSCVector class is a smart pointer to an SCVector specialization.
Definition matrix.h:55
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition matrix.h:265
A template class that maintains references counts.
Definition ref.h:361
Base class for objects that can save/restore state.
Definition state.h:45
The SetIntCoor class describes a set of internal coordinates.
Definition coor.h:188
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void add(const Ref< IntCoor > &)
Adds an internal coordinate to the set.
void clear()
Removes all coordinates from the set.
void add(const Ref< SetIntCoor > &)
Adds all the elements of another set to this one.
virtual void bmat(const Ref< Molecule > &, RefSCMatrix &)
Compute the B matrix the old-fashioned way.
SetIntCoor(const Ref< KeyVal > &)
The KeyVal constructor.
virtual void guess_hessian(Ref< Molecule > &, RefSymmSCMatrix &)
Create an approximate Hessian for this set of coordinates.
int n() const
Returns the number of coordinates in the set.
virtual void fd_bmat(const Ref< Molecule > &, RefSCMatrix &)
Compute the B matrix by finite displacements.
Ref< IntCoor > coor(int i) const
Returns a reference to the i'th coordinate in the set.
virtual void values_to_vector(const RefSCVector &)
Copy the values of the internal coordinates to a vector.
virtual void update_values(const Ref< Molecule > &)
Recalculate the values of the internal coordinates in the set.
virtual void print_details(const Ref< Molecule > &, std::ostream &=ExEnv::out0()) const
Print the coordinates in the set.
void pop()
Removes the last coordinate from this set.
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
SumIntCoor is used to construct linear combinations of internal coordinates.
Definition coor.h:119
double force_constant(Ref< Molecule > &)
Returns the weighted sum of the individual force constants.
void normalize()
This function normalizes all the coefficients.
void add(Ref< IntCoor > &, double coef)
Add a coordinate to the linear combination.
void update_value(const Ref< Molecule > &)
Recalculate the value of the coordinate.
double preferred_value() const
Returns the value of the coordinate in a.u. and radians.
SumIntCoor(const Ref< KeyVal > &)
The KeyVal constructor.
SumIntCoor(const char *)
This constructor takes a string containing a label for this coordinate.
void print_details(const Ref< Molecule > &, std::ostream &=ExEnv::out0()) const
Print the individual coordinates in the sum with their coefficients.
int equivalent(Ref< IntCoor > &)
Always returns 0.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
const char * ctype() const
Always returns `‘SUM’'.
int n()
Returns the number of coordinates in this linear combination.
void bmat(const Ref< Molecule > &, RefSCVector &bmat, double coef=1.0)
Fill in a row the the B matrix.
The SymmMolecularCoor class derives from IntMolecularCoor.
Definition coor.h:680
void init()
This is called by the constructors of classes derived from IntMolecularCoor.
void form_coordinates(int keep_variable=0)
Actually form the variable and constant internal coordinates from simple internal coordinates.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
SymmMolecularCoor(const Ref< KeyVal > &)
The KeyVal constructor.
void guess_hessian(RefSymmSCMatrix &hessian)
Form the approximate hessian.
RefSymmSCMatrix inverse_hessian(RefSymmSCMatrix &)
Invert the hessian.
void print(std::ostream &=ExEnv::out0()) const
Print the coordinate.
Ref< NonlinearTransform > change_coordinates()
This overrides MoleculeCoor's change_coordinates and might transform to a new set of coordinates.
Contains all MPQC code up to version 3.
Definition mpqcin.h:14