XC Open source finite element analysis program
EigenSolver.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/eigenSOE/EigenSolver.C
28 //
29 // Written: Jun Peng
30 // Created: Sat Feb. 6, 1999
31 // Revision: A
32 //
33 // Description: This file contains the class definition of EigenSOE.
34 // EigenSOE is a subclass of Solver.
35 // This is an abstract base class and thus no objects of it's type
36 // can be instantiated. Instances of EigenSolver are used to solve
37 // a EigenSOE. (perform eigen analysis)
38 //
39 // This class is inheritanted from the base class of Solver
40 // which was created by fmk (Frank).
41 
42 
43 #ifndef EigenSolver_h
44 #define EigenSolver_h
45 
46 #include <solution/system_of_eqn/Solver.h>
47 
48 namespace XC {
49 class EigenSOE;
50 class Vector;
51 
55 //
57 //
59 class EigenSolver : public Solver
60  {
61  protected:
62  int numModes;
63 
64  friend class EigenSOE;
65  virtual EigenSolver *getCopy(void) const= 0;
66  virtual bool setEigenSOE(EigenSOE *theSOE) = 0;
67  EigenSolver(const int &classTag, const int &nModes= 0);
68  public:
69  virtual ~EigenSolver(void)
70  {}
71 
72  virtual int solve(void) =0;
73  virtual int solve(int numModes) =0;
74 
75  const int &getNumModes(void) const
76  { return numModes; }
77  virtual const Vector &getEigenvector(int mode) const = 0;
78  Vector getNormalizedEigenvector(int mode) const;
79  Matrix getEigenvectors(void) const;
81  virtual const double &getEigenvalue(int mode) const= 0;
82  double getAngularFrequency(int mode) const;
83  double getPeriodo(int mode) const;
84  double getFrecuencia(int mode) const;
85  Vector getEigenvalues(void) const;
86  Vector getAngularFrequencies(void) const;
87  Vector getPeriodos(void) const;
88  Vector getFrecuencias(void) const;
89 
90  virtual int setSize(void)= 0;
91  virtual const int &getSize(void) const= 0;
92  };
93 } // end of XC namespace
94 
95 #endif
Vector getAngularFrequencies(void) const
Returns a vector with the computed angular frequencies for each mode.
Definition: EigenSolver.cpp:76
Matrix getEigenvectors(void) const
Returns a matrix of eigenvectors placed in columns.
Definition: EigenSolver.cpp:113
Definition: Vector.h:82
Matrix getNormalizedEigenvectors(void) const
Returns a matriz con los eigenvectors normalizados colocados por columnas (norma_infinito).
Definition: EigenSolver.cpp:128
Vector getFrecuencias(void) const
Returns a vector with the computed frequencies for each mode.
Definition: EigenSolver.cpp:98
Vector getNormalizedEigenvector(int mode) const
Returns the autovector of the i-th mode normalized so the maximal component is 1 (norma_infinito).
Definition: EigenSolver.cpp:109
Base class for eigenproblem systems of equations.
Definition: EigenSOE.h:63
int numModes
number of eigenvalues to compute.
Definition: EigenSolver.h:62
double getPeriodo(int mode) const
Returns the period for the i-th mode.
Definition: EigenSolver.cpp:58
Definition: Matrix.h:82
EigenSolver(const int &classTag, const int &nModes=0)
Constructor.
Definition: EigenSolver.cpp:50
Equation solver.
Definition: Solver.h:81
Vector getEigenvalues(void) const
Returns a vector con los eigenvalues calculados.
Definition: EigenSolver.cpp:66
Eigenvalue SOE solver.
Definition: EigenSolver.h:59
================================================================================
Definition: ContinuaReprComponent.h:34
Vector getPeriodos(void) const
Returns a vector with the computed periods for each mode.
Definition: EigenSolver.cpp:87
double getFrecuencia(int mode) const
Return the frecuency for the i-th mode.
Definition: EigenSolver.cpp:62
double getAngularFrequency(int mode) const
Return the angular frequency for the i-th mode.
Definition: EigenSolver.cpp:54