xc
LinearSOE.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 /* ****************************************************************** **
28 ** OpenSees - Open System for Earthquake Engineering Simulation **
29 ** Pacific Earthquake Engineering Research Center **
30 ** **
31 ** **
32 ** (C) Copyright 1999, The Regents of the University of California **
33 ** All Rights Reserved. **
34 ** **
35 ** Commercial use of this program without express permission of the **
36 ** University of California, Berkeley, is strictly prohibited. See **
37 ** file 'COPYRIGHT' in main directory for information on usage and **
38 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. **
39 ** **
40 ** Developed by: **
41 ** Frank McKenna (fmckenna@ce.berkeley.edu) **
42 ** Gregory L. Fenves (fenves@ce.berkeley.edu) **
43 ** Filip C. Filippou (filippou@ce.berkeley.edu) **
44 ** **
45 ** ****************************************************************** */
46 
47 // $Revision: 1.4 $
48 // $Date: 2005/12/01 01:12:55 $
49 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/LinearSOE.h,v $
50 
51 
52 #ifndef LinearSOE_h
53 #define LinearSOE_h
54 
55 // File: ~/system_of_eqn/LinearSOE.h
56 //
57 // Written: fmk
58 // Created: 11/96
59 // Revision: A
60 //
61 //
62 // What: "@(#) LinearSOE.h, revA"
63 
64 #include <solution/system_of_eqn/SystemOfEqn.h>
65 
66 namespace XC {
67 class LinearSOESolver;
68 class Matrix;
69 class Vector;
70 class ID;
71 
75 //
77 //
91 class LinearSOE : public SystemOfEqn
92  {
93  private:
94  LinearSOESolver *theSolver;
95  void free_memory(void);
96  void copy(const LinearSOESolver *);
97  protected:
98  friend class FEM_ObjectBroker;
99  virtual bool setSolver(LinearSOESolver *);
100  int setSolverSize(void);
101 
102  LinearSOE(AnalysisAggregation *,int classTag);
103  public:
104  virtual ~LinearSOE(void);
105 
106  virtual int solve(void);
107 
115  virtual int setSize(Graph &theGraph) =0;
117  virtual int getNumEqn(void) const =0;
118 
127  virtual int addA(const Matrix &M, const ID &loc, double fact = 1.0) =0;
128 
135  virtual int addB(const Vector &V, const ID &loc,const double &fact= 1.0) =0;
136 
140  virtual int setB(const Vector &V, const double &fact= 1.0) =0;
141 
143  virtual void zeroA(void) =0;
145  virtual void zeroB(void) =0;
146 
148  virtual const Vector &getX(void) const= 0;
150  virtual const Vector &getB(void) const= 0;
151  virtual double getDeterminant(void);
153  virtual double normRHS(void) const= 0;
154 
158  virtual void setX(int loc, double value) =0;
160  virtual void setX(const Vector &X) =0;
161 
162  LinearSOESolver *getSolver(void);
163  LinearSOESolver &newSolver(const std::string &);
164  };
165 } // end of XC namespace
166 
167 
168 #endif
virtual void zeroB(void)=0
To zero the vector $b$, i.e. set all the components of $b$ to $0$.
Float vector abstraction.
Definition: Vector.h:93
virtual int solve(void)
Computes the solution of the system of equations.
Definition: LinearSOE.cpp:217
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:143
virtual ~LinearSOE(void)
Destructor.
Definition: LinearSOE.cpp:207
LinearSOE(AnalysisAggregation *, int classTag)
Constructor.
Definition: LinearSOE.cpp:107
Solution procedure for the finite element problem.
Definition: AnalysisAggregation.h:89
virtual void zeroA(void)=0
To zero the matrix $A$, i.e. set all the components of $A$ to $0$.
Linear system of equations.
Definition: LinearSOE.h:91
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:145
Vector of integers.
Definition: ID.h:93
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:89
virtual const Vector & getB(void) const =0
Return a const reference to the vector $b$.
The Graph class provides the abstraction of a graph.
Definition: Graph.h:93
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:221
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Base class of the solvers for linear system of equations.
Definition: LinearSOESolver.h:86
LinearSOESolver * getSolver(void)
Returns a pointer to the solver.
Definition: LinearSOE.cpp:226
Matrix of floats.
Definition: Matrix.h:108
int setSolverSize(void)
invoke setSize() on the Solver
Definition: LinearSOE.cpp:230
virtual void setX(int loc, double value)=0
The LinearSOE object is responsible for setting $x(loc) = value$.
virtual const Vector & getX(void) const =0
Return a const reference to the vector $x$.
virtual double normRHS(void) const =0
Return the 2-norm of the vector $x$.