|
@@ -12,10 +12,9 @@
|
12
|
12
|
* @date 02/19/2015 01:10:39 PM
|
13
|
13
|
* @version $Id$
|
14
|
14
|
* @author Trevor Irons (ti)
|
15
|
|
- * @email Trevor.Irons@xri-geo.com
|
|
15
|
+ * @email Trevor.Irons@Lemmasoftware.org
|
16
|
16
|
* @copyright Copyright (c) 2015, XRI Geophysics, LLC
|
17
|
|
- * @copyright Copyright (c) 2015, Trevor Irons
|
18
|
|
- * @copyright Copyright (c) 2011, Trevor Irons
|
|
17
|
+ * @copyright Copyright (c) 2011, 2015, 2017, 2018 Trevor Irons
|
19
|
18
|
* @copyright Copyright (c) 2011, Colorado School of Mines
|
20
|
19
|
*/
|
21
|
20
|
|
|
@@ -247,7 +246,13 @@ namespace Lemma {
|
247
|
246
|
|
248
|
247
|
VectorXcr ADiv = D*A; // ADiv == RHS == D C^I Se
|
249
|
248
|
//VectorXcr Error = ((Cc.selfadjointView<Eigen::Lower>()*A).array() - Se.array());
|
|
249
|
+#if LOWER==1
|
|
250
|
+ std::cout << "Using Eigen::Lower to calculate Error" << std::endl;
|
250
|
251
|
VectorXcr Error = ((Cvec[iw].selfadjointView<Eigen::Lower>()*A).array() - Se.array());
|
|
252
|
+#elif UPPER==1
|
|
253
|
+ std::cout << "Using Eigen::Upper to calculate Error" << std::endl;
|
|
254
|
+ VectorXcr Error = ((Cvec[iw].selfadjointView<Eigen::Upper>()*A).array() - Se.array());
|
|
255
|
+#endif
|
251
|
256
|
logio << "|| Div(A) || = " << ADiv.norm()
|
252
|
257
|
<< "\tInital solution error="<< Error.norm() // Iteritive info
|
253
|
258
|
// << "\tSolver reported error="<< CSolver[iw].error() // Iteritive info
|
|
@@ -306,8 +311,13 @@ namespace Lemma {
|
306
|
311
|
|
307
|
312
|
// Report error of solutions
|
308
|
313
|
//Error = ((Cc.selfadjointView<Eigen::Lower>()*A).array() + E.array() - Se.array());
|
|
314
|
+#if LOWER==1
|
|
315
|
+ std::cout << "Using Eigen::Lower to calculate Error" << std::endl;
|
309
|
316
|
Error = ((Cvec[iw].selfadjointView<Eigen::Lower>()*A).array() + E.array() - Se.array());
|
310
|
|
-
|
|
317
|
+#elif UPPER==1
|
|
318
|
+ std::cout << "Using Eigen::Upper to calculate Error" << std::endl;
|
|
319
|
+ Error = ((Cvec[iw].selfadjointView<Eigen::Upper>()*A).array() + E.array() - Se.array());
|
|
320
|
+#endif
|
311
|
321
|
// << "\tSolver reported error="<< CSolver[iw].error() // Iteritive info
|
312
|
322
|
// << "\ttime " << timer.end() / 60. << " [m] "
|
313
|
323
|
// << CSolver[iw].iterations() << " iterations"
|
|
@@ -466,13 +476,14 @@ namespace Lemma {
|
466
|
476
|
}
|
467
|
477
|
|
468
|
478
|
template<>
|
469
|
|
- void EMSchur3D< Eigen::PardisoLDLT<Eigen::SparseMatrix<Complex, Eigen::ColMajor>, Eigen::Lower > >::BuildCDirectSolver() {
|
470
|
|
- CSolver = new Eigen::PardisoLDLT<Eigen::SparseMatrix<Complex, Eigen::ColMajor>, Eigen::Lower > [Omegas.size()];
|
|
479
|
+ void EMSchur3D< Eigen::PardisoLDLT<Eigen::SparseMatrix<Complex, Eigen::ColMajor>, Eigen::Symmetric > >::BuildCDirectSolver() {
|
|
480
|
+ CSolver = new Eigen::PardisoLDLT<Eigen::SparseMatrix<Complex, Eigen::ColMajor>, Eigen::Symmetric > [Omegas.size()];
|
471
|
481
|
for (int iw=0; iw<Omegas.size(); ++iw) {
|
472
|
482
|
jsw_timer timer;
|
473
|
483
|
timer.begin();
|
474
|
484
|
|
475
|
485
|
//CSolver[iw].pardisoParameterArray()[2] = 28; // OMP_NUM_THREADS?
|
|
486
|
+ //Eigen::SparseMatrix<Complex> Csym = Cvec[iw].selfadjointView< Eigen::Lower >();
|
476
|
487
|
|
477
|
488
|
/* Complex system */
|
478
|
489
|
std::cout << "PardisoLDLT pattern analyzing C_" << iw << ",";
|