Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
SchurComplementSolver.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_SchurComplementSolver_H_
9#define model_SchurComplementSolver_H_
10
11#include <Eigen/Dense>
12
13namespace model
14{
15
62 {
63
64 /* constructor ********************************************************/
65 void checkDecomposition() const;
66
67 public:
69 const Eigen::LLT<Eigen::MatrixXd> llt;
70
72 const Eigen::PartialPivLU<Eigen::MatrixXd> pplu;
73
75 Eigen::VectorXd L;
76
78 Eigen::VectorXd X;
79
80 /* constructor with Fp ************************************************/
81 SchurComplementSolver(const Eigen::MatrixXd &KQQ, const Eigen::MatrixXd &KPQ, const Eigen::VectorXd &Fq,
82 const Eigen::VectorXd &Fp);
83
84 /* constructor without Fp *********************************************/
85 SchurComplementSolver(const Eigen::MatrixXd &KQQ, const Eigen::MatrixXd &KPQ, const Eigen::VectorXd &Fq);
86
87 // /* constructor without Fp *********************************************/
88 // SchurComplementSolver(const Eigen::MatrixXd& KQQ,
89 // /* */ const Eigen::MatrixXd& KPQ) :
90 // /* init list */ llt(KQQ),
91 // /* init list */ pplu(KPQ*llt.solve(KPQ.transpose())){
92 // checkDecomposition();
93 // }
94
95 // /* constructor without Fp *********************************************/
96 // void solve(const Eigen::VectorXd& Fq) {
97 // L=pplu.solve(KPQ*llt.solve(Fq));
98 // X=llt.solve(Fq-KPQ.transpose()*L);
99 // }
100 //
101 // /* constructor without Fp *********************************************/
102 // void solve(const Eigen::VectorXd& KPQ, const Eigen::VectorXd& Fq, const Eigen::VectorXd& Fp) {
103 // L=pplu.solve(KPQ*llt.solve(Fq)-Fp);
104 // X=llt.solve(Fq-KPQ.transpose()*L);
105 // }
106 };
107
108} // namespace model
109#endif
const Eigen::LLT< Eigen::MatrixXd > llt
The LLT decomposition of KQQ.
const Eigen::PartialPivLU< Eigen::MatrixXd > pplu
the partial-pivot LU decomposition of KPQ*inv(KQQ)*KPQ^T
Eigen::VectorXd X
The solution vector.
SchurComplementSolver(const Eigen::MatrixXd &KQQ, const Eigen::MatrixXd &KPQ, const Eigen::VectorXd &Fq, const Eigen::VectorXd &Fp)
Eigen::VectorXd L
The vector of Lagrange multipliers.