baseq1patch.h

Go to the documentation of this file.
00001 #ifndef __baseq12dPatch_h
00002 #define __baseq12dPatch_h
00003 
00004 #include  "baseq12d.h"
00005 
00006 #define NDOF   9
00007 #define NDOF1d 3
00008 
00009 namespace Gascoigne
00010 {
00011 /**************************************************/
00012 
00013 class BaseQ12dPatch : public Base2d
00014 {
00015  protected:
00016 
00017   mutable int        pB;
00018   BaseQ12d           B1;
00019 
00020   mutable Vertex2d   bn, bt;
00021   nvector<int>       perm;
00022   mutable nvector<double> dxy;
00023 
00024   void BasicInit() {
00025       N.resize(NDOF);  
00026       DN.resize(NDOF);  
00027 /*       dxy.resize(NDOF);   */
00028     }
00029 
00030  public:
00031   
00032   BaseQ12dPatch() : perm(4) 
00033   {
00034     BasicInit();
00035     
00036     perm[0] = 0;
00037     perm[1] = 1;
00038     perm[2] = 3;
00039     perm[3] = 4;
00040   }
00041 
00042   int  n() const {return NDOF;}
00043   double phi   (int i) const {return N  [i];}
00044   double phi_x (int i) const {return DN [i].x();}
00045   double phi_y (int i) const {return DN [i].y();}
00046   double phi_xx(int i) const {return 0.;}
00047   double phi_xy(int i) const {assert(0); return dxy[i];}
00048   double phi_yy(int i) const {return 0.;}
00049   const Vertex2d&  phi_grad (int i) const {return DN [i];}
00050 
00051   void point(const Vertex2d& s) const
00052     {
00053       Vertex2d t(s);
00054       if( (s.x()<=0.5) && (s.y()<=0.5) )
00055         {
00056           pB = 0;
00057         }
00058       else if( (s.x()>=0.5) && (s.y()<=0.5) )
00059         {
00060           pB = 1;
00061           t.x() -= 0.5;
00062         }
00063       else if( (s.x()<=0.5) && (s.y()>=0.5) )
00064         {
00065           pB = 2;
00066           t.y() -= 0.5;
00067         }
00068       else
00069         {
00070           pB = 3;
00071           t.x() -= 0.5;
00072           t.y() -= 0.5;
00073         }
00074       t *= 2.;
00075 
00076       B1.point(t);
00077 
00078       N.zero();
00079       for(int i=0;i<NDOF;i++)  DN[i].zero();
00080 
00081       int offset = perm[pB];
00082       for(int i=0; i<4; i++)
00083         {
00084           int j = offset + perm[i];
00085           N[j]  = B1.phi(i);
00086           DN[j] = B1.phi_grad(i);  
00087           DN[j] *= 2.;
00088 /*        dxy[j] = B1.phi_xy(i);   */
00089 /*        dxy[j] *= 2.; */
00090         }
00091     }
00092 };
00093 }
00094 
00095 #undef NDOF
00096 #undef NDOF1d
00097 
00098 #endif

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