CTestNormUnbalance.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.4 $
00022 // $Date: 2005/12/15 00:19:28 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/convergenceTest/CTestNormUnbalance.h,v $
00024 
00025 // Written: fmk 
00026 // Date: 09/98
00027 // Modified: 05/05 ahs
00028 //
00029 // Purpose: This file contains the class definition for CTestNormUnbalance.
00030 // A CTestNormUnbalance object tests for convergence using the norm of the 
00031 // right hand side vector of the LinearSOE object passed in the constructor
00032 // and a tolerance, set in the constructor
00033 
00034 #ifndef CTestNormUnbalance_h
00035 #define CTestNormUnbalance_h
00036 
00037 #include <ConvergenceTest.h>
00038 #include <bool.h>
00039 class EquiSolnAlgo;
00040 class LinearSOE;
00041 
00042 
00043 class CTestNormUnbalance: public ConvergenceTest
00044 {
00045 public:
00046     // constructors
00047     CTestNormUnbalance();               
00048     CTestNormUnbalance(double tol, int maxNumIter, int printFlag, int normType=2);
00049 
00050     // destructor
00051     ~CTestNormUnbalance();
00052     
00053     ConvergenceTest  *getCopy(int interations);
00054     
00055     void setTolerance(double newTol);
00056     int setEquiSolnAlgo(EquiSolnAlgo &theAlgo);
00057     
00058     int test(void);
00059     int start(void);
00060     
00061     int getNumTests(void);
00062     int getMaxNumTests(void);        
00063     double getRatioNumToMax(void);                
00064     const Vector &getNorms(void);    
00065     
00066     int sendSelf(int commitTag, Channel &theChannel);  
00067     int recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker);    
00068     
00069 protected:
00070     
00071 private:
00072     LinearSOE *theSOE;
00073     double tol;         // the tol on the norm used to test for convergence
00074     
00075     int maxNumIter;     // max number of iterations
00076     int currentIter;    // number of times test() has been invokes since last start()
00077     int printFlag;      // a flag indicating if to print on test
00078     int nType;          // type of norm to use (1-norm, 2-norm, p-norm, max-norm)
00079     
00080     Vector norms;       // vector to hold the norms
00081 };
00082 
00083 #endif

Generated on Mon Oct 23 15:04:59 2006 for OpenSees by doxygen 1.5.0