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: 2001/06/14 05:26:47 $
00023 // $Source: /usr/local/cvs/OpenSees/SRC/convergenceTest/CTestEnergyIncr.h,v $
00024
00025
00026 #ifndef CTestEnergyIncr_h
00027 #define CTestEnergyIncr_h
00028
00029 // File: ~/convergenceTest/CTestEnergyIncr.h
00030 //
00031 // Written: fmk
00032 // Date: 09/98
00033 // Revised:
00034 //
00035 // Purpose: This file contains the class definition for CTestEnergyIncr.
00036 // A CTestEnergyIncr object tests for convergence using the energy increment,
00037 // which is 0.5 times the absolute value of the product of the rhs and
00038 // the solution vector of the LinearSOE.
00039
00040 #include <ConvergenceTest.h>
00041 #include <bool.h>
00042 #include <EquiSolnAlgo.h>
00043 #include <LinearSOE.h>
00044
00056 class CTestEnergyIncr: public ConvergenceTest
00057 {
00058 public:
00060 CTestEnergyIncr();
00067 CTestEnergyIncr(double tol, int maxNumIter, int printFlag);
00068
00076 ~CTestEnergyIncr();
00077
00078
00080 ConvergenceTest *getCopy( int iterations ) ;
00081
00082
00084 void setTolerance(double newTol);
00086 int setEquiSolnAlgo(EquiSolnAlgo &theAlgo);
00087
00089 int test(void);
00091 int start(void);
00092
00094 int getNumTests(void);
00096 int getMaxNumTests(void);
00098 double getRatioNumToMax(void);
00100 const Vector &getNorms(void);
00101
00103 int sendSelf(int commitTag, Channel &theChannel);
00105 int recvSelf(int commitTag, Channel &theChannel,
00106 FEM_ObjectBroker &theBroker);
00107
00108 protected:
00109
00110 private:
00112 LinearSOE *theSOE;
00114 double tol;
00115
00116 int maxNumIter;
00117 int currentIter;
00118 int printFlag;
00119
00120 Vector norms; // vector to hold the norms
00121 };
00122
00123 #endif