Pulay mixing to optimize self-consistent field optimization More...
#include <Pulay.h>
Public Member Functions | |
Pulay (const PulayParams &pp) | |
double | minimize (double Eprev=+DBL_MAX, std::vector< string > extraNames=std::vector< string >(), std::vector< double > extraThresh=std::vector< double >()) |
Minimize energy using a self-consistent iteration. More... | |
void | loadState (const char *filename) |
Load the state from a single binary file. | |
void | saveState (const char *filename) const |
Save the state to a single binary file. | |
void | clearState () |
remove past variables and residuals | |
virtual double | sync (double x) const |
Override to synchronize scalars over MPI processes (if the same minimization is happening in sync over many processes) | |
Protected Member Functions | |
virtual double | cycle (double dEprev, std::vector< double > &extraValues)=0 |
Single cycle of the self-consistency loop. In each subsequent cycle, Pulay will try to zero the difference between getVariable() before and after the cycle. The implementation should only do the work of computing the updated variable; debug printing and I/O, if any, should occur in report() instead. More... | |
virtual void | report (int iter) |
Override to perform optional reporting. | |
virtual void | axpy (double alpha, const Variable &X, Variable &Y) const =0 |
Scaled accumulate on variable. | |
virtual double | dot (const Variable &X, const Variable &Y) const =0 |
Euclidean dot product. Metric applied separately for efficiency. | |
virtual size_t | variableSize () const =0 |
Number of bytes per variable. | |
virtual void | readVariable (Variable &, FILE *) const =0 |
Read variable from stream. | |
virtual void | writeVariable (const Variable &, FILE *) const =0 |
virtual Variable | getVariable () const =0 |
Write variable to stream. More... | |
virtual void | setVariable (const Variable &)=0 |
Set the state of system to specified variable. | |
virtual Variable | precondition (const Variable &) const =0 |
Apply preconditioner to variable/residual. | |
virtual Variable | applyMetric (const Variable &) const =0 |
Apply metric to variable/residual. | |
Pulay mixing to optimize self-consistent field optimization
|
protectedpure virtual |
Single cycle of the self-consistency loop. In each subsequent cycle, Pulay will try to zero the difference between getVariable() before and after the cycle. The implementation should only do the work of computing the updated variable; debug printing and I/O, if any, should occur in report() instead.
dEprev | energy change at previous cycle, which may be used to adjust accuracy of any inner optimizations |
extraValues | Specify the values of any extra convergence parameters specified in minimize() |
Implemented in NonlinearPCM, and SCF.
|
protectedpure virtual |
Write variable to stream.
Get the current variable from state of system
Implemented in NonlinearPCM, and SCF.
double Pulay< Variable >::minimize | ( | double | Eprev = +DBL_MAX , |
std::vector< string > | extraNames = std::vector< string >() , |
||
std::vector< double > | extraThresh = std::vector< double >() |
||
) |
Minimize energy using a self-consistent iteration.
Eprev | Initial energy (optional) |
extraNames | Names of extra convergence parameters to report and check every cycle |
extraThresh | Thresholds for each extra convergence parameter |