Seismo-VLAB  1.3
An Open-Source Finite Element Software for Meso-Scale Simulations
MumpsSolver.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] A Fully Asynchronous Multifrontal Solver Using Distributed Dynamic
25 // Scheduling, P. R. Amestoy and I. S. Duff and J. Koster and J.-Y.
26 // L'Excellent, SIAM Journal on Matrix Analysis and Applications,
27 // volume 23 (1) 15-41, 2003.
28 // [2] Hybrid scheduling for the parallel solution of linear systems, P. R.
29 // Amestoy and A. Guermouche and J.-Y. L'Excellent and S. Pralet, Journal
30 // of Parallel Computing, volume 32(2), 136-156, 2006.
31 //
32 // Description:
33 // This file contains the "MumpsSolver" solver declaration; this object
34 // performs a (MU)ltifrontal (M)assively (P)arallel (S)parse direct Solver on
35 // the matrix A, assuming that such matrix is symmetric positive definite (SPD),
36 // general symmetric (SYM) or unsymmetric (USYM) matrix
37 //------------------------------------------------------------------------------
38 
39 #ifndef _MUMPSSOLVER_HPP_
40 #define _MUMPSSOLVER_HPP_
41 
43 #define JOB_INIT -1
44 
46 #define JOB_END -2
47 
49 #define USE_COMM_WORLD -987654
50 
52 #define ICNTL(I) icntl[(I)-1]
53 
54 #include <dmumps_c.h>
55 #include <Eigen/Dense>
56 #include <Eigen/SparseCore>
57 
58 #include "LinearSystem.hpp"
59 
61 
69 class MumpsSolver : public LinearSystem {
70 
71  public:
77  MumpsSolver(unsigned int option=1, bool flag = false);
78 
80  ~MumpsSolver();
81 
88  bool SolveSystem(Eigen::SparseMatrix<double> &A, Eigen::VectorXd &b);
89 
93  const Eigen::VectorXd& GetSolution();
94 
95  protected:
97  unsigned int nz;
98 
100  unsigned int Option;
101 
103  bool Flag;
104 
106  bool Factored;
107 
110 
112  Eigen::VectorXd x;
113 
115  DMUMPS_STRUC_C id;
116 };
117 
118 #endif
This file contains the abstract "LinearSystem object" declarations, which defines the library to solv...
const Eigen::VectorXd & GetSolution()
Gets the soultion vector.
MumpsSolver(unsigned int option=1, bool flag=false)
Creates a MumpsSolver object.
bool Flag
Analysis flag.
Definition: MumpsSolver.hpp:103
Class for solving a linear system using the (MU)ltifrontal (M)assively (P)arallel (S)parse direct Sol...
Definition: MumpsSolver.hpp:69
unsigned int nz
Number of non-zero values.
Definition: MumpsSolver.hpp:97
Eigen::VectorXd x
Vector of unknowns.
Definition: MumpsSolver.hpp:112
bool SolveSystem(Eigen::SparseMatrix< double > &A, Eigen::VectorXd &b)
Solve the linear system.
bool Initialized
MUMPS Initialization Flag.
Definition: MumpsSolver.hpp:109
DMUMPS_STRUC_C id
MUMPS Structure of parameters.
Definition: MumpsSolver.hpp:115
Virtual class for solving a linear system of the form Ax = b.
Definition: LinearSystem.hpp:44
unsigned int Option
Matrix structure 0: SPD, 1:Symmetric, 0: Unsymmetric.
Definition: MumpsSolver.hpp:100
~MumpsSolver()
Destroys this MumpsSolver object.
bool Factored
MUMPS Factorization Flag.
Definition: MumpsSolver.hpp:106