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

Preconditioner that uses the constant user-defined factors to scale the quasi-Newton system. More...

#include <ConstantPreconditioner.hpp>

Inheritance diagram for precice::acceleration::impl::ConstantPreconditioner:
[legend]
Collaboration diagram for precice::acceleration::impl::ConstantPreconditioner:
[legend]

Public Member Functions

 ConstantPreconditioner (std::vector< double > factors)
 
virtual ~ConstantPreconditioner ()
 Destructor, empty.
 
virtual void initialize (std::vector< size_t > &svs)
 initialize the preconditioner
 
- Public Member Functions inherited from precice::acceleration::impl::Preconditioner
 Preconditioner (int maxNonConstTimeWindows)
 
virtual ~Preconditioner ()
 Destructor, empty.
 
void apply (Eigen::MatrixXd &M, bool transpose)
 Apply preconditioner to matrix.
 
void revert (Eigen::MatrixXd &M, bool transpose)
 Apply inverse preconditioner to matrix.
 
void apply (Eigen::MatrixXd &M)
 To transform physical values to balanced values. Matrix version.
 
void apply (Eigen::VectorXd &v)
 To transform physical values to balanced values. Vector version.
 
void revert (Eigen::MatrixXd &M)
 To transform balanced values back to physical values. Matrix version.
 
void revert (Eigen::VectorXd &v)
 To transform balanced values back to physical values. Vector version.
 
void update (bool timeWindowComplete, const Eigen::VectorXd &oldValues, const Eigen::VectorXd &res)
 Update the scaling after every FSI iteration and require a new QR decomposition (if necessary)
 
bool requireNewQR ()
 returns true if a QR decomposition from scratch is necessary
 
void newQRfulfilled ()
 to tell the preconditioner that QR-decomposition has been recomputed
 
std::vector< double > & getWeights ()
 
bool isConst ()
 

Private Member Functions

virtual void _update_ (bool timeWindowComplete, const Eigen::VectorXd &oldValues, const Eigen::VectorXd &res)
 Update the scaling after every FSI iteration.
 

Private Attributes

logging::Logger _log {"acceleration::ConstantPreconditioner"}
 
std::vector< double > _factors
 Constant user-defined factors to scale the quasi-Newton system.
 

Additional Inherited Members

- Protected Attributes inherited from precice::acceleration::impl::Preconditioner
std::vector< double > _weights
 Weights used to scale the matrix V and the residual.
 
std::vector< double > _invWeights
 Inverse weights (for efficiency reasons)
 
std::vector< size_t > _subVectorSizes
 Sizes of each sub-vector, i.e. each coupling data.
 
int _maxNonConstTimeWindows
 maximum number of non-const time windows, i.e., after this number of time windows, the preconditioner is frozen with the current weights and becomes a constant preconditioner
 
int _nbNonConstTimeWindows = 0
 Counts the number of completed time windows with a non-const weighting.
 
bool _requireNewQR = false
 True if a QR decomposition from scratch is necessary.
 
bool _frozen = false
 True if _nbNonConstTimeWindows >= _maxNonConstTimeWindows, i.e., preconditioner is not updated any more.
 

Detailed Description

Preconditioner that uses the constant user-defined factors to scale the quasi-Newton system.

Definition at line 15 of file ConstantPreconditioner.hpp.

Constructor & Destructor Documentation

◆ ConstantPreconditioner()

precice::acceleration::impl::ConstantPreconditioner::ConstantPreconditioner ( std::vector< double > factors)
explicit

Definition at line 10 of file ConstantPreconditioner.cpp.

◆ ~ConstantPreconditioner()

virtual precice::acceleration::impl::ConstantPreconditioner::~ConstantPreconditioner ( )
inlinevirtual

Destructor, empty.

Definition at line 22 of file ConstantPreconditioner.hpp.

Member Function Documentation

◆ _update_()

void precice::acceleration::impl::ConstantPreconditioner::_update_ ( bool timeWindowComplete,
const Eigen::VectorXd & oldValues,
const Eigen::VectorXd & res )
privatevirtual

Update the scaling after every FSI iteration.

Parameters
[in]timeWindowCompleteTrue if this FSI iteration also completed a time window

Implements precice::acceleration::impl::Preconditioner.

Definition at line 37 of file ConstantPreconditioner.cpp.

◆ initialize()

void precice::acceleration::impl::ConstantPreconditioner::initialize ( std::vector< size_t > & svs)
virtual

initialize the preconditioner

Parameters
sizeof the pp system (e.g. rows of V)

Reimplemented from precice::acceleration::impl::Preconditioner.

Definition at line 16 of file ConstantPreconditioner.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ _factors

std::vector<double> precice::acceleration::impl::ConstantPreconditioner::_factors
private

Constant user-defined factors to scale the quasi-Newton system.

Definition at line 37 of file ConstantPreconditioner.hpp.

◆ _log

logging::Logger precice::acceleration::impl::ConstantPreconditioner::_log {"acceleration::ConstantPreconditioner"}
private

Definition at line 34 of file ConstantPreconditioner.hpp.


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