OOFEM  2.1
errorestimator.h
Go to the documentation of this file.
00001 /*
00002  *
00003  *                 #####    #####   ######  ######  ###   ###
00004  *               ##   ##  ##   ##  ##      ##      ## ### ##
00005  *              ##   ##  ##   ##  ####    ####    ##  #  ##
00006  *             ##   ##  ##   ##  ##      ##      ##     ##
00007  *            ##   ##  ##   ##  ##      ##      ##     ##
00008  *            #####    #####   ##      ######  ##     ##
00009  *
00010  *
00011  *             OOFEM : Object Oriented Finite Element Code
00012  *
00013  *               Copyright (C) 1993 - 2013   Borek Patzak
00014  *
00015  *
00016  *
00017  *       Czech Technical University, Faculty of Civil Engineering,
00018  *   Department of Structural Mechanics, 166 29 Prague, Czech Republic
00019  *
00020  *  This program is free software; you can redistribute it and/or modify
00021  *  it under the terms of the GNU General Public License as published by
00022  *  the Free Software Foundation; either version 2 of the License, or
00023  *  (at your option) any later version.
00024  *
00025  *  This program is distributed in the hope that it will be useful,
00026  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00027  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00028  *  GNU General Public License for more details.
00029  *
00030  *  You should have received a copy of the GNU General Public License
00031  *  along with this program; if not, write to the Free Software
00032  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00033  */
00034 
00035 
00036 //   *****************************************
00037 //   *** CLASS ERROR ESTIMATOR (INDICATOR) ***
00038 //   *****************************************
00039 
00040 #ifndef errorestimator_h
00041 #define errorestimator_h
00042 
00043 #include "femcmpnn.h"
00044 #include "compiler.h"
00045 
00046 #include "interface.h"
00047 #include "remeshingcrit.h"
00048 #include "classtype.h"
00049 #include "errorestimatortype.h"
00050 #include "intarray.h"
00051 #include "internalstatetype.h"
00052 
00053 namespace oofem {
00054 class Domain;
00055 class Element;
00056 class TimeStep;
00057 
00059 enum EE_ValueType { globalNormEEV, globalErrorEEV, globalWeightedErrorEEV };
00061 enum EE_ErrorType { unknownET, indicatorET, internalStressET, primaryUnknownET };
00063 enum EE_ErrorMode { equilibratedEM, temporaryEM };
00064 
00065 
00074 class ErrorEstimator : public FEMComponent
00075 {
00076 protected:
00077     ErrorEstimatorType eeType;
00078     RemeshingCriteria *rc;
00085     IntArray regionSkipMap;
00087     int skippedNelems;
00089     InternalStateType IStype;
00090 
00091 public:
00093     ErrorEstimator(int n, Domain *d) : FEMComponent(n, d) {
00094         rc = NULL;
00095         skippedNelems = 0;
00096         regionSkipMap.resize(0);
00097     }
00099     virtual ~ErrorEstimator() { if ( rc ) { delete rc; } }
00101     void setDomain(Domain *d);
00109     virtual double giveElementError(EE_ErrorType type, Element *elem, TimeStep *tStep) = 0;
00118     virtual double giveValue(EE_ValueType type, TimeStep *tStep) = 0;
00123     int giveNumberOfSkippedElements() { return skippedNelems; }
00131     virtual int estimateError(EE_ErrorMode mode, TimeStep *tStep) = 0;
00135     virtual RemeshingCriteria *giveRemeshingCrit() = 0;
00136 
00140     ErrorEstimatorType giveErrorEstimatorType() const { return eeType; }
00141 
00149     bool skipRegion(int reg) { if ( reg <= regionSkipMap.giveSize() ) { return regionSkipMap.at(reg) > 0; } else { return false; } }
00150     virtual void reinitialize() { this->rc->reinitialize(); }
00151 
00152     virtual IRResultType initializeFrom(InputRecord *ir);
00153     virtual const char *giveClassName() const { return "ErrorEstimator"; }
00154     virtual classType giveClassID() const { return ErrorEstimatorClass; }
00155 };
00156 } // end namespace oofem
00157 #endif // errorestimator_h
00158 
00159 
00160 
00161 
00162 
00163 

This page is part of the OOFEM documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Sun Mar 10 2013 18:16:53 for OOFEM by doxygen 1.7.6.1 written by Dimitri van Heesch, © 1997-2011