xc
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(AnalysisAggregation *,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 
Float vector abstraction.
Definition: Vector.h:93
LinearSOEData(AnalysisAggregation *, int classTag, int N=0)
Constructor.
Definition: LinearSOEData.cc:38
Solution procedure for the finite element problem.
Definition: AnalysisAggregation.h:89
Linear system of equations.
Definition: LinearSOE.h:91
virtual const Vector & getB(void) const
Returns the Vector object created for .
Definition: LinearSOEData.cc:234
virtual void setX(int loc, double value)
If loc is within the range of , sets .
Definition: LinearSOEData.cc:77
Vector of integers.
Definition: ID.h:93
virtual void zeroB(void)
Zeros the entries in the 1d array for .
Definition: LinearSOEData.cc:62
virtual void zero(void)
Zeros the entries in the 1d array for and .
Definition: LinearSOEData.cc:70
virtual double normRHS(void) const
Returns the 2-norm of the vector .
Definition: LinearSOEData.cc:242
Vector B
order of A
Definition: LinearSOEData.h:45
Data (size, arrays,...) for linear system of equations.
Definition: LinearSOEData.h:41
virtual void zeroX(void)
Zeros the entries in the 1d array for .
Definition: LinearSOEData.cc:66
virtual int getNumEqn(void) const
Return the current size of the system.
Definition: LinearSOEData.cc:58
virtual int setB(const XC::Vector &v, const double &fact=1.0)
Sets B= v*fact.
Definition: LinearSOEData.cc:97
void inic(const size_t &)
1d arrays containing coefficients of B and X
Definition: LinearSOEData.cc:43
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:34
Communication parameters between processes.
Definition: CommParameters.h:65
const double * getDataPtr(void) const
Return a pointer to the float date.
Definition: Vector.h:236
virtual int addB(const Vector &, const double &fact=1.0)
add v multiplied by factor to vector B.
Definition: LinearSOEData.cc:133
virtual const Vector & getX(void) const
Returns the Vector object created for .
Definition: LinearSOEData.cc:226