[cig-commits] r15017 - in short/3D/PyLith/trunk: libsrc/faults tests/1d/line2 unittests/libtests/faults

brad at geodynamics.org brad at geodynamics.org
Tue May 19 10:03:21 PDT 2009


Author: brad
Date: 2009-05-19 10:03:21 -0700 (Tue, 19 May 2009)
New Revision: 15017

Modified:
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
   short/3D/PyLith/trunk/tests/1d/line2/TestDislocation.py
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
Log:
Added code to set dimensioned coordinates associated with new vertices for cohesive cells (commented out because it doesn't work).

Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-05-19 16:22:49 UTC (rev 15016)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.cc	2009-05-19 17:03:21 UTC (rev 15017)
@@ -633,20 +633,46 @@
 			    coordinates->getFiberDimension(*v_iter));
   } // for
   sieveMesh->reallocate(coordinates);
-  fVertices2End = fVertices2->end();
+  SieveSubMesh::label_sequence::const_iterator fVertices2EndNew = 
+    fVertices2->end();
   for (SieveSubMesh::label_sequence::iterator v_iter = fVertices2Begin;
-      v_iter != fVertices2End;
-      ++v_iter) {
+       v_iter != fVertices2EndNew;
+       ++v_iter) {
     coordinates->updatePoint(vertexRenumber[*v_iter], 
 			     coordinates->restrictPoint(*v_iter));
     if (constraintCell)
       coordinates->updatePoint(vertexRenumber[*v_iter]+numFaultVertices,
-			     coordinates->restrictPoint(*v_iter));
+			       coordinates->restrictPoint(*v_iter));
   } // for
   if (debug)
     coordinates->view("Coordinates with shadow vertices");
-} // createCohesiveCells
 
+#if 0
+  // Fix dimensioned coordinates (we use the same chart as the
+  // coordinates, so we only need to update the values).
+  // MATT: THIS CODE DOESN"T APPEAR TO WORK.
+  if (sieveMesh->hasRealSection("coordinates_dimensioned")) {
+    const ALE::Obj<topology::Mesh::RealSection>& coordinatesDim = 
+      sieveMesh->getRealSection("coordinates_dimensioned");
+    assert(!coordinatesDim.isNull());
+
+    if (debug)
+      coordinatesDim->view("Dimensioned coordinates without shadow vertices");
+    for (SieveSubMesh::label_sequence::iterator v_iter = fVertices2Begin;
+	 v_iter != fVertices2EndNew;
+	 ++v_iter) {
+      coordinatesDim->updatePoint(vertexRenumber[*v_iter], 
+				  coordinatesDim->restrictPoint(*v_iter));
+      if (constraintCell)
+	coordinatesDim->updatePoint(vertexRenumber[*v_iter]+numFaultVertices,
+				    coordinatesDim->restrictPoint(*v_iter));
+    } // for
+    if (debug)
+      coordinatesDim->view("Dimensioned coordinates with shadow vertices");
+  } // if
+#endif
+} // create
+
 // ----------------------------------------------------------------------
 // Form a parallel fault mesh using the cohesive cell information
 void
@@ -759,6 +785,7 @@
       ++c_iter, ++f_iter)
     (*cohesiveToFault)[*c_iter] = *f_iter;
     
+  // Update coordinates
   const ALE::Obj<topology::Mesh::RealSection>& coordinates =
     sieveMesh->getRealSection("coordinates");
   assert(!coordinates.isNull());
@@ -791,6 +818,41 @@
   }
   //faultSieveMesh->view("Parallel fault mesh");
 
+#if 0
+  // Update dimensioned coordinates (reuse chart used by coordinates
+  // section).
+  // MATT: NEED TO ADD REUSE OF CHART. THIS CODE DOESN"T APPEAR TO WORK.
+  if (sieveMesh->hasRealSection("coordinates_dimensioned")) {
+    const ALE::Obj<topology::Mesh::RealSection>& coordinatesDim =
+      sieveMesh->getRealSection("coordinates_dimensioned");
+    assert(!coordinatesDim.isNull());
+    const ALE::Obj<topology::Mesh::RealSection>& fCoordinatesDim =
+      faultSieveMesh->getRealSection("coordinates_dimensioned");
+    assert(!fCoordinatesDim.isNull());
+
+    fCoordinatesDim->setChart(topology::Mesh::RealSection::chart_type(faultSieveMesh->heightStratum(0)->size(),
+                                                             faultSieveMesh->getSieve()->getChart().max()));
+    for (SieveMesh::label_sequence::iterator v_iter = vBegin;
+	 v_iter != vEnd;
+	 ++v_iter) {
+      if (fRenumbering.find(*v_iter) == fRenumberingEnd)
+	continue;
+      fCoordinatesDim->setFiberDimension(fRenumbering[*v_iter],
+					 coordinatesDim->getFiberDimension(*v_iter));
+  } // for
+    fCoordinatesDim->allocatePoint();
+    for(SieveMesh::label_sequence::iterator v_iter = vBegin;
+	v_iter != vEnd;
+	++v_iter) {
+      if (fRenumbering.find(*v_iter) == fRenumberingEnd)
+	continue;
+      fCoordinatesDim->updatePoint(fRenumbering[*v_iter], 
+				   coordinatesDim->restrictPoint(*v_iter));
+    } // for
+  } // if
+#endif
+  //faultSieveMesh->view("Parallel fault mesh");
+
   // Create the parallel overlap
   //   Can I figure this out in a nicer way?
   ALE::Obj<SieveSubMesh::send_overlap_type> sendParallelMeshOverlap =

Modified: short/3D/PyLith/trunk/tests/1d/line2/TestDislocation.py
===================================================================
--- short/3D/PyLith/trunk/tests/1d/line2/TestDislocation.py	2009-05-19 16:22:49 UTC (rev 15016)
+++ short/3D/PyLith/trunk/tests/1d/line2/TestDislocation.py	2009-05-19 17:03:21 UTC (rev 15017)
@@ -112,8 +112,6 @@
         maskP*(+0.30 - 0.025*vertices[:,0])
 
     print "VERTICES",vertices
-    print "DISP",disp
-
     return disp
 
 

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2009-05-19 16:22:49 UTC (rev 15016)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc	2009-05-19 17:03:21 UTC (rev 15017)
@@ -828,7 +828,7 @@
   iohandler.filename(_data->meshFilename);
   iohandler.read(mesh);
   
-  //(*mesh)->setDebug(true); // DEBUGGING
+  mesh->debug(true); // DEBUGGING
   
   spatialdata::geocoords::CSCart cs;
   spatialdata::units::Nondimensional normalizer;



More information about the CIG-COMMITS mailing list