Go to the documentation of this file.00001 #ifndef VIENNAGRID_TOPOLOGY_QUADRILATERAL_HPP
00002 #define VIENNAGRID_TOPOLOGY_QUADRILATERAL_HPP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 };
00049 };
00050
00052 template <>
00053 struct bndcells<quadrilateral_tag, 1>
00054 {
00055 typedef hypercube_tag<1> tag;
00056
00057 enum{ num = 4 };
00058
00059 };
00060
00061
00062
00064
00065 template <>
00066 struct bndcell_filler<quadrilateral_tag, 1>
00067 {
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
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