# MPQC::ChemistryOpt_CoordinateModel_impl Class Reference

Symbol "MPQC.ChemistryOpt_CoordinateModel" (version 0.2) More...

`#include <MPQC_ChemistryOpt_CoordinateModel_Impl.hh>`

List of all members.

## Public Member Functions

| ChemistryOpt_CoordinateModel_impl (struct MPQC_ChemistryOpt_CoordinateModel__object *s)
void | _ctor ()
void | _dtor ()
int32_t | initialize () throw ()
| Registers and gets ports, and requests Model object(s) from the ModelFactory component(s).
int32_t | finalize () throw ()
| Releases and unregisters ports.
void | set_model (::Chemistry::QC::Model model) throw ()
| Sets the contained chemistry Model object (currently unused as the chemistry Model object is normally obtained from a ModelFactory during initialization).
::Chemistry::QC::Model | get_model () throw ()
| Returns the contained chemistry Model object.
int32_t | get_n_coor () throw ()
| Returns the number of coordinates.
::sidl::array< double > | get_coor () throw ()
| Returns the array of (cartesian or internal) coordinates which are being optimized.
double | get_energy (::sidl::array< double > x) throw ()
| Returns the energy of the currently contained model with the values of the optimization coordinates given in x.
::sidl::array< double > | get_gradient (::sidl::array< double > x) throw ()
| Returns the energy gradient of the currently contained model with the values of the optimization coordinates given in x.
::sidl::array< double > | get_hessian (::sidl::array< double > x) throw ()
| Returns the energy Hessian of the currently contained model with the values of the optimization coordinates given in x.
void | get_energy_and_gradient (::sidl::array< double > x, double &f,::sidl::array< double > g) throw ()
| Sets f and g to the energy and energy gradient, respectively, of the chemistry model at x.
void | guess_hessian_solve (::sidl::array< double > effective_grad,::sidl::array< double > effective_step, void *first_geom) throw ()
| Returns the product of the guess hessian inverse and an effective gradient.
void | checkConvergence (int32_t &flag) throw ()
| Determines if the optimization has converged, flag is set to 1 if convergence has been achieved and 0 otherwise.
void | monitor () throw ()
| For visualization, possibly unused (?).
void | setServices (::gov::cca::Services services) throw ( ::gov::cca::CCAException )
| Starts up a component presence in the calling framework.

## Static Public Member Functions

static void | _load ()

## Detailed Description

Symbol "MPQC.ChemistryOpt_CoordinateModel" (version 0.2)

IntegralEvaluatorFactory_impl implements a component interface for coordinate-aware chemistry models.

This is an implementation of a SIDL interface. The stub code is generated by the Babel tool. Do not make modifications outside of splicer blocks, as these will be lost. This is a server implementation for a Babel class, the Babel client code is provided by the cca-chem-generic package.

For use directly in a framework, the parameter port recognizes the following parameters:

`double grad_rms`

  RMS gradient convergence criterion. The default is 0.00030.

`double grad_max`

  Max gradient convergence criterion. The default is 0.00045.

`double disp_rms`

  RMS displacement convergence criterion. The default is 0.00120.

`double disp_max`

  Max displacement convergence criterion. The default is 0.00180.

`bool multiple_guess_h`

  Whether a new guess Hessian is computed each time `guess_hessian_sovle()` is called. The default is true.

`bool use_current_geom`

  Whether the guess Hessian is computed at the current geometry or the geometry of the first correction pair. Only meaningful if `multiple_guess_h = true`. The default is false.

`string coordinate_type`

  Type of coordinates to use for optimization: `cartesian`, `symmetrized`, or `redundant`. The default is `symmetrized`.

`string extra_bonds`

  Vector specifying centers between which bonds should be added. There is no default.

These parameters must be set by the client for embedded use.

## Member Function Documentation

void MPQC::ChemistryOpt_CoordinateModel_impl::checkConvergence | ( | int32_t & | flag | ) | throw ()

Determines if the optimization has converged, flag is set to 1 if convergence has been achieved and 0 otherwise.

Parameters:

  flag | Variable that convergence value is assigned to.

int32_t MPQC::ChemistryOpt_CoordinateModel_impl::finalize | ( |  | ) | throw ()

Releases and unregisters ports.

This should be called when the CoordinateModel object is no longer needed.

::sidl::array<double> MPQC::ChemistryOpt_CoordinateModel_impl::get_coor | ( |  | ) | throw ()

Returns the array of (cartesian or internal) coordinates which are being optimized.

Returns:
  The array of coordinates which are being optimized.

double MPQC::ChemistryOpt_CoordinateModel_impl::get_energy | ( | ::sidl::array< double > | x | ) | throw ()

Returns the energy of the currently contained model with the values of the optimization coordinates given in x.

This requires that the CoordinateModel updates the cartesian coordinates of a contained Molecule object (possibly requiring transformation) and set this Molecule object on a contained Model object, prior to calling get_energy() on the Model object.

Parameters:

  x | The optimization coordinate values.

Returns:
  The energy of the chemistry model at x.

void MPQC::ChemistryOpt_CoordinateModel_impl::get_energy_and_gradient | ( | ::sidl::array< double > | x,
|  | double & | f,
|  | ::sidl::array< double > | g
| ) |  | throw ()

Sets f and g to the energy and energy gradient, respectively, of the chemistry model at x.

This is similar to calling get_energy() and get_gradient() separately, but set_molecule() must be called on the Model object only once. This is necessary for some model implementations, as a second molecule update would invalidate results from an energy computation. An alternative would be to always return the energy as well when get_gradient() is called.

Parameters:

  x | The optimization coordinate values.
  f | Variable that energy will be assigned to.
  g | Array that the gradient will be assigned to.

::sidl::array<double> MPQC::ChemistryOpt_CoordinateModel_impl::get_gradient | ( | ::sidl::array< double > | x | ) | throw ()

Returns the energy gradient of the currently contained model with the values of the optimization coordinates given in x.

This requires that the CoordinateModel updates the cartesian coordinates of a contained Molecule object (possibly requiring transformation) and set this Molecule object on a contained Model object, prior to calling get_gradient() on the Model object. If the optimization coordinate system is not cartesian, the gradient is transformed.

Parameters:

  x | The optimization coordinate values.

Returns:
  The energy gradient of the chemistry model at x.

::sidl::array<double> MPQC::ChemistryOpt_CoordinateModel_impl::get_hessian | ( | ::sidl::array< double > | x | ) | throw ()

Returns the energy Hessian of the currently contained model with the values of the optimization coordinates given in x.

This requires that the CoordinateModel updates the cartesian coordinates of a contained Molecule object (possibly requiring transformation) and set this Molecule object on a contained Model object, prior to calling get_hessian() on the Model object. If the optimization coordinate system is not cartesian, the Hessian is transformed.

Parameters:

  x | The optimization coordinate values.

Returns:
  The energy Hessian of the chemistry model at x.

::Chemistry::QC::Model MPQC::ChemistryOpt_CoordinateModel_impl::get_model | ( |  | ) | throw ()

Returns the contained chemistry Model object.

Returns:
  The chemistry Model object.

int32_t MPQC::ChemistryOpt_CoordinateModel_impl::get_n_coor | ( |  | ) | throw ()

Returns the number of coordinates.

Returns:
  The number of coordinates.

void MPQC::ChemistryOpt_CoordinateModel_impl::guess_hessian_solve | ( | ::sidl::array< double > | effective_grad,
|  | ::sidl::array< double > | effective_step,
|  | void * | first_geom
| ) |  | throw ()

Returns the product of the guess hessian inverse and an effective gradient.

Probably unique to TAO's limited memory variable metric algorithm, which uses this method to accomodate dense guess hessians. "first_geom_ptr" provides the Cartesian coordinates for which the guess Hessian should be computed (first_geom_ptr=0 for current geometry).

Parameters:

  effective_grad | An effective gradient.
  effective_step | Array that effective step is assigned to.
  first_geom | Pointer to array of Cartesians

int32_t MPQC::ChemistryOpt_CoordinateModel_impl::initialize | ( |  | ) | throw ()

Registers and gets ports, and requests Model object(s) from the ModelFactory component(s).

This must be the first method called following instantiation.

void MPQC::ChemistryOpt_CoordinateModel_impl::monitor | ( |  | ) | throw ()

For visualization, possibly unused (?).

CoordinateModel objects may callback to viewers that implement the Chemistry.MoleculeViewer interface, such as the cca-chem python GUI, making this method unnecessary.

void MPQC::ChemistryOpt_CoordinateModel_impl::set_model | ( | ::Chemistry::QC::Model | model | ) | throw ()

Sets the contained chemistry Model object (currently unused as the chemistry Model object is normally obtained from a ModelFactory during initialization).

Parameters:

  model | The chemistry model object.

void MPQC::ChemistryOpt_CoordinateModel_impl::setServices | ( | ::gov::cca::Services | services | ) | throw ( ::gov::cca::CCAException )

Starts up a component presence in the calling framework.

Parameters:

  Svc | the component instance's handle on the framework world. Contracts concerning Svc and setServices:

The component interaction with the CCA framework and Ports begins on the call to setServices by the framework.

This function is called exactly once for each instance created by the framework.

The argument Svc will never be nil/null.

Those uses ports which are automatically connected by the framework (so-called service-ports) may be obtained via getPort during setServices.

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

- MPQC_ChemistryOpt_CoordinateModel_Impl.hh