|
@@ -215,7 +215,7 @@ namespace Lemma {
|
215
|
215
|
|
216
|
216
|
/////////////////////////////////////////
|
217
|
217
|
// Solve for RHS
|
218
|
|
- CSolver[iw].setMaxIterations(10000);
|
|
218
|
+ //CSolver[iw].setMaxIterations(750);
|
219
|
219
|
VectorXcr A = CSolver[iw].solve(Se);
|
220
|
220
|
|
221
|
221
|
// // Solve Real system instead
|
|
@@ -236,8 +236,9 @@ namespace Lemma {
|
236
|
236
|
logio << "|| Div(A) || = " << ADiv.norm()
|
237
|
237
|
// << " in " << iter_done << " iterations"
|
238
|
238
|
//<< " with error " << errorn << "\t"
|
239
|
|
- << "\tInital solution error "<< Error.norm() // Iteritive info
|
240
|
|
- << "\ttime " << timer.end() / 60. << " [m]" << std::endl;
|
|
239
|
+ << "\tInital solution error="<< Error.norm() // Iteritive info
|
|
240
|
+ << "\tSolver reported error="<< CSolver[iw].error() // Iteritive info
|
|
241
|
+ << "\ttime " << timer.end() / 60. << " [m] " << CSolver[iw].iterations() << " iterations" << std::endl;
|
241
|
242
|
|
242
|
243
|
//VectorXcr ADivMAC = ADiv.array() * MAC.array().cast<Complex>();
|
243
|
244
|
//logio << "|| Div(A) || on MAC grid " << ADivMAC.norm() << std::endl;
|
|
@@ -499,8 +500,8 @@ namespace Lemma {
|
499
|
500
|
CSolver = new Eigen::BiCGSTAB<Eigen::SparseMatrix<Complex, Eigen::RowMajor>, Eigen::IncompleteLUT<Complex> > [Omegas.size()];
|
500
|
501
|
for (int iw=0; iw<Omegas.size(); ++iw) {
|
501
|
502
|
Csym = Cvec[iw].selfadjointView<Eigen::Lower>();
|
502
|
|
- CSolver[iw].preconditioner().setDroptol(1e-12);
|
503
|
|
- CSolver[iw].preconditioner().setFillfactor(1e2);
|
|
503
|
+ CSolver[iw].preconditioner().setDroptol(1e-12); // 1e-12
|
|
504
|
+ CSolver[iw].preconditioner().setFillfactor(1e1); // 1e2
|
504
|
505
|
jsw_timer timer;
|
505
|
506
|
timer.begin();
|
506
|
507
|
/* Complex system */
|
|
@@ -559,26 +560,26 @@ namespace Lemma {
|
559
|
560
|
}
|
560
|
561
|
}
|
561
|
562
|
|
562
|
|
-// template<>
|
563
|
|
-// void EMSchur3D< Eigen::ConjugateGradient<Eigen::SparseMatrix<Complex, Eigen::RowMajor>, Eigen::Lower > > ::BuildCDirectSolver() {
|
564
|
|
-// CSolver = new Eigen::ConjugateGradient<Eigen::SparseMatrix<Complex, Eigen::RowMajor>, Eigen::Lower > [Omegas.size()];
|
565
|
|
-// for (int iw=0; iw<Omegas.size(); ++iw) {
|
566
|
|
-// //Csym = Cvec[iw].selfadjointView<Eigen::Lower>();
|
567
|
|
-// jsw_timer timer;
|
568
|
|
-// timer.begin();
|
569
|
|
-// /* Complex system */
|
570
|
|
-// std::cout << "ConjugateGradient pattern analyzing C_" << iw << ",";
|
571
|
|
-// std::cout.flush();
|
572
|
|
-// CSolver[iw].analyzePattern( Cvec[iw] );
|
573
|
|
-// std::cout << " done in " << timer.end() / 60. << " [m]" << std::endl;
|
574
|
|
-// // factorize
|
575
|
|
-// timer.begin();
|
576
|
|
-// std::cout << "ConjugateGradient factorising C_" << iw << ", ";
|
577
|
|
-// std::cout.flush();
|
578
|
|
-// CSolver[iw].factorize( Cvec[iw] );
|
579
|
|
-// std::cout << " done in " << timer.end() / 60. << " [m]" << std::endl;
|
580
|
|
-// }
|
581
|
|
-// }
|
|
563
|
+ template<>
|
|
564
|
+ void EMSchur3D< Eigen::ConjugateGradient<Eigen::SparseMatrix<Complex, Eigen::RowMajor>, Eigen::Lower > > ::BuildCDirectSolver() {
|
|
565
|
+ CSolver = new Eigen::ConjugateGradient<Eigen::SparseMatrix<Complex, Eigen::RowMajor>, Eigen::Lower > [Omegas.size()];
|
|
566
|
+ for (int iw=0; iw<Omegas.size(); ++iw) {
|
|
567
|
+ //Csym = Cvec[iw].selfadjointView<Eigen::Lower>();
|
|
568
|
+ jsw_timer timer;
|
|
569
|
+ timer.begin();
|
|
570
|
+ /* Complex system */
|
|
571
|
+ std::cout << "ConjugateGradient pattern analyzing C_" << iw << ",";
|
|
572
|
+ std::cout.flush();
|
|
573
|
+ CSolver[iw].analyzePattern( Cvec[iw] );
|
|
574
|
+ std::cout << " done in " << timer.end() / 60. << " [m]" << std::endl;
|
|
575
|
+ // factorize
|
|
576
|
+ timer.begin();
|
|
577
|
+ std::cout << "ConjugateGradient factorising C_" << iw << ", ";
|
|
578
|
+ std::cout.flush();
|
|
579
|
+ CSolver[iw].factorize( Cvec[iw] );
|
|
580
|
+ std::cout << " done in " << timer.end() / 60. << " [m]" << std::endl;
|
|
581
|
+ }
|
|
582
|
+ }
|
582
|
583
|
|
583
|
584
|
// template<>
|
584
|
585
|
// void EMSchur3D< Eigen::PastixLLT<Eigen::SparseMatrix<Complex, Eigen::RowMajor>, Eigen::Lower > > ::BuildCDirectSolver() {
|