baseq23dpatch.h

Go to the documentation of this file.
00001 #ifndef __baseq23dPatch_h
00002 #define __baseq23dPatch_h
00003 
00004 #include  "baseq23d.h"
00005 
00006 #define NDOF   125
00007 #define NDOF1d 5
00008 
00009 namespace Gascoigne
00010 {
00011 /**************************************************/
00012 
00013   class BaseQ23dPatch : public Base3d
00014   {
00015     protected:
00016       bool         second;
00017       mutable int  pB;
00018       BaseQ23d     B2;
00019       nvector<int> perm;
00020 
00021       mutable nvector<double> dxx, dyy, dzz, dxy, dxz, dyz;
00022 
00023       void BasicInit()
00024       {
00025         N.resize(NDOF);
00026         DN.resize(NDOF);
00027         dxx.reservesize(NDOF);
00028         dyy.reservesize(NDOF);
00029         dzz.reservesize(NDOF);
00030         dxy.reservesize(NDOF);
00031         dxz.reservesize(NDOF);
00032         dyz.reservesize(NDOF);
00033       }
00034 
00035     public:
00036       BaseQ23dPatch() : Base3d(), second(false), perm(27)
00037       {
00038         BasicInit();
00039 
00040         perm[ 0] = 0;
00041         perm[ 1] = 1;
00042         perm[ 2] = 2;
00043         perm[ 3] = 5;
00044         perm[ 4] = 6;
00045         perm[ 5] = 7;
00046         perm[ 6] = 10;
00047         perm[ 7] = 11;
00048         perm[ 8] = 12;
00049         perm[ 9] = 25;
00050         perm[10] = 26;
00051         perm[11] = 27;
00052         perm[12] = 30;
00053         perm[13] = 31;
00054         perm[14] = 32;
00055         perm[15] = 35;
00056         perm[16] = 36;
00057         perm[17] = 37;
00058         perm[18] = 50;
00059         perm[19] = 51;
00060         perm[20] = 52;
00061         perm[21] = 55;
00062         perm[22] = 56;
00063         perm[23] = 57;
00064         perm[24] = 60;
00065         perm[25] = 61;
00066         perm[26] = 62;
00067       }
00068 
00069       int  n() const {return NDOF;}
00070       double phi   (int i) const {return N  [i];}
00071       double phi_x (int i) const {return DN [i].x();}
00072       double phi_y (int i) const {return DN [i].y();}
00073       double phi_z (int i) const {return DN [i].z();}
00074       double phi_xx(int i) const {assert(second); return dxx[i];}
00075       double phi_yy(int i) const {assert(second); return dyy[i];}
00076       double phi_zz(int i) const {assert(second); return dzz[i];}
00077       double phi_xy(int i) const {assert(second); return dxy[i];}
00078       double phi_xz(int i) const {assert(second); return dxz[i];}
00079       double phi_yz(int i) const {assert(second); return dyz[i];}
00080       const Vertex3d& phi_grad(int i) const {return DN [i];}
00081 
00082       void point(const Vertex3d& s) const
00083       {
00084         Vertex3d t(s);
00085         if( (s.x()<=0.5) && (s.y()<=0.5))
00086         {
00087           pB = 0;
00088         }
00089         else if( (s.x()>=0.5) && (s.y()<=0.5) )
00090         {
00091           pB = 2;
00092           t.x() -= 0.5;
00093         }
00094         else if( (s.x()<=0.5) && (s.y()>=0.5))
00095         {
00096           pB = 10;
00097           t.y() -= 0.5;
00098         }
00099         else
00100         {
00101           pB = 12;
00102           t.x() -= 0.5;
00103           t.y() -= 0.5;
00104         }
00105         if (s.z()>=0.5)
00106         {
00107           t.z() -= 0.5;
00108           pB += 50;
00109         }
00110         t *= 2.;
00111 
00112         B2.point(t);
00113 
00114         N.zero();
00115         for(int i=0; i<NDOF; i++)
00116         {
00117           DN[i].zero();
00118         }
00119 
00120         for (int i=0; i<27; i++)
00121         {
00122           int j = pB + perm[i];
00123           N [j] = B2.phi(i);
00124           DN[j] = B2.phi_grad(i);
00125           DN[j] *= 2.;
00126           if(second)
00127           {
00128             dxx[j] = 2.*B2.phi_xx(i);
00129             dyy[j] = 2.*B2.phi_yy(i);
00130             dzz[j] = 2.*B2.phi_zz(i);
00131             dxy[j] = 2.*B2.phi_xy(i);
00132             dxz[j] = 2.*B2.phi_xz(i);
00133             dyz[j] = 2.*B2.phi_yz(i);
00134           }
00135         }
00136       }
00137   };
00138 }
00139 
00140 #undef NDOF
00141 #undef NDOF1d
00142 
00143 #endif

Generated on Thu Sep 14 10:34:36 2006 for Gascoigne by  doxygen 1.4.7