xc
SymSparseLinSOE.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 // File: ~/system_of_eqn/linearSOE/LawSolver/SymSparseLinSOE.h
29 //
30 // Written: Jun Peng (junpeng@stanford.edu)
31 // Prof. Kincho H. Law
32 // Stanford University
33 // Created: 12/98
34 // Revision: A
35 //
36 // Description: This file contains the class definition for
37 // SymSparseLinSOE.h. It stores the sparse matrix A in a fashion
38 // that only store the non zero entries.
39 //
40 // What: "@(#) SymSparseLinSOE.h, revA"
41 //
42 // Almost all the information (Matrix A and Vector B) is stored as
43 // global variables in the file "symbolic.h".
44 
45 
46 #ifndef SymSparseLinSOE_h
47 #define SymSparseLinSOE_h
48 
49 #include <solution/system_of_eqn/linearSOE/SparseSOEBase.h>
50 
51 extern "C" {
52  #include <solution/system_of_eqn/linearSOE/sparseSYM/FeStructs.h>
53 }
54 
55 namespace XC {
56 class SymSparseLinSolver;
57 
59 //
62  {
63  private:
64  ID colA, rowStartA; //These are (ADJNCY, XADJ) pair.
65 
66  int LSPARSE;
67  int nblks;
68  int *xblk, *invp;
69  double *diag, **penv;
70  int *rowblks;
71  OFFDBLK **begblk;
72  OFFDBLK *first;
73  protected:
74  virtual bool setSolver(LinearSOESolver *);
75 
76  friend class SolutionStrategy;
77  SymSparseLinSOE(SolutionStrategy *,int lSparse= 0);
78  SystemOfEqn *getCopy(void) const;
79  public:
80  ~SymSparseLinSOE(void);
81 
82  int setSize(Graph &theGraph);
83  int addA(const Matrix &, const ID &, double fact = 1.0);
84  int addB(const Vector &, const ID &,const double &fact= 1.0);
85 
86  void zeroA(void);
87 
88  int setSymSparseLinSolver(SymSparseLinSolver *);
89 
90  int sendSelf(Communicator &);
91  int recvSelf(const Communicator &);
92 
93  friend class SymSparseLinSolver;
94  };
96  { return new SymSparseLinSOE(*this); }
97 } // end of XC namespace
98 
99 #endif
100 
Float vector abstraction.
Definition: Vector.h:94
Communication parameters between processes.
Definition: Communicator.h:66
Definition: FeStructs.h:45
Sparse symmetric matrix systems of equations.
Definition: SymSparseLinSOE.h:61
int setSize(Graph &theGraph)
Determines and sets the size of the system.
Definition: SymSparseLinSOE.cpp:132
Vector of integers.
Definition: ID.h:95
int addA(const Matrix &, const ID &, double fact=1.0)
The LinearSOE object assembles fact times the Matrix M into the matrix $A$.
Definition: SymSparseLinSOE.cpp:221
System of equations base class.
Definition: SystemOfEqn.h:90
virtual bool setSolver(LinearSOESolver *)
Sets the solver for the system of equations.
Definition: SymSparseLinSOE.cpp:66
int addB(const Vector &, const ID &, const double &fact=1.0)
assemblies v multiplied by factor into vector B.
Definition: SymSparseLinSOE.cpp:370
The Graph class provides the abstraction of a graph.
Definition: Graph.h:94
void zeroA(void)
To zero the matrix , i.e.
Definition: SymSparseLinSOE.cpp:423
Solution strategy for the finite element problem.
Definition: SolutionStrategy.h:94
Solver for symmetric sparse linear SOE.
Definition: SymSparseLinSolver.h:56
int recvSelf(const Communicator &)
Receive the object.
Definition: SymSparseLinSOE.cpp:468
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
Matrix of floats.
Definition: Matrix.h:111
int sendSelf(Communicator &)
Send the object.
Definition: SymSparseLinSOE.cpp:461
SystemOfEqn * getCopy(void) const
Virtual constructor.
Definition: SymSparseLinSOE.h:95
Base class for sparse matrix systems of equations.
Definition: SparseSOEBase.h:41