hexlawandorder.h

Go to the documentation of this file.
00001 #ifndef  __hexlawandorder_h
00002 #define  __hexlawandorder_h
00003 
00004 #include  "hex.h"
00005 #include  <map>
00006 
00007   /*            2
00008 
00009     3__________6__________2
00010     |          |          |
00011     |          |          |
00012     |    3     |    2     |
00013     |          |          |
00014     |          |          |
00015 3   7__________8__________5     1
00016     |          |          |
00017     |          |          |
00018     |    0     |    1     |
00019     |          |          |
00020     |          |          |
00021     0__________4__________1
00022 
00023                0
00024   */
00025 
00026 /*---------------------------------------------------*/
00027 
00028 namespace Gascoigne
00029 {
00030 class HexLawAndOrder
00031 {
00032  protected:
00033 
00034   /* typedef's */
00035   typedef fixarray<2,int>  EdgeVector;
00036   typedef fixarray<4,int>  FaceVector;
00037 
00038   /* reference */
00039   std::vector<Hex>&           hexs;
00040 
00041   /* data */
00042   fixarray<12,EdgeVector>   lve, vice, childs_edge;
00043   fixarray< 6,FaceVector>   lvf, vicf, childs_face;
00044   fixarray<8,int>           cell_midpoint;
00045   fixarray<8,fixarray<3,int> > ieoc;
00046   fixarray<12,fixarray<2,int> > coif, lcfif;
00047   fixarray<6 ,fixarray<4,int> >  edgeofface;
00048   fixarray<4 ,fixarray<9,int> >  hnpf;
00049 
00050   void local_edge_index(EdgeVector& index, int) const;
00051   void local_face_index(FaceVector& index, int) const;
00052   void GetGlobalOuterFaceOfChild(FaceVector&, const Hex& f, int c, int e) const;
00053 
00054  public:
00055 
00056   HexLawAndOrder(std::vector<Hex>&);
00057 
00058   void fill_corner_vertex_in_childs(const Hex&) const;
00059   void fill_middle_vertex_in_childs(const Hex&, int) const;
00060   void fill_face_vertex_in_childs  (const Hex&, int, int) const;
00061   void fill_edge_vertex_in_childs  (const Hex&, int, int) const;
00062 
00063   int face_vertex  (const Hex&, int) const;
00064   int edge_vertex  (const Hex&, int) const;
00065   int middle_vertex(const Hex&)      const;
00066   void globalvertices_of_edge(const Hex& q, fixarray<2,int>& f, int ie) const;
00067   void globalvertices_of_face(const Hex& q, fixarray<4,int>& f, int ie) const;
00068   void LoadEdgeVerticesOfFace(const Hex& f, int face, FaceVector& dst) const;
00069   void LoadFaceVertices(const Hex& f, fixarray<6,int>& dst) const;
00070 
00071   // faces
00072 
00073   int  LocalChildFaceOfInnerFace(int e, int i) const { return lcfif[e][i];}
00074   int  ChildOfInnerFace(int e, int i)          const { return coif[e][i];}
00075   int  ChildFace      (int e)                  const { return e; }
00076   int  ChildsOfFace(int f, int i)              const { return childs_face[f][i]; }          
00077   int  local_face(const Hex&, const FaceVector&)const;
00078   int  GlobalInnerFace(int c, int i)            const;
00079   int  GlobalChildFace(const FaceVector& edge, int q, int j) const;
00080   void GetFace(FaceVector&, int h, int e)      const;
00081   void global_face_unsorted(FaceVector&, const Hex&, int) const;
00082   void childs_of_face       (FaceVector&, const Hex&, int) const;
00083   void childs_of_global_face(FaceVector& child, const Hex&, 
00084                              const FaceVector&) const;
00085 
00086   std::pair<int,int> GetChildFaces(const FaceVector& bigedge, 
00087                               int bighex, int i) const;
00088 
00089   // edges
00090 
00091   void global_edge_unsorted(EdgeVector&, const Hex&, int) const;
00092   int  GlobalChildEdge(const EdgeVector& edge, int q, int j) const;
00093   int InnerEdge(const Hex&, int i) const;
00094   int  InnerEdgeOfChild (int c, int i) const { return ieoc[c][i]; }
00095 
00096   void load_face(FaceVector&, const Hex&, int) const;
00097   int  local_face_index(int, const FaceVector&) const;
00098   void globalfacechildren_of_father(std::vector<FaceVector>& faces,
00099                                     const Hex& f) const;
00100   int LoadEdgeOfFace(const Hex& q, const FaceVector& F, int e, EdgeVector& E) const;
00101   int LocalEdgeOfLocalFace(int face, int e) const { return edgeofface[face][e];}
00102   int TestFaceOfOneChild(const Hex& f, const FaceVector& F) const;
00103   int GetVertexOfEdge(int iq, const fixarray<2,int>& edge) const;
00104   int EdgeVertexOfFace(const Hex& q, const FaceVector& F, int e) const;
00105   fixarray<9,int> PatchVerticesOfFace(int hex, int face) const;
00106   fixarray<9,int> GiveOrdering(const fixarray<9,int>& F, const Hex& qfn) const;
00107 };
00108 }
00109 
00110 #endif

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