MPQC
2.3.1
|
Symbol "MPQC.ChemistryOpt_CoordinateModel" (version 0.2) More...
#include <MPQC_ChemistryOpt_CoordinateModel_Impl.hh>
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 () |
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.
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.
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.
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.
x | The optimization coordinate values. |
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.
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.
x | The optimization coordinate values. |
::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.
x | The optimization coordinate values. |
::Chemistry::QC::Model MPQC::ChemistryOpt_CoordinateModel_impl::get_model | ( | ) | ||
throw | ( | |||
) |
Returns the contained chemistry Model object.
int32_t MPQC::ChemistryOpt_CoordinateModel_impl::get_n_coor | ( | ) | ||
throw | ( | |||
) |
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).
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).
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.
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.