xc
KEigenAlgo.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 
29 #ifndef KEigenAlgo_h
30 #define KEigenAlgo_h
31 
32 #include <solution/analysis/algorithm/eigenAlgo/EigenAlgorithm.h>
33 
34 namespace XC {
35 class KEigenIntegrator;
36 
38 //
41  {
42  protected:
43  int ns;
44  int nl;
46  //triggering analysis;
47  mutable double rcond;
48  mutable std::deque<Vector> eigenvectors;
49  mutable std::deque<double> eigenvalues;
50 
52  virtual void eigen_to_model(void);
53 
54  friend class SolutionStrategy;
56  virtual SolutionAlgorithm *getCopy(void) const;
57  int form_matrices(void);
58  int dump_modes(void);
59  int compute_eigenvalues(int numEigen, bool findSmallest);
62  public:
63  virtual int solveCurrentStep(int numModes);
64  inline int getNs(void) const
65  { return ns; }
66  inline void setNs(int n)
67  { ns= n; }
68  inline int getNl(void) const
69  { return nl; }
70  inline void setNl(int n)
71  { nl= n; }
72  inline double getConditionNumberThreshold(void) const
73  { return condNumberThreshold; }
74  inline void setConditionNumberThreshold(double d)
75  { condNumberThreshold= d; }
76  inline double getRCond(void) const
77  { return rcond; }
78  inline void setRCond(double d)
79  { rcond= d; }
80  virtual void Print(std::ostream &s, int flag = 0) const;
81  virtual int sendSelf(Communicator &);
82  virtual int recvSelf(const Communicator &);
83  };
84 inline SolutionAlgorithm *KEigenAlgo::getCopy(void) const
85  { return new KEigenAlgo(*this); }
86 } // end of XC namespace
87 
88 #endif
89 
90 
Base class for solution algorithms.
Definition: SolutionAlgorithm.h:91
Communication parameters between processes.
Definition: Communicator.h:66
double rcond
computed reciprocal condition number.
Definition: KEigenAlgo.h:47
Integrator used to obtain the eigenvalues and eigenvectors of the stiffness matrix.
Definition: KEigenIntegrator.h:60
KEigenIntegrator * getKEigenIntegrator(void)
Returns, if possible, a pointer to a suitable integrator.
Definition: KEigenAlgo.cc:37
virtual int recvSelf(const Communicator &)
Receive.
Definition: KEigenAlgo.cc:236
KEigenAlgo(SolutionStrategy *)
Constructor.
Definition: KEigenAlgo.cc:52
int nl
number of largest eigenpairs
Definition: KEigenAlgo.h:44
virtual void eigen_to_model(void)
Dump the eigenvalues into the model (see Finite Element Procedures.
Definition: KEigenAlgo.cc:206
int compute_largest_eigenvalues(void)
Compute the nl largest eigenvalues.
Definition: KEigenAlgo.cc:145
Solution algorithm for eigenproblem.
Definition: EigenAlgorithm.h:84
int dump_modes(void)
Put the computed eigen values into the eigenvalues member and the computed eigen vectors into the eig...
Definition: KEigenAlgo.cc:108
double condNumberThreshold
condition number threshold for
Definition: KEigenAlgo.h:45
Solution strategy for the finite element problem.
Definition: SolutionStrategy.h:94
int compute_smallest_eigenvalues(void)
Compute the ns smallest eigenvalues.
Definition: KEigenAlgo.cc:131
virtual int solveCurrentStep(int numModes)
Solves the current step.
Definition: KEigenAlgo.cc:164
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
int form_matrices(void)
Compute the smallest or largest eigenvalues.
Definition: KEigenAlgo.cc:56
int ns
number of smallest eigenpairs
Definition: KEigenAlgo.h:43
virtual int sendSelf(Communicator &)
Send.
Definition: KEigenAlgo.cc:232
int compute_eigenvalues(int numEigen, bool findSmallest)
Compute the smallest or largest eigenvalues.
Definition: KEigenAlgo.cc:82
virtual void Print(std::ostream &s, int flag=0) const
Print the object.
Definition: KEigenAlgo.cc:228
Algorithm for ill-conditioning analysis.
Definition: KEigenAlgo.h:40