BJtensor.hGo to the documentation of this file.00001 //############################################################################# 00002 // # 00003 // # 00004 // /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/~~\ # 00005 // | |____| # 00006 // | | # 00007 // | | # 00008 // | | # 00009 // | | # 00010 // | B A S E C L A S S E S | # 00011 // | | # 00012 // | | # 00013 // | | # 00014 // | | # 00015 // | C + + H E A D E R | # 00016 // | | # 00017 // | | # 00018 // | | # 00019 // | | # 00020 // /~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/ | # 00021 // \_________________________________________\__/ # 00022 // # 00023 // # 00024 //############################################################################# 00025 //############################################################################# 00027 //################################################################################ 00028 //# COPYRIGHT (C): :-)) # 00029 //# PROJECT: Object Oriented Finite Element Program # 00030 //# PURPOSE: # 00031 //# CLASS: BJtensor # 00032 //# # 00033 //# VERSION: # 00034 //# LANGUAGE: C++.ver >= 2.0 ( Borland C++ ver=3.10, SUN C++ ver=2.1 ) # 00035 //# TARGET OS: DOS || UNIX || . . . # 00036 //# DESIGNER(S): Boris Jeremic # 00037 //# PROGRAMMER(S): Boris Jeremic # 00038 //# # 00039 //# # 00040 //# DATE: May 28. - July __ '93 # 00041 //# UPDATE HISTORY: july 8. '93. BJtensor02 - BJtensor multiplication # 00042 //# inner and outer products # 00043 //# august 17-19 '93 fixed default constructor that wasted # 00044 //# memory ### # 00045 //# october 11 '93 added transpose0110, transpose0101, # 00046 //# transpose0111 so the creation of # 00047 //# isotropic BJtensor is much easer and # 00048 //# understandable! # 00049 //# januar 06 '93 added BJtensor2BJmatrix_1, BJtensor2BJmatrix_2 # 00050 //# BJtensor2BJmatrix_3, inverse_1, inverse_2, # 00051 //# inverse_3 # 00052 //# januar 20 '93 added inverse TRUE ONE # 00053 //# August 22-29 '94 choped to separate files and worked on # 00054 //# const and & issues # 00055 //# August 30-31 '94 added use_def_dim to full the CC # 00056 //# resolved problem with temoraries for # 00057 //# operators + and - ( +=, -= ) # 00058 //# Oktobar 15 '96 added trasposeoverbar trasposeunderbar # 00059 //# ( the same as transpose0110 and # 00060 //# transpose0101) but just to make it # 00061 //# easier to work with Runesson's notation # 00062 //# 28June2004 added val4 for efficiency still # 00063 //# to be worked on # 00064 //# # 00065 //# # 00066 //################################################################################ 00067 //*/ 00068 00069 #ifndef TENSOR_HH 00070 #define TENSOR_HH 00071 00072 00073 #include "nDarray.h" 00074 #include "BJmatrix.h" 00075 00076 00077 class BJtensor : public nDarray 00078 { 00079 friend class stresstensor; 00080 friend class straintensor; 00081 // private: 00082 public: 00083 char *indices1; // character array of indices 00084 char *indices2; // they should be checked for matching and 00085 // then operator will be identified 00086 public: // just send appropriate arguments to the base constructor 00087 BJtensor(int rank_of_BJtensor=1, double initval=0); // default constructor 00088 BJtensor(int rank_of_BJtensor, const int *pdim, double *values); 00089 BJtensor(int rank_of_BJtensor, const int *pdim, double initvalue); 00090 BJtensor(char *flag, int rank_of_BJtensor, const int *pdim); // create a unit nDarray 00091 BJtensor(char *flag); //this one used to send "NO" message 00092 BJtensor(const BJtensor & x); // instead of: "BJtensor(nDarray & x):" :-) 00093 BJtensor(const nDarray & x); 00094 00095 //~BJtensor( ); 00096 00097 BJtensor& operator=( const BJtensor & rval); // BJtensor assignment 00098 00099 #ifndef _VC6 00100 friend BJtensor operator+(const BJtensor & , const BJtensor & ); // BJtensor addition 00101 friend BJtensor operator-(const BJtensor & , const BJtensor & ); // BJtensor substraction 00102 #else 00103 BJtensor operator+(const BJtensor & ) const; // BJtensor addition 00104 BJtensor operator-(const BJtensor & ) const; // BJtensor substraction 00105 #endif 00106 00107 BJtensor operator*( const double rval) const; //Guanzhou // scalar multiplication 00108 BJtensor operator*( BJtensor & rval); // inner/outter product 00109 BJtensor operator/( BJtensor & rval); // BJtensor division rval MUST BE BJtensor of 00110 // order 0 ( i.e. scalar in BJtensor form ) 00111 00112 BJtensor transpose0110( ) const; // transpose ijkl -->> ikjl 00113 BJtensor transposeoverbar( ) const; // transpose ijkl -->> ikjl 00114 BJtensor transpose0101( ) const; // transpose ijkl -->> ilkj 00115 BJtensor transpose0111( ) const; // transpose ijkl -->> iljk 00116 BJtensor transposeunderbar( ) const; // transpose ijkl -->> iljk 00117 BJtensor transpose1100( ) const; // transpose ijkl -->> jikl First minor symm 00118 BJtensor transpose0011( ) const; // transpose ijkl -->> ijlk Second minor symm 00119 BJtensor transpose1001( ) const; // transpose ijkl -->> ljki 00120 BJtensor transpose11( ) const; // transpose ij -->> ji 00121 00122 BJtensor symmetrize11( ) const; // symmetrize with respect to ij 00123 double determinant( ) const; // determinant of a BJtensor 00124 BJmatrix BJtensor2BJmatrix_1( ) const;// convert BJtensor of even order to BJmatrix 00125 // to be used in inversion process 00126 // I_ijkl scheme 00127 BJmatrix BJtensor2BJmatrix_2( ) const;// convert BJtensor of even order to BJmatrix 00128 // to be used in inversion process 00129 // I_ikjl scheme 00130 BJmatrix BJtensor2BJmatrix_3( ) const;// convert BJtensor of even order to BJmatrix 00131 // to be used in inversion process 00132 // I_iljk scheme 00133 BJtensor inverse( ) const; // inverse of a BJtensor 00134 // I_ikjl scheme TRUE ONE ____ 00135 // | 00136 BJtensor inverse_2( ) const; // inverse of a BJtensor <--| 00137 // I_ikjl scheme 00138 00139 BJtensor & operator()(char *indices_from_user); 00140 00141 void null_indices( ); 00142 //K char *BJtensor::f_indices1( ) const; 00143 char *f_indices1( ) const; 00144 //K char *BJtensor::f_indices2( ) const; 00145 char *f_indices2( ) const; 00146 00147 private: 00148 //K int BJtensor::contracted_ind(char *, char *, int *, int *, int , int ); 00149 //K int BJtensor::uncontracted_ind(int *, int *, int); 00150 int contracted_ind(char *, char *, int *, int *, int , int ); 00151 int uncontracted_ind(int *, int *, int); 00152 00153 00154 00155 }; 00156 // GLOBAL 00157 BJtensor operator*( const double lval, const BJtensor & rval); // REVIEWER global * 00158 00159 #endif 00160 00161 00162 00163 |