00001 // ------------------------------------------------------------------------- 00002 // Error.h - This header file contains the public data structure 00003 // definitions for the discretization error mechanism class 00004 // within FEMOOP. 00005 // ------------------------------------------------------------------------- 00006 // Remarks: 00007 // Currently this class only works for mechanical problems. 00008 // ------------------------------------------------------------------------- 00009 // $Author: joaquim $ 00010 // $Revision: 1.2 $ 00011 // $Date: 1998/02/16 20:21:11 $ 00012 // $State: Exp $ 00013 // ------------------------------------------------------------------------- 00014 // Main public methods: 00015 // ------------------------------------------------------------------------- 00016 // 00017 // static cError *Read( void ) 00018 // 00019 // This method reads the error estimatimator from the input file, creates 00020 // the error object and returns a pointer to this object. 00021 // 00022 // ------------------------------------------------------------------------ 00023 // 00024 // void Error( sTensor *nodal_stress ) 00025 // 00026 // nodal_stress - 'analytical' nodal stresses (out) 00027 // 00028 // This method evaluates, for each element in mesh, its ratio error, 00029 // error norm in displacements and error norm in stresses. 00030 // 00031 // ------------------------------------------------------------------------ 00032 // 00033 // eErrorType GetType( void ) 00034 // 00035 // This method returns the type of the error estimator. 00036 // 00037 // ------------------------------------------------------------------------ 00038 // 00039 // double *GetErrRatio( void ) 00040 // 00041 // This method returns a vector with the error ratio for each element. 00042 // 00043 // ------------------------------------------------------------------------ 00044 // 00045 // double *GetErrNorm( void ) 00046 // 00047 // This method returns a vector with the error norm for each element. 00048 // 00049 // ------------------------------------------------------------------------ 00050 // 00051 // double *GetEnergyNorm( void ) 00052 // 00053 // This method returns a vector with the energy norm for each element. 00054 // 00055 // ------------------------------------------------------------------------ 00056 // 00057 // int GetNumErrLabels( char **label ) 00058 // 00059 // label - error response labels (out) 00060 // 00061 // This method returns the number of error response labels. 00062 // 00063 // ------------------------------------------------------------------------ 00064 // 00065 // int GetNumErrVals( int elm, double *val ) 00066 // 00067 // elm - element index ( in) 00068 // val - error response values (out) 00069 // 00070 // This method returns fill the vector "val" with the error response values 00071 // for the given element index. 00072 // 00073 // ------------------------------------------------------------------------ 00074 // Main protected methods: 00075 // ------------------------------------------------------------------------- 00076 // 00077 // void ErrorIptTensor( cElement *pcElm, 00078 // sTensor *nodal_stress, 00079 // sTensor *diff_stress ) 00080 // 00081 // pcElm - pointer to target element ( in) 00082 // nodal_stress - 'analytical' nodal stresses ( in) 00083 // diff_stress - diff. between 'analytical' and FEM stresses (out) 00084 // 00085 // This method evaluates the difference between an estimated 'analytical' 00086 // response and the original FE solution for each element integration point. 00087 // 00088 // ------------------------------------------------------------------------- 00089 00090 #ifndef _ERROR_H 00091 #define _ERROR_H 00092 00093 #include "gbldefs.h" 00094 00095 // ------------------------------------------------------------------------- 00096 // Forward declarations: 00097 // 00098 class cElement; 00099 00100 // ------------------------------------------------------------------------- 00101 // Error types: 00102 // 00103 typedef enum _errortype 00104 { 00105 ZZ, // Zienckiewicz-Zhu Error Estimator 00106 } eErrorType; 00107 00108 // ------------------------------------------------------------------------- 00109 // Error class (contains pointers to the methods): 00110 // 00111 class cError 00112 { 00113 protected: 00114 static double _dErrorPer; // Error percentage to compute error 00115 static double *_dErrRatio; // Element error ratio 00116 static double *_dErrNorm; // Element error in energy norm 00117 static double *_dEnergyNorm; // Element energy norm 00118 eErrorType _eType; // Error estimator type 00119 00120 public: 00121 cError ( void ); 00122 virtual ~cError ( void ); 00123 static cError *Read ( void ); 00124 void Error ( sTensor * ); 00125 eErrorType GetType ( void ) { return _eType; } 00126 double *GetErrRatio ( void ) { return _dErrRatio; } 00127 double *GetErrNorm ( void ) { return _dErrNorm; } 00128 double *GetEnergyNorm ( void ) { return _dEnergyNorm; } 00129 int GetNumErrLabels ( void ) { return 3; } 00130 void GetErrLabels ( char ** ); 00131 void GetErrVals ( int, double * ); 00132 00133 protected: 00134 void ErrorIptTensor( cElement *, sTensor *, sTensor * ); 00135 00136 private: 00137 static cError *ProcessErrorEstimator( void ); 00138 }; 00139 00140 #endif