00001 #ifndef ADAPTIVITY_H 00002 #define ADAPTIVITY_H 00003 00004 #include "xfile.h" 00005 #include "vector.h" 00006 00007 class adaptivity 00008 { 00009 private: 00010 /// characteristics of the problem 00011 long dim; /// dimension 00012 long ord; /// base functions order 00013 long ncomp; /// number of refined components [stress or strain in mefel] 00014 long nn; /// number of nodes 00015 long ne; /// number of elements 00016 00017 /// type of error smoothing ; 1 = spr_smoothing , 2 = z2_smoothing 00018 long tad; 00019 00020 /// sum of printing flags: 00021 /// 1 - print stdout - printing of solving information on standard output 00022 /// 2 - print bgm - printing of file.bgm necessary for new mesh generation by T3d generator, file contains required element sizes on points(of old mesh) 00023 /// 4 - print 00024 /// 8 - print 00025 /// 16 - print test - printing of file.test for testing 00026 long printflags; 00027 00028 /// sum of other flags: 00029 /// 1 - linear (0) X nonlinear(1) compute_refsizel 00030 /// 2 - spr compute with strain(0) X stress(1) 00031 /// 4 - (strain X stress) is own(0) X another(2) 00032 /// 8 - zienkiewiczuv zpusob nelin pocitani(8) X ostatni(0) 00033 /// 2 - strain is own(0) X another(1) 00034 /// 4 - stress is own(0) X another(2) 00035 long otherflags; 00036 00037 /// correction 00038 double corr; 00039 00040 /// accuracy 00041 double adapt_accuracy; 00042 00043 /// decomposed input file name 00044 char *path; 00045 char *filename; 00046 char *suffix; 00047 00048 /// second suffix of enter file, it contains actual number of iteration 00049 char *ni; 00050 00051 /// *** COMPUTED VALUES IN ARRAYS *** 00052 /// array of refined derivatives (stress or strain) in nodes 00053 vector *refined_ders_in_nodes; 00054 /// percentual error at elements 00055 vector elem_error_pct; 00056 /// absolute new/refined size of elements 00057 vector refsizel; 00058 /// relative new/refined size of elements [only for better visualization] 00059 vector refsizelrel; 00060 00061 00062 /// answer of this class ; 1(0) == remeshing is (is not) recommended 00063 long answer; 00064 00065 public: 00066 long give_adaptflag (void) const { return printflags; } 00067 00068 public: 00069 /// CONSTRUCTOR 00070 adaptivity (void); 00071 /// DESTRUCTOR 00072 ~adaptivity (void); 00073 00074 /// read values from input file 00075 void readinit (XFILE *in); 00076 /// print values to input file 00077 void printinit (FILE *out); 00078 00079 /// main function 00080 long run (long of,int width,long nincr); 00081 00082 private: 00083 /// 00084 void prepare_ni (int w, long i); 00085 /// check consistency 00086 void check_consistency (void) const; 00087 00088 /// average derivatives to nodes 00089 void spr (void); 00090 /// compute error... 00091 void compute_error (void); 00092 00093 /// 00094 void compute_refsizel_lin (const double *sizel, const double *ei2, double e2, double u2); 00095 00096 /// 00097 //void print_addat_vtk () const; 00098 /// 00099 void print_test (void) const; 00100 }; 00101 00102 00103 #endif