baseq13dpatch.h

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

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