xc
BandArpackSolver.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 // File: ~/system_of_eqn/eigenSOE/BandArpackSolver.h
29 //
30 // Written: Jun Peng
31 // Created: Feb. 11, 1999
32 // Revision: A
33 //
34 // Description: This file contains the class definition for
35 // BandArpackSolver. It solves the BandArpackSOE object by calling
36 // Arpack routines.
37 
38 
39 #ifndef BandArpackSolver_h
40 #define BandArpackSolver_h
41 
42 #include <solution/system_of_eqn/eigenSOE/EigenSolver.h>
43 #include <solution/system_of_eqn/eigenSOE/BandArpackSOE.h>
44 
45 namespace XC {
46 
50  {
51  int ldv;
52  int lworkl;
53  std::vector<double> v;
54  std::vector<double> workl;
55  std::vector<double> workd;
56  Vector d;
57  Vector z;
58  std::vector<double> resid;
59  int iparam[11];
60  int ipntr[11];
61  std::vector<long int> select;
62  const char bmat= 'G';
63  const char howmy= 'A';
64 
65  ArpackAuxVars(int n, int ncv, int nev, int maxitr, int mode);
66  int dsaupd(int &ido, const int &n, const std::string &which, const int &nev, const double &tol,
67  const int &ncv, int &info);
68  };
69 
75  {
76  private:
77  BandArpackSOE *theSOE;
78  Vector value;
79  Vector eigenvector;
80  double tol;
81  int maxitr;
82  ID iPiv;
83  mutable Vector eigenV;
84 
85  void myMv(int n, double *v, double *result);
86  void myCopy(int n, double *v, double *result);
87  int dsaupd_loop(const int &ncv, const int &nev,ArpackAuxVars &);
88  int getNCV(int n, int nev);
89 
90  static std::string get_err_string(int);
91  static std::string dsaupd_err_string(int);
92  static std::string dseupd_err_string(int);
93  protected:
94 
95 
96  friend class EigenSOE;
97  BandArpackSolver(int numE = 0);
98  virtual EigenSolver *getCopy(void) const;
99  bool setEigenSOE(EigenSOE *theSOE);
100  public:
101 
102  virtual int solve(void);
103  virtual int setSize(void);
104  const int &getSize(void) const;
105  virtual bool setEigenSOE(BandArpackSOE &theSOE);
106 
107  virtual const Vector &getEigenvector(int mode) const;
108  virtual const double &getEigenvalue(int mode) const;
109 
110  double getRCond(const char &);
111 
112  int sendSelf(Communicator &);
113  int recvSelf(const Communicator &);
114  };
115 
116 inline EigenSolver *BandArpackSolver::getCopy(void) const
117  { return new BandArpackSolver(*this); }
118 } // end of XC namespace
119 
120 #endif
121 
122 
std::vector< double > resid
residual vector.
Definition: BandArpackSolver.h:58
ArpackAuxVars(int n, int ncv, int nev, int maxitr, int mode)
Constructor.
Definition: BandArpackSolver.cpp:101
Float vector abstraction.
Definition: Vector.h:94
int lworkl
at least NCV**2+8*NCV
Definition: BandArpackSolver.h:52
Base class for eigenproblem systems of equations.
Definition: EigenSOE.h:64
Communication parameters between processes.
Definition: Communicator.h:66
int ipntr[11]
Pointer to mark the starter location in the workd and workl arrays for matrices/vectors used by the L...
Definition: BandArpackSolver.h:60
std::vector< double > v
Lanczos basis vectors.
Definition: BandArpackSolver.h:53
BandArpackSOE is a subclass of ArpackSOE.
Definition: BandArpackSOE.h:52
Vector of integers.
Definition: ID.h:95
std::vector< double > workd
Reverse communication.
Definition: BandArpackSolver.h:55
Eigenvalue SOE solver.
Definition: EigenSolver.h:60
Auxiliary variables for calling Arpack functions.
Definition: BandArpackSolver.h:49
std::vector< double > workl
Private (replicated) array of each PE or array allocated on the front end.
Definition: BandArpackSolver.h:54
int dsaupd(int &ido, const int &n, const std::string &which, const int &nev, const double &tol, const int &ncv, int &info)
Reverse communication interface for the Implicitly Restarted Arnoldi Iteration.
Definition: BandArpackSolver.cpp:118
const char bmat
&#39;G&#39;: generalized eigenvalue problem A*x= lambda*B*x
Definition: BandArpackSolver.h:62
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Arpack solver for banded matrices.
Definition: BandArpackSolver.h:74
int iparam[11]
Method for selecting the implicit shifts.
Definition: BandArpackSolver.h:59