XC Open source finite element analysis program
SymArpackSolver.h
1 //----------------------------------------------------------------------------
2 // XC program; finite element analysis code
3 // for structural analysis and design.
4 //
5 // Copyright (C) Luis Claudio Pérez Tato
6 //
7 // This program derives from OpenSees <http://opensees.berkeley.edu>
8 // developed by the «Pacific earthquake engineering research center».
9 //
10 // Except for the restrictions that may arise from the copyright
11 // of the original program (see copyright_opensees.txt)
12 // XC is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // This software is distributed in the hope that it will be useful, but
18 // WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 //
23 // You should have received a copy of the GNU General Public License
24 // along with this program.
25 // If not, see <http://www.gnu.org/licenses/>.
26 //----------------------------------------------------------------------------
27 // File: ~/system_of_eqn/linearSOE/LawSolver/SymArpackSolver.h
28 //
29 // Written: Jun Peng
30 // Created: 2/1999
31 // Revision: A
32 //
33 // Description: This file contains the class definition for
34 // SymArpackSolver. It solves the SymArpackSOE object by calling
35 // some "C" functions. The solver used here is generalized sparse
36 // solver. The user can choose three different ordering schema.
37 //
38 // What: "@(#) SymArpackSolver.h, revA"
39 
40 #ifndef SymArpackSolver_h
41 #define SymArpackSolver_h
42 
43 #include <solution/system_of_eqn/eigenSOE/EigenSolver.h>
44 #include "utility/matrix/Vector.h"
45 
46 namespace XC {
47 class SymArpackSOE;
48 
50 //
53  {
54  private:
55  SymArpackSOE *theSOE;
56  bool factored;
57 
58  Vector value;
59  Vector vector;
60  mutable Vector eigenV;
61 
62  void myMv(int n, double *v, double *result);
63  void myCopy(int n, double *v, double *result);
64  int getNCV(int n, int nev);
65 
66  friend class EigenSOE;
67  SymArpackSolver(int numE = 0);
68  virtual EigenSolver *getCopy(void) const;
69  bool setEigenSOE(EigenSOE *theSOE);
70  public:
71  virtual int solve(void);
72  virtual int solve(int numModes) {return this->solve();};
73  virtual int setSize(void);
74  const int &getSize(void) const;
75 
76  virtual bool setEigenSOE(SymArpackSOE &theSOE);
77 
78  virtual const Vector &getEigenvector(int mode) const;
79  virtual const double &getEigenvalue(int mode) const;
80 
81  int sendSelf(CommParameters &);
82  int recvSelf(const CommParameters &);
83  };
84 
85 inline EigenSolver *SymArpackSolver::getCopy(void) const
86  { return new SymArpackSolver(*this); }
87 } // end of XC namespace
88 
89 #endif
90 
Arpack system of equations for symmetric matrices.
Definition: SymArpackSOE.h:60
virtual int setSize(void)
Sets the size of the system.
Definition: SymArpackSolver.cpp:219
Definition: Vector.h:82
Arpack based symmetric matrix eigenvalue SOE solver.
Definition: SymArpackSolver.h:52
Base class for eigenproblem systems of equations.
Definition: EigenSOE.h:63
int numModes
number of eigenvalues to compute.
Definition: EigenSolver.h:62
const int & getSize(void) const
Return the eigenvectors dimension.
Definition: SymArpackSolver.cpp:232
virtual const double & getEigenvalue(int mode) const
Returns the autovalor correspondiente al modo being passed as parameter.
Definition: SymArpackSolver.cpp:337
Communication parameters between processes.
Definition: CommParameters.h:65
Eigenvalue SOE solver.
Definition: EigenSolver.h:59
virtual const Vector & getEigenvector(int mode) const
Returns the autovector correspondiente al modo being passed as parameter.
Definition: SymArpackSolver.cpp:319
================================================================================
Definition: ContinuaReprComponent.h:34
virtual int solve(void)
Solves the eigenproblem.
Definition: SymArpackSolver.cpp:79