• Main Page
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

/export/development/ViennaGrid/release/ViennaGrid-1.0.0/viennagrid/topology/quadrilateral.hpp

Go to the documentation of this file.
00001 #ifndef VIENNAGRID_TOPOLOGY_QUADRILATERAL_HPP
00002 #define VIENNAGRID_TOPOLOGY_QUADRILATERAL_HPP
00003 
00004 /* =======================================================================
00005    Copyright (c) 2011, Institute for Microelectronics,
00006                        Institute for Analysis and Scientific Computing,
00007                        TU Wien.
00008 
00009                             -----------------
00010                      ViennaGrid - The Vienna Grid Library
00011                             -----------------
00012 
00013    Authors:      Karl Rupp                           rupp@iue.tuwien.ac.at
00014                  Josef Weinbub                    weinbub@iue.tuwien.ac.at
00015                
00016    (A list of additional contributors can be found in the PDF manual)
00017 
00018    License:      MIT (X11), see file LICENSE in the base directory
00019 ======================================================================= */
00020 
00021 #include "viennagrid/forwards.h"
00022 #include "viennagrid/topology/point.hpp"
00023 #include "viennagrid/topology/line.hpp"
00024 
00029 namespace viennagrid
00030 {
00032   template <>
00033   struct hypercube_tag<2>
00034   {
00035     enum{ dim = 2 };
00036     static std::string name() { return "Quadrilateral"; }
00037   };
00038   
00039   namespace topology
00040   {
00041   
00043     template <>
00044     struct bndcells<quadrilateral_tag, 0>
00045     {
00046       typedef point_tag             tag;
00047 
00048       enum{ num = 4 };     //3 vertices
00049     };
00050 
00052     template <>
00053     struct bndcells<quadrilateral_tag, 1>
00054     {
00055       typedef hypercube_tag<1>       tag;
00056 
00057       enum{ num = 4 };     //3 edges
00058 
00059     };
00060 
00061 
00062 
00064 
00065     template <>
00066     struct bndcell_filler<quadrilateral_tag, 1>
00067     {
00068       //fill edges:
00069       //
00070       // Reference orientation: (v... vertices, e...edges)
00071       //        e3
00072       // v2 --------- v3
00073       //    |       |
00074       // e1 |       | e2
00075       //    |       |
00076       // v0 --------- v1
00077       //        e0
00078       template <typename ElementType, typename Vertices, typename Orientations, typename Segment>
00079       static void fill(ElementType ** elements, Vertices ** vertices, Orientations * orientations, Segment & seg)
00080       {
00081         Vertices * edgevertices[2];
00082         ElementType edge;
00083 
00084         edgevertices[0] = vertices[0];
00085         edgevertices[1] = vertices[1];
00086         edge.vertices(edgevertices);
00087         elements[0] = seg.push_back(edge, (orientations == NULL) ? NULL : orientations);
00088 
00089         edgevertices[0] = vertices[0];
00090         edgevertices[1] = vertices[2];
00091         edge.vertices(edgevertices);
00092         elements[1] = seg.push_back(edge, (orientations == NULL) ? NULL : orientations + 1 );
00093 
00094         edgevertices[0] = vertices[1];
00095         edgevertices[1] = vertices[3];
00096         edge.vertices(edgevertices);
00097         elements[2] = seg.push_back(edge, (orientations == NULL) ? NULL : orientations + 2 );
00098 
00099         edgevertices[0] = vertices[2];
00100         edgevertices[1] = vertices[3];
00101         edge.vertices(edgevertices);
00102         elements[3] = seg.push_back(edge, (orientations == NULL) ? NULL : orientations + 3 );
00103         
00104       }
00105     };
00106   }
00107     
00108 }
00109 
00110 #endif
00111 

Generated on Wed Sep 14 2011 19:21:30 for ViennaGrid by  doxygen 1.7.1