XC Open source finite element analysis program
EigenSOE.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/EigenSOE.h
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 SystemOfEqn.
35 // It has pure virtual functions which must be implemented in it's derived
36 // subclasses. To solve the general eigen value equations means that
37 // by the given K and M, find the corresponding eigen value and eigen
38 // vectors.
39 //
40 // This class is inheritanted from the base class of SystemOfEqn
41 // which was created by fmk (Frank).
42 
43 
44 #ifndef EigenSOE_h
45 #define EigenSOE_h
46 
47 #include <solution/system_of_eqn/SystemOfEqn.h>
48 #include "/usr/include/boost/numeric/ublas/matrix_sparse.hpp"
49 
50 namespace XC {
51 class EigenSolver;
52 class Matrix;
53 class Vector;
54 class ID;
55 
59 //
61 //
63 class EigenSOE : public SystemOfEqn
64  {
65  public:
66  typedef boost::numeric::ublas::mapped_matrix<double> sparse_matrix;
67  protected:
68  int size;
69  bool factored;
70  sparse_matrix massMatrix;
71  EigenSolver *theSolver;
72 
73  void libera(void);
74  void copia(const EigenSolver *);
75  virtual bool setSolver(EigenSolver *);
76  void resize_mass_matrix_if_needed(const size_t &);
77 
78  EigenSOE(SoluMethod *,int classTag);
79  public:
80  virtual ~EigenSOE(void);
81 
82  int getNumEqn(void) const;
83 
84  virtual int solve(int numModes);
85  virtual int solve(void);
86 
87  // pure virtual functions
88  virtual int addA(const Matrix &, const ID &, double fact = 1.0) = 0;
89  virtual int addM(const Matrix &, const ID &, double fact = 1.0) = 0;
90 
91  virtual int setSize(Graph &theGraph) = 0;
92  virtual void zeroA(void) = 0;
93  virtual void zeroM(void);
94  virtual void identityM(void);
95 
96  const int &getNumModes(void) const;
97 
98  //Autovectores
99  virtual const Vector &getEigenvector(int mode) const;
100  Vector getNormalizedEigenvector(int mode) const;
101  Matrix getEigenvectors(void) const;
102  Matrix getNormalizedEigenvectors(void) const;
103 
104  //Eigenvalues
105  virtual const double &getEigenvalue(int mode) const;
106  double getAngularFrequency(int mode) const;
107  double getPeriodo(int mode) const;
108  double getFrecuencia(int mode) const;
109  Vector getEigenvalues(void) const;
110  Vector getAngularFrequencies(void) const;
111  Vector getPeriodos(void) const;
112  Vector getFrecuencias(void) const;
113 
114  //Modal participation factors.
115  virtual double getModalParticipationFactor(int mode) const;
117 
118  //Distribution factors.
119  Vector getDistributionFactor(int mode) const;
120  Matrix getDistributionFactors(void) const;
121 
122  //Effective modal masses
123  double getEffectiveModalMass(int mode) const;
124  Vector getEffectiveModalMasses(void) const;
125  double getTotalMass(void) const;
126 
127  //Equivalent static load.
128  Vector getEquivalentStaticLoad(int mode,const double &) const;
129 
130  EigenSolver *getSolver(void);
131  EigenSolver &newSolver(const std::string &);
132  };
133 } // end of XC namespace
134 
135 #endif
136 
137 
138 
Matrix getDistributionFactors(void) const
Returns a matrix with the computed distribution factors placed by columns.
Definition: EigenSOE.cpp:271
Matrix getEigenvectors(void) const
Returns a matriz con los eigenvectors calculados colocados por columnas.
Definition: EigenSOE.cpp:187
virtual bool setSolver(EigenSolver *)
Asigna the solver que se empleará para resolver the eigenproblem.
Definition: EigenSOE.cpp:89
int size
order of A
Definition: EigenSOE.h:68
int getNumEqn(void) const
Returns the number of equations.
Definition: EigenSOE.cpp:111
virtual int solve(void)
No hace nada.
Definition: EigenSOE.cpp:148
Definition: Vector.h:82
Solution procedure for the finite element problem. The solution procedure is definde by specifiying: ...
Definition: SoluMethod.h:76
Vector getModalParticipationFactors(void) const
Returns the modal participation factors.
Definition: EigenSOE.cpp:256
virtual void zeroM(void)
Anula la matriz M.
Definition: EigenSOE.cpp:159
Base class for eigenproblem systems of equations.
Definition: EigenSOE.h:63
Vector getEquivalentStaticLoad(int mode, const double &) const
Return the equivalennt static force for the mode being passed as parameter.
Definition: EigenSOE.cpp:327
System of equations base class.
Definition: SystemOfEqn.h:84
Definition: ID.h:77
double getEffectiveModalMass(int mode) const
Return the effective modal mass for the i-th mode.
Definition: EigenSOE.cpp:293
double getFrecuencia(int mode) const
Return the frecuency of the i-th mode.
Definition: EigenSOE.cpp:208
Vector getAngularFrequencies(void) const
Returns a vector with the computed angular frequencies for each mode.
Definition: EigenSOE.cpp:217
Definition: Matrix.h:82
Vector getEigenvalues(void) const
Returns a vector with computed eigenvalues for each mode.
Definition: EigenSOE.cpp:212
Vector getEffectiveModalMasses(void) const
Returns the effective modal masses for each mode.
Definition: EigenSOE.cpp:307
sparse_matrix massMatrix
Matriz de masas (se usa en getModalParticipationFactor).
Definition: EigenSOE.h:70
Vector getDistributionFactor(int mode) const
Returns the distribution factors for the i-th mode.
Definition: EigenSOE.cpp:266
Vector getFrecuencias(void) const
Returns a vector with the computed frequencies for each mode.
Definition: EigenSOE.cpp:228
Matrix getNormalizedEigenvectors(void) const
Returns a matriz con los eigenvectors normalizados colocados por columnas (norma_infinito).
Definition: EigenSOE.cpp:192
The Graph class provides the abstraction of a graph, a collection of vertices and edges...
Definition: Graph.h:84
double getTotalMass(void) const
Return the model total mass.
Definition: EigenSOE.cpp:317
virtual ~EigenSOE(void)
Destructor.
Definition: EigenSOE.cpp:134
double getAngularFrequency(int mode) const
Returns the angular frequency of the i-th mode.
Definition: EigenSOE.cpp:200
virtual const Vector & getEigenvector(int mode) const
Returns the autovector que corresponde al modo being passed as parameter.
Definition: EigenSOE.cpp:177
virtual void identityM(void)
Makes M the identity matrix (to find stiffness matrix eigenvalues).
Definition: EigenSOE.cpp:165
const int & getNumModes(void) const
Returns the number of computed eigenvalues.
Definition: EigenSOE.cpp:232
virtual double getModalParticipationFactor(int mode) const
Returns the modal participation factor for the mode.
Definition: EigenSOE.cpp:236
virtual const double & getEigenvalue(int mode) const
Returns the eigenvalue of the mode being passed as parameter.
Definition: EigenSOE.cpp:196
Eigenvalue SOE solver.
Definition: EigenSolver.h:59
double getPeriodo(int mode) const
Returns the period of the i-th mode.
Definition: EigenSOE.cpp:204
EigenSOE(SoluMethod *, int classTag)
Constructor.
Definition: EigenSOE.cpp:62
================================================================================
Definition: ContinuaReprComponent.h:34
Vector getNormalizedEigenvector(int mode) const
Returns the autovector que corresponde al modo being passed as parameter normalizado de modo que la c...
Definition: EigenSOE.cpp:182
EigenSolver * getSolver(void)
Returns a pointer to the solver que se emplea para resolver the eigenproblem.
Definition: EigenSOE.cpp:155
Vector getPeriodos(void) const
Returns a vector with the computed periods for each mode.
Definition: EigenSOE.cpp:223