XC Open source finite element analysis program
LinearSOEData.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 //LinearSOEData.h
28 
29 
30 #ifndef LinearSOEData_h
31 #define LinearSOEData_h
32 
33 #include <solution/system_of_eqn/linearSOE/LinearSOE.h>
34 #include "utility/matrix/Vector.h"
35 
36 namespace XC {
37 
39 //
41 class LinearSOEData : public LinearSOE
42  {
43  protected:
44  int size;
45  Vector B, X;
46 
47  void inic(const size_t &);
48  inline const double &getB(const size_t &i) const
49  { return B[i]; }
50  inline double &getB(const size_t &i)
51  { return B(i); }
52  inline const double &getX(const size_t &i) const
53  { return X(i); }
54  inline double &getX(const size_t &i)
55  { return X(i); }
56  inline double *getPtrB(void)
57  { return B.getDataPtr(); }
58  inline const double *getPtrB(void) const
59  { return B.getDataPtr(); }
60  inline double *getPtrX(void)
61  { return X.getDataPtr(); }
62  inline const double *getPtrX(void) const
63  { return X.getDataPtr(); }
64 
65  LinearSOEData(SoluMethod *,int classTag,int N= 0);
66  public:
67  virtual int getNumEqn(void) const;
68  virtual void zeroB(void);
69  virtual void zeroX(void);
70  virtual void zero(void);
71 
72  virtual int addB(const Vector &, const double &fact= 1.0);
73  virtual int addB(const Vector &, const ID &,const double &fact= 1.0);
74  virtual int setB(const XC::Vector &v,const double &fact= 1.0);
75  virtual void setX(int loc, double value);
76  virtual void setX(const Vector &x);
77  virtual const Vector &getX(void) const;
78  virtual Vector &getX(void);
79  virtual const Vector &getB(void) const;
80  virtual Vector &getB(void);
81  virtual double normRHS(void) const;
82 
83  void receiveB(const CommParameters &);
84  void receiveX(const CommParameters &);
85  void receiveBX(const CommParameters &);
86  void sendB(CommParameters &) const;
87  void sendBX(CommParameters &) const;
88  };
89 } // end of XC namespace
90 
91 
92 #endif
93 
void inic(const size_t &)
1d arrays containing coefficients of B and X
Definition: LinearSOEData.cc:38
Definition: Vector.h:82
Solution procedure for the finite element problem. The solution procedure is definde by specifiying: ...
Definition: SoluMethod.h:76
Vector B
order of A
Definition: LinearSOEData.h:45
LinearSOEData(SoluMethod *, int classTag, int N=0)
Constructor.
Definition: LinearSOEData.cc:34
Definition: ID.h:77
Data (size, arrays,...) for linear system of equations.
Definition: LinearSOEData.h:41
Linea system of equations. This is the class definition for LinearSOE. LinearSOE is an abstract base ...
Definition: LinearSOE.h:86
Communication parameters between processes.
Definition: CommParameters.h:65
================================================================================
Definition: ContinuaReprComponent.h:34