SparseGenRowLinSOE.hGo to the documentation of this file.00001 /* ****************************************************************** ** 00002 ** OpenSees - Open System for Earthquake Engineering Simulation ** 00003 ** Pacific Earthquake Engineering Research Center ** 00004 ** ** 00005 ** ** 00006 ** (C) Copyright 1999, The Regents of the University of California ** 00007 ** All Rights Reserved. ** 00008 ** ** 00009 ** Commercial use of this program without express permission of the ** 00010 ** University of California, Berkeley, is strictly prohibited. See ** 00011 ** file 'COPYRIGHT' in main directory for information on usage and ** 00012 ** redistribution, and for a DISCLAIMER OF ALL WARRANTIES. ** 00013 ** ** 00014 ** Developed by: ** 00015 ** Frank McKenna (fmckenna@ce.berkeley.edu) ** 00016 ** Gregory L. Fenves (fenves@ce.berkeley.edu) ** 00017 ** Filip C. Filippou (filippou@ce.berkeley.edu) ** 00018 ** ** 00019 ** ****************************************************************** */ 00020 00021 // $Revision: 1.2 $ 00022 // $Date: 2006/01/10 00:42:51 $ 00023 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/sparseGEN/SparseGenRowLinSOE.h,v $ 00024 00025 #ifndef SparseGenRowLinSOE_h 00026 #define SparseGenRowLinSOE_h 00027 00028 // Written: fmk 00029 // Created: 04/05 00030 // Revision: A 00031 // 00032 // Description: This file contains the class definition for SparseGenRowLinSOE 00033 // SparseGenRowLinSOE is a subclass of LinearSOE. It stores the matrix equation 00034 // Ax=b using the sparse row-compacted storage scheme for storing the 00035 // matrix A. 00036 // 00037 // What: "@(#) SparseGenRowLinSOE.h, revA" 00038 00039 #include <LinearSOE.h> 00040 #include <Vector.h> 00041 00042 class SparseGenRowLinSolver; 00043 00044 class SparseGenRowLinSOE : public LinearSOE 00045 { 00046 public: 00047 SparseGenRowLinSOE(SparseGenRowLinSolver &theSolver); 00048 00049 ~SparseGenRowLinSOE(); 00050 00051 int getNumEqn(void) const; 00052 int setSize(Graph &theGraph); 00053 int addA(const Matrix &, const ID &, double fact = 1.0); 00054 int addB(const Vector &, const ID &, double fact = 1.0); 00055 int setB(const Vector &, double fact = 1.0); 00056 00057 void zeroA(void); 00058 void zeroB(void); 00059 00060 const Vector &getX(void); 00061 const Vector &getB(void); 00062 double normRHS(void); 00063 00064 void setX(int loc, double value); 00065 void setX(const Vector &x); 00066 int setSparseGenRowSolver(SparseGenRowLinSolver &newSolver); 00067 00068 int sendSelf(int commitTag, Channel &theChannel); 00069 int recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker); 00070 friend class PetscSparseSeqSolver; 00071 00072 protected: 00073 00074 private: 00075 int size; // order of A 00076 int nnz; // number of non-zeros in A 00077 double *A, *B, *X; // 1d arrays containing coefficients of A, B and X 00078 int *colA, *rowStartA; // int arrays containing info about coeficientss in A 00079 Vector *vectX; 00080 Vector *vectB; 00081 int Asize, Bsize; // size of the 1d array holding A 00082 bool factored; 00083 }; 00084 00085 00086 #endif 00087 |