PSCF v1.1
|
Pspg implementation of the Anderson Mixing iterator. More...
#include <AmIteratorGrid.h>
Public Member Functions | |
AmIteratorGrid (System< D > &system) | |
Constructor. More... | |
~AmIteratorGrid () | |
Destructor. More... | |
void | readParameters (std::istream &in) |
Read all parameters and initialize. More... | |
![]() | |
AmIteratorTmpl () | |
Constructor. More... | |
~AmIteratorTmpl () | |
Destructor. More... | |
void | readParameters (std::istream &in) |
Read all parameters and initialize. More... | |
int | solve (bool isContinuation=false) |
Iterate to a solution. More... | |
Protected Member Functions | |
void | setup (bool isContinuation) |
Setup iterator just before entering iteration loop. More... | |
template<typename Type > | |
ScalarParam< Type > & | readOptional (std::istream &in, const char *label, Type &value) |
Add and read a new optional ScalarParam < Type > object. More... | |
![]() | |
void | setMaxItr (int maxItr) |
Set value of maxItr. More... | |
void | setMaxHist (int maxHist) |
Set value of maxHist (number of retained previous states) More... | |
void | setErrorType (std::string errorType) |
Set and validate value of errorType string. More... | |
void | readErrorType (std::istream &in) |
Read and validate the optional errorType string parameter. More... | |
virtual bool | isValidErrorType () |
Checks if a string is a valid error type. More... | |
virtual double | norm (FieldCUDA const &hist) |
Find the L2 norm of a vector. More... | |
void | allocateAM () |
Allocate memory required by AM algorithm, if necessary. More... | |
virtual void | clear () |
Clear information about history. More... | |
virtual void | setup (bool isContinuation) |
Initialize just before entry to iterative loop. More... | |
virtual double | computeError (int verbose) |
Compute and return error used to test for convergence. More... | |
FieldCUDA const & | residual () const |
Return the current residual vector by const reference. More... | |
FieldCUDA const & | field () const |
Return the current field or state vector by const reference. More... | |
int | verbose () const |
Verbosity level, allowed values 0, 1, or 2. More... | |
bool | isAllocatedAM () const |
Have data structures required by the AM algorithm been allocated? More... | |
ScalarParam< Type > & | read (std::istream &in, const char *label, Type &value) |
Add and read a new required ScalarParam < Type > object. More... | |
ScalarParam< Type > & | readOptional (std::istream &in, const char *label, Type &value) |
Add and read a new optional ScalarParam < Type > object. More... | |
Additional Inherited Members | |
![]() | |
std::string | errorType_ |
Type of error criterion used to test convergence. More... | |
Pspg implementation of the Anderson Mixing iterator.
Definition at line 30 of file AmIteratorGrid.h.
Pscf::Pspg::AmIteratorGrid< D >::AmIteratorGrid | ( | System< D > & | system | ) |
Constructor.
system | parent system object |
Definition at line 24 of file AmIteratorGrid.tpp.
Pscf::Pspg::AmIteratorGrid< D >::~AmIteratorGrid |
Destructor.
Definition at line 30 of file AmIteratorGrid.tpp.
void Pscf::Pspg::AmIteratorGrid< D >::readParameters | ( | std::istream & | in | ) |
Read all parameters and initialize.
in | input filestream |
Definition at line 35 of file AmIteratorGrid.tpp.
|
protectedvirtual |
Setup iterator just before entering iteration loop.
isContinuation | Is this a continuation within a sweep? |
Reimplemented from Pscf::AmIteratorTmpl< Iterator< D >, FieldCUDA >.
Definition at line 57 of file AmIteratorGrid.tpp.
|
inlineprotected |
Add and read a new optional ScalarParam < Type > object.
This is equivalent to ScalarParam<Type>(in, label, value, false).
in | input stream for reading |
label | Label string |
value | reference to new ScalarParam< Type > |
Definition at line 319 of file ParamComposite.h.