[cig-commits] r14009 - short/3D/PyLith/trunk/libsrc/topology

knepley at geodynamics.org knepley at geodynamics.org
Mon Feb 2 14:10:24 PST 2009


Author: knepley
Date: 2009-02-02 14:10:24 -0800 (Mon, 02 Feb 2009)
New Revision: 14009

Modified:
   short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc
Log:
Fixed uniform refinement


Modified: short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc	2009-02-02 22:00:57 UTC (rev 14008)
+++ short/3D/PyLith/trunk/libsrc/topology/RefineUniform.cc	2009-02-02 22:10:24 UTC (rev 14009)
@@ -20,6 +20,19 @@
 #include <sstream> // USES std::ostringstream
 #include <cassert> // USES assert()
 
+template<typename Point>
+class Edge : public std::pair<Point, Point> {
+public:
+  Edge() : std::pair<Point, Point>() {};
+  Edge(const Point l) : std::pair<Point, Point>(l, l) {};
+  Edge(const Point l, const Point r) : std::pair<Point, Point>(l, r) {};
+  ~Edge() {};
+  friend std::ostream& operator<<(std::ostream& stream, const Edge& edge) {
+    stream << "(" << edge.first << ", " << edge.second << ")";
+    return stream;
+  };
+};
+
 // ----------------------------------------------------------------------
 // Constructor
 pylith::topology::RefineUniform::RefineUniform(void)
@@ -42,7 +55,7 @@
   assert(!mesh.isNull());
 
   typedef Mesh::point_type point_type;
-  typedef std::pair<point_type,point_type> edge_type;
+  typedef Edge<point_type> edge_type;
 
   const ALE::Obj<Mesh::label_sequence>& cells = mesh->heightStratum(0);
   assert(cells->size() > 0);



More information about the CIG-COMMITS mailing list