PetscSOE.h

Go 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.3 $
00022 // $Date: 2005/05/18 19:24:49 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/petsc/PetscSOE.h,v $
00024                                                                         
00025                                                                         
00026 // Written: fmk & om
00027 // Created: 7/98
00028 // Revision: A
00029 //
00030 // Description: This file contains the class definition for PetscSOE
00031 // PetscSOE is a subclass of LinearSOE. It uses the LAPACK storage
00032 // scheme to store the components of the A matrix, which is a full matrix.
00033 
00034 
00035 // What: "@(#) PetscSOE.h, revA"
00036 
00037 #ifndef PetscSOE_h
00038 #define PetscSOE_h
00039 
00040 #include <LinearSOE.h>
00041 #include <Vector.h>
00042 
00043 // extern "C" {
00044 #include <petscksp.h>
00045 // }
00046 
00047 class PetscSolver;
00048 
00049 class PetscSOE : public LinearSOE
00050 {
00051   public:
00052     PetscSOE(PetscSolver &theSolver, int blockSize=1);    
00053     
00054     ~PetscSOE();
00055 
00056     int getNumEqn(void) const;
00057     int setSize(Graph &theGraph);
00058     
00059     int addA(const Matrix &, const ID &, double fact = 1.0);
00060     int addB(const Vector &, const ID &, double fact = 1.0);    
00061     int setB(const Vector &, double fact = 1.0);        
00062 
00063     void zeroA(void);
00064     void zeroB(void);
00065 
00066     const Vector &getX(void);
00067     const Vector &getB(void);
00068     double normRHS(void);
00069 
00070     void setX(int loc, double value);    
00071     void setX(const Vector &x);    
00072 
00073     int setSolver(PetscSolver &newSolver);    
00074 
00075     int sendSelf(int commitTag, Channel &theChannel);
00076     int recvSelf(int commitTag, Channel &theChannel, 
00077                  FEM_ObjectBroker &theBroker);    
00078     
00079     friend class PetscSolver;
00080     friend class ActorPetscSOE;
00081     friend class ShadowPetscSOE;
00082     
00083   protected:
00084     int setChannels(int nChannels, Channel **theChannels);
00085     
00086   private:
00087     int isFactored;
00088     int size;
00089     int processID;
00090     int numProcesses;
00091 
00092     double *B, *X;
00093     int *indices;
00094     Vector *vectX;
00095     Vector *vectB;
00096     Mat A;
00097     Vec x, b;
00098     int blockSize;
00099     PetscTruth flg;
00100 
00101     int numChannels;
00102     Channel **theChannels;
00103     ID **localCol;
00104 
00105     int startRow, endRow;
00106 };
00107 
00108 
00109 #endif
00110 

Generated on Mon Oct 23 15:05:29 2006 for OpenSees by doxygen 1.5.0