ShadowPetscSOE.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.1.1.1 $
00022 // $Date: 2000/09/15 08:23:29 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/system_of_eqn/linearSOE/petsc/ShadowPetscSOE.h,v $
00024                                                                         
00025                                                                         
00026 // File: ~/system_of_eqn/linearSOE/petsc/ShadowPetscSOE.h
00027 //
00028 // Written: fmk & om
00029 // Created: 7/98
00030 // Revision: A
00031 //
00032 // Description: This file contains the class definition for ShadowPetscSOE
00033 // ShadowPetscSOE is a subclass of LinearSOE. 
00034 
00035 // What: "@(#) ShadowPetscSOE.h, revA"
00036 
00037 #ifndef ShadowPetscSOE_h
00038 #define ShadowPetscSOE_h
00039 
00040 #include <LinearSOE.h>
00041 #include <Vector.h>
00042 #include <PetscSOE.h>
00043 
00044 // extern "C" {
00045 #include <petsc.h>
00046 // }
00047 
00048 class PetscSolver;
00049 
00050 class ShadowPetscSOE : public LinearSOE
00051 {
00052   public:
00053     ShadowPetscSOE(PetscSolver &theSolver, int blockSize);    
00054     
00055     ~ShadowPetscSOE();
00056 
00057     int solve(void);    
00058 
00059     int getNumEqn(void) const;
00060     int setSize(Graph &theGraph);
00061     
00062     int addA(const Matrix &, const ID &, double fact = 1.0);
00063     int addB(const Vector &, const ID &, double fact = 1.0);    
00064     int setB(const Vector &, double fact = 1.0);        
00065 
00066     void zeroA(void);
00067     void zeroB(void);
00068 
00069     const Vector &getX(void);
00070     const Vector &getB(void);
00071     double normRHS(void);
00072 
00073     void setX(int loc, double value);    
00074 
00075     int setSolver(PetscSolver &newSolver);    
00076 
00077     int sendSelf(int commitTag, Channel &theChannel);
00078     int recvSelf(int commitTag, Channel &theChannel, 
00079                  FEM_ObjectBroker &theBroker);    
00080     
00081   protected:
00082     
00083   private:
00084     MPI_Comm theComm; // a comm for communicating to the ActorPetscSOE's
00085                       // without using PETSC_COMM_WORLD
00086     PetscSOE theSOE;  // the local portion of the SOE
00087     PetscSolver *theSolver; // created by the user
00088     int myRank;
00089     int numProcessors;
00090     int sendData[3];
00091     void *sendBuffer;
00092     int blockSize;
00093 };
00094 
00095 
00096 #endif
00097 
00098 
00099 
00100 
00101 
00102 

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