Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
EigenSolver.hpp
Go to the documentation of this file.
1 //==============================================================================
2 //
3 // Seismo Virtual Laboratory
4 // Module for Serial and Parallel Analysis of seismic
5 // wave propagation and soil-structure interaction simulation
6 // Copyright (C) 2018-2021, The California Institute of Technology
7 // All Rights Reserved.
8 //
9 // Commercial use of this program without express permission of the California
10 // Institute of Technology, is strictly prohibited. See file "COPYRIGHT" in
11 // main directory for information on usage and redistribution, and for a
12 // DISCLAIMER OF ALL WARRANTIES.
13 //
14 //==============================================================================
15 //
16 // Written by:
17 // Danilo S. Kusanovic (dkusanov@caltech.edu)
18 // Elnaz E. Seylabi (elnaze@unr.edu)
19 //
20 // Supervised by:
21 // Domniki M. Asimaki (domniki@caltech.edu)
22 //
23 // References :
24 // [1] https://eigen.tuxfamily.org/dox/group__TopicSparseSystems.html
25 //
26 // Description:
31 //------------------------------------------------------------------------------
32 
33 #ifndef _EIGENSOLVER_HPP_
34 #define _EIGENSOLVER_HPP_
35 
36 #include <Eigen/Dense>
37 #include <Eigen/SparseCore>
38 #include <Eigen/SparseCholesky>
39 
40 #include "LinearSystem.hpp"
41 
49 class EigenSolver : public LinearSystem {
50 
51  public:
56  EigenSolver(bool flag = false);
57 
59  ~EigenSolver();
60 
67  bool SolveSystem(Eigen::SparseMatrix<double> &A, Eigen::VectorXd &b);
68 
72  const Eigen::VectorXd& GetSolution();
73 
74  protected:
76  bool Flag;
77 
79  bool Factored;
80 
83 
85  Eigen::VectorXd x;
86 
88  Eigen::SimplicialLDLT<Eigen::SparseMatrix<double> > Solver;
89 };
90 
91 #endif
This file contains the abstract "LinearSystem object" declarations, which defines the library to solv...
~EigenSolver()
Destroys this EigenSolver object.
Eigen::VectorXd x
Vector of unknowns.
Definition: EigenSolver.hpp:85
Eigen::SimplicialLDLT< Eigen::SparseMatrix< double > > Solver
Direct LDLT factorization solver.
Definition: EigenSolver.hpp:88
bool Initialized
Eigen Initialization Flag.
Definition: EigenSolver.hpp:82
Class for solving a linear system using a Cholesky-decomposition on the effective stiffness matrix...
Definition: EigenSolver.hpp:49
bool Flag
Analysis flag.
Definition: EigenSolver.hpp:76
bool SolveSystem(Eigen::SparseMatrix< double > &A, Eigen::VectorXd &b)
Solve the linear system.
Virtual class for solving a linear system of the form Ax = b.
Definition: LinearSystem.hpp:44
const Eigen::VectorXd & GetSolution()
Gets the soultion vector.
bool Factored
Eigen Factorization Flag.
Definition: EigenSolver.hpp:79
EigenSolver(bool flag=false)
Creates a EigenSolver object.