MPQC  2.3.1
Public Member Functions | Static Public Member Functions | List of all members
MPQC::ChemistryOpt_CoordinateModel_impl Class Reference

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

#include <MPQC_ChemistryOpt_CoordinateModel_Impl.hh>

Inheritance diagram for MPQC::ChemistryOpt_CoordinateModel_impl:
Inheritance graph
[legend]
Collaboration diagram for MPQC::ChemistryOpt_CoordinateModel_impl:
Collaboration graph
[legend]

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). More...
 
int32_t finalize () throw ()
 Releases and unregisters ports. More...
 
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). More...
 
::Chemistry::QC::Model get_model () throw ()
 Returns the contained chemistry Model object. More...
 
int32_t get_n_coor () throw ()
 Returns the number of coordinates. More...
 
::sidl::array< double > get_coor () throw ()
 Returns the array of (cartesian or internal) coordinates which are being optimized. More...
 
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. More...
 
::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. More...
 
::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. More...
 
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. More...
 
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. More...
 
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. More...
 
void monitor () throw ()
 For visualization, possibly unused (?). More...
 
void setServices (::gov::cca::Services services) throw ( ::gov::cca::CCAException )
 Starts up a component presence in the calling framework. More...
 

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

◆ checkConvergence()

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
flagVariable that convergence value is assigned to.

◆ finalize()

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

Releases and unregisters ports.

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

◆ get_coor()

::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.

◆ get_energy()

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
xThe optimization coordinate values.
Returns
The energy of the chemistry model at x.

◆ get_energy_and_gradient()

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
xThe optimization coordinate values.
fVariable that energy will be assigned to.
gArray that the gradient will be assigned to.

◆ get_gradient()

::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
xThe optimization coordinate values.
Returns
The energy gradient of the chemistry model at x.

◆ get_hessian()

::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
xThe optimization coordinate values.
Returns
The energy Hessian of the chemistry model at x.

◆ get_model()

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

Returns the contained chemistry Model object.

Returns
The chemistry Model object.

◆ get_n_coor()

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

Returns the number of coordinates.

Returns
The number of coordinates.

◆ guess_hessian_solve()

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_gradAn effective gradient.
effective_stepArray that effective step is assigned to.
first_geomPointer to array of Cartesians

◆ initialize()

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.

◆ monitor()

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.

◆ set_model()

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
modelThe chemistry model object.

◆ setServices()

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

Starts up a component presence in the calling framework.

Parameters
Svcthe 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:

Generated at Sun Jan 26 2020 23:33:05 for MPQC 2.3.1 using the documentation package Doxygen 1.8.16.