xc
LinearSOE.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 ** OpenSees - Open System for Earthquake Engineering Simulation **
30 ** Pacific Earthquake Engineering Research Center **
31 ** **
32 ** **
33 ** (C) Copyright 1999, The Regents of the University of California **
34 ** All Rights Reserved. **
35 ** **
36 ** Commercial use of this program without express permission of the **
37 ** University of California, Berkeley, is strictly prohibited. See **
38 ** file 'COPYRIGHT' in main directory for information on usage and **
39 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
40 ** **
41 ** Developed by: **
42 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
43 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
44 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
45 ** **
46 ** ****************************************************************** */
47 
48 // $Revision: 1.4 $
49 // $Date: 2005/12/01 01:12:55 $
50 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/LinearSOE.h,v $
51 
52 
53 #ifndef LinearSOE_h
54 #define LinearSOE_h
55 
56 // File: ~/system_of_eqn/LinearSOE.h
57 //
58 // Written: fmk
59 // Created: 11/96
60 // Revision: A
61 //
62 //
63 // What: "@(#) LinearSOE.h, revA"
64 
65 #include <solution/system_of_eqn/SystemOfEqn.h>
66 
67 namespace XC {
68 class LinearSOESolver;
69 class Matrix;
70 class Vector;
71 class ID;
72 
76 //
78 //
92 class LinearSOE: public SystemOfEqn
93  {
94  private:
95  LinearSOESolver *theSolver;
96  void free_memory(void);
97  void copy(const LinearSOESolver *);
98  protected:
99  friend class FEM_ObjectBroker;
100  virtual bool setSolver(LinearSOESolver *);
101  int setSolverSize(void);
102 
103  LinearSOE(SolutionStrategy *,int classTag);
104  public:
105  virtual ~LinearSOE(void);
106 
107  virtual int solve(void);
108 
116  virtual int setSize(Graph &theGraph) =0;
118  virtual int getNumEqn(void) const =0;
119 
128  virtual int addA(const Matrix &M, const ID &loc, double fact = 1.0) =0;
129 
136  virtual int addB(const Vector &V, const ID &loc,const double &fact= 1.0) =0;
137 
141  virtual int setB(const Vector &V, const double &fact= 1.0) =0;
142 
145  virtual void zeroA(void) =0;
148  virtual void zeroB(void) =0;
149 
151  virtual const Vector &getX(void) const= 0;
153  virtual const Vector &getB(void) const= 0;
154  virtual double getDeterminant(void);
155  virtual double getRCond(const char &norm= '1');
157  virtual double normRHS(void) const= 0;
158 
162  virtual void setX(int loc, double value) =0;
164  virtual void setX(const Vector &X) =0;
165 
166  LinearSOESolver *getSolver(void);
167  LinearSOESolver &newSolver(const std::string &);
168  };
169 } // end of XC namespace
170 
171 
172 #endif
virtual void zeroB(void)=0
To zero the vector , i.e.
Float vector abstraction.
Definition: Vector.h:94
virtual int solve(void)
Computes the solution of the system of equations.
Definition: LinearSOE.cpp:224
virtual int setB(const Vector &V, const double &fact=1.0)=0
The LinearSOE object sets the vector b to be fact times the vector V.
virtual bool setSolver(LinearSOESolver *)
Sets the solver for the system of equations.
Definition: LinearSOE.cpp:145
virtual ~LinearSOE(void)
Destructor.
Definition: LinearSOE.cpp:214
virtual void zeroA(void)=0
To zero the matrix , i.e.
Linear system of equations.
Definition: LinearSOE.h:92
LinearSOE(SolutionStrategy *, int classTag)
Constructor.
Definition: LinearSOE.cpp:109
virtual int addA(const Matrix &M, const ID &loc, double fact=1.0)=0
The LinearSOE object assembles fact times the Matrix M into the matrix $A$.
FEM_ObjectBroker is is an object broker class for the finite element method.
Definition: FEM_ObjectBroker.h:151
Vector of integers.
Definition: ID.h:95
virtual int addB(const Vector &V, const ID &loc, const double &fact=1.0)=0
The LinearSOE object assembles fact times the Vector V into the vector $b$.
virtual int getNumEqn(void) const =0
Returns the number of equations in the system.
System of equations base class.
Definition: SystemOfEqn.h:90
virtual const Vector & getB(void) const =0
Return a const reference to the vector .
The Graph class provides the abstraction of a graph.
Definition: Graph.h:94
virtual int setSize(Graph &theGraph)=0
Determines and sets the size of the system.
virtual double getDeterminant(void)
Returns the determinant of the system matrix.
Definition: LinearSOE.cpp:228
virtual double getRCond(const char &norm='1')
Returns the reciprocal of the condition number.
Definition: LinearSOE.cpp:238
Solution strategy for the finite element problem.
Definition: SolutionStrategy.h:94
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class of the solvers for linear system of equations.
Definition: LinearSOESolver.h:87
LinearSOESolver * getSolver(void)
Returns a pointer to the solver.
Definition: LinearSOE.cpp:243
Matrix of floats.
Definition: Matrix.h:111
int setSolverSize(void)
invoke setSize() on the Solver
Definition: LinearSOE.cpp:247
virtual void setX(int loc, double value)=0
The LinearSOE object is responsible for setting .
virtual const Vector & getX(void) const =0
Return a const reference to the vector .
virtual double normRHS(void) const =0
Return the 2-norm of the vector .