[cig-commits] r9145 - short/3D/PyLith/trunk/libsrc/faults

knepley at geodynamics.org knepley at geodynamics.org
Sun Jan 27 11:07:30 PST 2008


Author: knepley
Date: 2008-01-27 11:07:29 -0800 (Sun, 27 Jan 2008)
New Revision: 9145

Modified:
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
Log:
Added coordinates to fault mesh


Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2008-01-27 18:18:29 UTC (rev 9144)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2008-01-27 19:07:29 UTC (rev 9145)
@@ -686,6 +686,27 @@
   } // for
   (*fault)->setSieve(faultSieve);
   (*fault)->stratify();
+#if 1
+  (*fault)->setRealSection("coordinates", mesh->getRealSection("coordinates"));
+#else
+  const ALE::Obj<Mesh::real_section_type>& coordinates  = mesh->getRealSection("coordinates");
+  const ALE::Obj<Mesh::real_section_type>& fCoordinates = (*fault)->getRealSection("coordinates");
+  const ALE::Obj<Mesh::label_sequence>&    vertices     = (*fault)->depthStratum(0);
+  const Mesh::label_sequence::iterator     vBegin       = vertices->begin();
+  const Mesh::label_sequence::iterator     vEnd         = vertices->end();
+
+  for(Mesh::label_sequence::iterator v_iter = vBegin;
+      v_iter != vEnd;
+      ++v_iter) {
+    fCoordinates->setFiberDimension(*v_iter, coordinates->getFiberDimension(*v_iter));
+  }
+  (*fault)->allocate(fCoordinates);
+  for(Mesh::label_sequence::iterator v_iter = vBegin;
+      v_iter != vEnd;
+      ++v_iter) {
+    fCoordinates->updatePoint(*v_iter, coordinates->restrictPoint(*v_iter));
+  }
+#endif
 }
 
 // ----------------------------------------------------------------------



More information about the cig-commits mailing list