PetscSparseSeqSolver.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.2 $
00022 // $Date: 2005/05/18 19:26:59 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/petsc/PetscSparseSeqSolver.h,v $
00024                                                                         
00025 // Written: fmk 
00026 // Created: 04/05
00027 
00028 //
00029 // Description: This file contains the class definition for 
00030 // PetscSparseSeqSolver. It solves the SparseGenLinSOE object by calling Petsc routines
00031 //
00032 // What: "@(#) PetscSparseSeqSolver.h, revA"
00033 
00034 #ifndef PetscSparseSeqSolver_h
00035 #define PetscSparseSeqSolver_h
00036 
00037 #include <petscksp.h>
00038 #include <SparseGenRowLinSolver.h>
00039 
00040 #define PetscMinRelTol 1.0e-6
00041 
00042 class SparseGenRowLinSOE;
00043 
00044 class PetscSparseSeqSolver : public SparseGenRowLinSolver
00045 {
00046   public:
00047     PetscSparseSeqSolver(KSPType method, PCType preconditioner);    
00048     PetscSparseSeqSolver(KSPType method, PCType preconditioner, double rTol, double aTol, double dTol, int maxIts);    
00049     ~PetscSparseSeqSolver();
00050 
00051     int solve(void);
00052     int setSize(void);
00053     int getNumIterations(void);
00054     virtual int setLinearSOE(SparseGenRowLinSOE &theSOE);
00055     
00056     int sendSelf(int commitTag, Channel &theChannel);
00057     int recvSelf(int commitTag, Channel &theChannel, 
00058                  FEM_ObjectBroker &theBroker);    
00059 
00060   protected:
00061     SparseGenRowLinSOE *theSOE;
00062 
00063   private:
00064     KSP ksp;                      // linear solver context
00065     PC  pc;
00066     int its;
00067     KSPType method;
00068     PCType  preconditioner;
00069     double rTol;
00070     double aTol;
00071     double dTol; 
00072     int maxIts;
00073 
00074     Mat A;
00075     Vec x, b;
00076 };
00077 
00078 #endif
00079 

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