preCICE v3.1.2
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
precice::acceleration::IQNILSAcceleration Class Reference

Interface quasi-Newton with interface least-squares approximation. More...

#include <IQNILSAcceleration.hpp>

Inheritance diagram for precice::acceleration::IQNILSAcceleration:
[legend]
Collaboration diagram for precice::acceleration::IQNILSAcceleration:
[legend]

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ IQNILSAcceleration()

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.

◆ ~IQNILSAcceleration()

virtual precice::acceleration::IQNILSAcceleration::~IQNILSAcceleration ( )
inlinevirtual

Definition at line 38 of file IQNILSAcceleration.hpp.

Member Function Documentation

◆ computeQNUpdate()

void precice::acceleration::IQNILSAcceleration::computeQNUpdate ( const DataMap & cplData,
Eigen::VectorXd & xUpdate )
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.

Here is the call graph for this function:

◆ computeUnderrelaxationSecondaryData()

void precice::acceleration::IQNILSAcceleration::computeUnderrelaxationSecondaryData ( const DataMap & cplData)
privatevirtual

computes underrelaxation for the secondary data

Implements precice::acceleration::BaseQNAcceleration.

Definition at line 109 of file IQNILSAcceleration.cpp.

Here is the call graph for this function:

◆ initialize()

void precice::acceleration::IQNILSAcceleration::initialize ( const DataMap & cplData)
virtual

Initializes the acceleration.

Reimplemented from precice::acceleration::BaseQNAcceleration.

Definition at line 41 of file IQNILSAcceleration.cpp.

Here is the call graph for this function:

◆ removeMatrixColumn()

void precice::acceleration::IQNILSAcceleration::removeMatrixColumn ( int columnIndex)
privatevirtual

Removes one iteration from V,W matrices and adapts _matrixCols.

Reimplemented from precice::acceleration::BaseQNAcceleration.

Definition at line 270 of file IQNILSAcceleration.cpp.

Here is the call graph for this function:

◆ specializedIterationsConverged()

void precice::acceleration::IQNILSAcceleration::specializedIterationsConverged ( const DataMap & cplData)
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.

Here is the call graph for this function:

◆ updateDifferenceMatrices()

void precice::acceleration::IQNILSAcceleration::updateDifferenceMatrices ( const DataMap & cplData)
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.

Here is the call graph for this function:

Member Data Documentation

◆ _secondaryMatricesW

std::map<int, Eigen::MatrixXd> precice::acceleration::IQNILSAcceleration::_secondaryMatricesW
private

Definition at line 58 of file IQNILSAcceleration.hpp.

◆ _secondaryMatricesWBackup

std::map<int, Eigen::MatrixXd> precice::acceleration::IQNILSAcceleration::_secondaryMatricesWBackup
private

Definition at line 59 of file IQNILSAcceleration.hpp.

◆ _secondaryOldXTildes

std::map<int, Eigen::VectorXd> precice::acceleration::IQNILSAcceleration::_secondaryOldXTildes
private

Secondary data solver output from last iteration.

Definition at line 53 of file IQNILSAcceleration.hpp.


The documentation for this class was generated from the following files: