xc
SymArpackSolver.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/linearSOE/LawSolver/SymArpackSolver.h
29 //
30 // Written: Jun Peng
31 // Created: 2/1999
32 // Revision: A
33 //
34 // Description: This file contains the class definition for
35 // SymArpackSolver. It solves the SymArpackSOE object by calling
36 // some "C" functions. The solver used here is generalized sparse
37 // solver. The user can choose three different ordering schema.
38 //
39 // What: "@(#) SymArpackSolver.h, revA"
40 
41 #ifndef SymArpackSolver_h
42 #define SymArpackSolver_h
43 
44 #include <solution/system_of_eqn/eigenSOE/EigenSolver.h>
45 #include "utility/matrix/Vector.h"
46 
47 namespace XC {
48 class SymArpackSOE;
49 
51 //
54  {
55  private:
56  SymArpackSOE *theSOE;
57  bool factored;
58 
59  Vector value;
60  Vector vector;
61  mutable Vector eigenV;
62 
63  void myMv(int n, double *v, double *result);
64  void myCopy(int n, double *v, double *result);
65  int getNCV(int n, int nev);
66 
67  friend class EigenSOE;
68  SymArpackSolver(int numE = 0);
69  virtual EigenSolver *getCopy(void) const;
70  bool setEigenSOE(EigenSOE *theSOE);
71  public:
72  virtual int solve(void);
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(Communicator &);
82  int recvSelf(const Communicator &);
83  };
84 
85 inline EigenSolver *SymArpackSolver::getCopy(void) const
86  { return new SymArpackSolver(*this); }
87 } // end of XC namespace
88 
89 #endif
90 
Float vector abstraction.
Definition: Vector.h:94
Arpack based symmetric matrix eigenvalue SOE solver.
Definition: SymArpackSolver.h:53
Base class for eigenproblem systems of equations.
Definition: EigenSOE.h:64
Communication parameters between processes.
Definition: Communicator.h:66
int sendSelf(Communicator &)
Send the object.
Definition: SymArpackSolver.cpp:360
const int & getSize(void) const
Return the eigenvectors dimension.
Definition: SymArpackSolver.cpp:241
Eigenvalue SOE solver.
Definition: EigenSolver.h:60
virtual const double & getEigenvalue(int mode) const
Returns the eigenvalue corresponding to the mode being passed as parameter.
Definition: SymArpackSolver.cpp:348
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
virtual int solve(void)
Solves the eigenproblem.
Definition: SymArpackSolver.cpp:79
int recvSelf(const Communicator &)
Receive the object.
Definition: SymArpackSolver.cpp:366
virtual int setSize(void)
Sets the size of the system.
Definition: SymArpackSolver.cpp:228
virtual const Vector & getEigenvector(int mode) const
Returns the autovector corresponding to the mode being passed as parameter.
Definition: SymArpackSolver.cpp:329
Arpack system of equations for symmetric matrices.
Definition: SymArpackSOE.h:61