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