preCICE v3.1.2
|
Interface quasi-Newton with interface least-squares approximation. More...
#include <IQNILSAcceleration.hpp>
Public Member Functions | |
IQNILSAcceleration (double initialRelaxation, bool forceInitialRelaxation, int maxIterationsUsed, int pastTimeWindowsReused, int filter, double singularityLimit, std::vector< int > dataIDs, impl::PtrPreconditioner preconditioner) | |
virtual | ~IQNILSAcceleration () |
virtual void | initialize (const DataMap &cplData) |
Initializes the acceleration. | |
virtual void | specializedIterationsConverged (const DataMap &cplData) |
Marks a iteration sequence as converged. | |
Public Member Functions inherited from precice::acceleration::BaseQNAcceleration | |
BaseQNAcceleration (double initialRelaxation, bool forceInitialRelaxation, int maxIterationsUsed, int timeWindowsReused, int filter, double singularityLimit, std::vector< int > dataIDs, impl::PtrPreconditioner preconditioner) | |
virtual | ~BaseQNAcceleration () |
Destructor, empty. | |
virtual std::vector< int > | getDataIDs () const |
Returns all IQN involved data IDs. | |
virtual void | performAcceleration (DataMap &cplData) |
Performs one acceleration step. | |
virtual void | iterationsConverged (const DataMap &cplData) |
Marks a iteration sequence as converged. | |
virtual void | exportState (io::TXTWriter &writer) |
Exports the current state of the acceleration to a file. | |
virtual void | importState (io::TXTReader &reader) |
Imports the last exported state of the acceleration from file. | |
virtual int | getDeletedColumns () const |
how many QN columns were deleted in this time window | |
virtual int | getDroppedColumns () const |
how many QN columns were dropped (went out of scope) in this time window | |
virtual int | getLSSystemCols () const |
: computes number of cols in least squares system, i.e, number of cols in _matrixV, _matrixW, _qrV, etc.. This is only necessary if some procs do not have any nodes on the coupling interface. In this case, the matrices are not constructed and we have no information about the number of cols. This info is needed for intra-participant communication. Number of its =! _cols in general. | |
Public Member Functions inherited from precice::acceleration::Acceleration | |
virtual | ~Acceleration ()=default |
Private Member Functions | |
virtual void | updateDifferenceMatrices (const DataMap &cplData) |
updates the V, W matrices (as well as the matrices for the secondary data) | |
virtual void | computeQNUpdate (const DataMap &cplData, Eigen::VectorXd &xUpdate) |
computes the IQN-ILS update using QR decomposition | |
virtual void | computeUnderrelaxationSecondaryData (const DataMap &cplData) |
computes underrelaxation for the secondary data | |
virtual void | removeMatrixColumn (int columnIndex) |
Removes one iteration from V,W matrices and adapts _matrixCols. | |
Private Attributes | |
std::map< int, Eigen::VectorXd > | _secondaryOldXTildes |
Secondary data solver output from last iteration. | |
std::map< int, Eigen::MatrixXd > | _secondaryMatricesW |
std::map< int, Eigen::MatrixXd > | _secondaryMatricesWBackup |
Additional Inherited Members | |
Public Types inherited from precice::acceleration::Acceleration | |
using | DataMap = std::map<int, cplscheme::PtrCouplingData> |
Map from data ID to data values. | |
Static Public Attributes inherited from precice::acceleration::Acceleration | |
static const int | NOFILTER = 0 |
static const int | QR1FILTER = 1 |
static const int | QR1FILTER_ABS = 2 |
static const int | QR2FILTER = 3 |
static const int | PODFILTER = 4 |
Protected Member Functions inherited from precice::acceleration::BaseQNAcceleration | |
int | getLSSystemRows () |
virtual void | splitCouplingData (const DataMap &cplData) |
Splits up QN system vector back into the coupling data. | |
virtual void | applyFilter () |
Applies the filter method for the least-squares system, defined in the configuration. | |
void | writeInfo (const std::string &s, bool allProcs=false) |
Wwrites info to the _infostream (also in parallel) | |
Protected Member Functions inherited from precice::acceleration::Acceleration | |
void | checkDataIDs (const DataMap &cplData) const |
Checks if all dataIDs are contained in cplData. | |
void | concatenateCouplingData (const DataMap &cplData, const std::vector< DataID > &dataIDs, Eigen::VectorXd &targetValues, Eigen::VectorXd &targetOldValues) const |
Concatenates all coupling data involved into a single vector. | |
Static Protected Member Functions inherited from precice::acceleration::Acceleration | |
static void | applyRelaxation (double omega, DataMap &cplData) |
performs a relaxation given a relaxation factor omega | |
Protected Attributes inherited from precice::acceleration::BaseQNAcceleration | |
logging::Logger | _log {"acceleration::BaseQNAcceleration"} |
impl::PtrPreconditioner | _preconditioner |
Preconditioner for least-squares system if vectorial system is used. | |
double | _initialRelaxation |
Constant relaxation factor used for first iteration. | |
int | _maxIterationsUsed |
Maximum number of old data iterations kept. | |
int | _timeWindowsReused |
Maximum number of old time windows (with data values) kept. | |
std::vector< int > | _dataIDs |
Data IDs of data to be involved in the IQN algorithm. | |
std::vector< int > | _secondaryDataIDs |
Data IDs of data not involved in IQN coefficient computation. | |
bool | _firstIteration = true |
Indicates the first iteration, where constant relaxation is used. | |
bool | _firstTimeWindow = true |
bool | _hasNodesOnInterface = true |
bool | _forceInitialRelaxation |
bool | _resetLS = false |
If true, the LS system has been modified (reset or recomputed) in such a way, that mere updating of matrices _Wtil, Q, R etc.. is not feasible any more and need to be recomputed. | |
Eigen::VectorXd | _oldXTilde |
Solver output from last iteration. | |
Eigen::VectorXd | _residuals |
Current iteration residuals of IQN data. Temporary. | |
std::map< int, Eigen::VectorXd > | _secondaryResiduals |
Current iteration residuals of secondary data. | |
Eigen::MatrixXd | _matrixV |
Stores residual deltas. | |
Eigen::MatrixXd | _matrixW |
Stores x tilde deltas, where x tilde are values computed by solvers. | |
impl::QRFactorization | _qrV |
Stores the current QR decomposition ov _matrixV, can be updated via deletion/insertion of columns. | |
int | _filter |
filter method that is used to maintain good conditioning of the least-squares system Either of two types: QR1FILTER or QR2Filter | |
double | _singularityLimit |
Determines sensitivity when two matrix columns are considered equal. | |
std::deque< int > | _matrixCols |
Indices (of columns in W, V matrices) of 1st iterations of time windows. | |
std::vector< int > | _dimOffsets |
Stores the local dimensions, i.e., the offsets in _invJacobian for all processors. | |
std::ostringstream | _infostringstream |
write some debug/acceleration info to file | |
std::fstream | _infostream |
int | its = 0 |
int | tWindows = 0 |
Interface quasi-Newton with interface least-squares approximation.
Performs a quasi-Newton to accelerate the convergence of implicit coupling iterations. A least-squares approximation is used to find the best linear combination of old data values. After every coupling iteration, the data values used are enhanced by the new coupling iterates.
If more coupling data is present than used to compute the IQN acceleration, this data is relaxed using the same linear combination as computed for the IQN-related data. The data is called "secondary" henceforth and additional old value and data matrices are needed for it.
Definition at line 26 of file IQNILSAcceleration.hpp.
precice::acceleration::IQNILSAcceleration::IQNILSAcceleration | ( | double | initialRelaxation, |
bool | forceInitialRelaxation, | ||
int | maxIterationsUsed, | ||
int | pastTimeWindowsReused, | ||
int | filter, | ||
double | singularityLimit, | ||
std::vector< int > | dataIDs, | ||
impl::PtrPreconditioner | preconditioner ) |
Definition at line 27 of file IQNILSAcceleration.cpp.
|
inlinevirtual |
Definition at line 38 of file IQNILSAcceleration.hpp.
|
privatevirtual |
computes the IQN-ILS update using QR decomposition
perform QN-Update step for the secondary Data
Implements precice::acceleration::BaseQNAcceleration.
Definition at line 131 of file IQNILSAcceleration.cpp.
|
privatevirtual |
computes underrelaxation for the secondary data
Implements precice::acceleration::BaseQNAcceleration.
Definition at line 109 of file IQNILSAcceleration.cpp.
|
virtual |
Initializes the acceleration.
Reimplemented from precice::acceleration::BaseQNAcceleration.
Definition at line 41 of file IQNILSAcceleration.cpp.
|
privatevirtual |
Removes one iteration from V,W matrices and adapts _matrixCols.
Reimplemented from precice::acceleration::BaseQNAcceleration.
Definition at line 270 of file IQNILSAcceleration.cpp.
|
virtual |
Marks a iteration sequence as converged.
called by the iterationsConverged() method in the BaseQNAcceleration class handles the acceleration specific action after the convergence of one iteration
pending deletion (after first iteration of next time window Using the matrices from the old time window for the first iteration is better than doing underrelaxation as first iteration of every time window
Implements precice::acceleration::BaseQNAcceleration.
Definition at line 234 of file IQNILSAcceleration.cpp.
|
privatevirtual |
updates the V, W matrices (as well as the matrices for the secondary data)
Reimplemented from precice::acceleration::BaseQNAcceleration.
Definition at line 56 of file IQNILSAcceleration.cpp.
|
private |
Definition at line 58 of file IQNILSAcceleration.hpp.
|
private |
Definition at line 59 of file IQNILSAcceleration.hpp.
|
private |
Secondary data solver output from last iteration.
Definition at line 53 of file IQNILSAcceleration.hpp.