[cig-commits] r18079 - in short/3D/PyLith/trunk: libsrc/faults libsrc/meshio libsrc/topology libsrc/utils pylith/perf

knepley at geodynamics.org knepley at geodynamics.org
Tue Mar 8 14:01:45 PST 2011


Author: knepley
Date: 2011-03-08 14:01:45 -0800 (Tue, 08 Mar 2011)
New Revision: 18079

Modified:
   short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh
   short/3D/PyLith/trunk/libsrc/faults/TopologyOps.hh
   short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.hh
   short/3D/PyLith/trunk/libsrc/meshio/UCDFaultFile.hh
   short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
   short/3D/PyLith/trunk/libsrc/topology/MeshRefiner.hh
   short/3D/PyLith/trunk/libsrc/utils/sievetypes.hh
   short/3D/PyLith/trunk/pylith/perf/Memory.py
Log:
Fix for distribution of IntSections

Modified: short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/faults/CohesiveTopology.hh	2011-03-08 22:01:45 UTC (rev 18079)
@@ -28,7 +28,7 @@
 #include "faultsfwd.hh" // forward declarations
 
 #include "pylith/topology/Mesh.hh" // USES Mesh::IntSection
-#include "pylith/utils/sievetypes.hh" // USE ALE::Obj
+#include "pylith/utils/sievetypes.hh" // USE ALE::Obj and FlexMesh
 
 // CohesiveTopology -----------------------------------------------------
 /// Creation of cohesive cells.
@@ -37,7 +37,7 @@
 
 private :
   typedef pylith::topology::Mesh::SieveMesh::point_type point_type;
-  typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
+  typedef pylith::FlexMesh FlexMesh;
 
   // PUBLIC METHODS /////////////////////////////////////////////////////
 public :

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesive.hh	2011-03-08 22:01:45 UTC (rev 18079)
@@ -31,6 +31,7 @@
 #include "pylith/topology/SubMesh.hh" // ISA Integrator<Quadrature<SubMesh> >
 #include "pylith/feassemble/Quadrature.hh" // ISA Integrator<Quadrature>
 #include "pylith/feassemble/Integrator.hh" // ISA Integrator
+#include "pylith/utils/sievetypes.hh" // USE FlexMesh
 
 // FaultCohesive --------------------------------------------------------
 /// Absract base class for fault surface implemented with cohesive cells.
@@ -38,7 +39,7 @@
 				      public feassemble::Integrator<feassemble::Quadrature<topology::SubMesh> >
 { // class FaultCohesive
   friend class TestFaultCohesive; // unit testing
-  typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
+  typedef pylith::FlexMesh FlexMesh;
 
   // PUBLIC METHODS /////////////////////////////////////////////////////
 public :

Modified: short/3D/PyLith/trunk/libsrc/faults/TopologyOps.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/TopologyOps.hh	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/faults/TopologyOps.hh	2011-03-08 22:01:45 UTC (rev 18079)
@@ -28,6 +28,7 @@
 #include "faultsfwd.hh" // forward declarations
 
 #include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/utils/sievetypes.hh" // USE FlexMesh
 
 // TopologyOps ----------------------------------------------------------
 /// Helper object for creation of cohesive cells.
@@ -41,7 +42,7 @@
   typedef std::vector<SieveMesh::sieve_type::point_type> PointArray;
   typedef std::pair<SieveMesh::sieve_type::point_type, int> oPoint_type;
   typedef std::vector<oPoint_type>  oPointArray;
-  typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
+  typedef pylith::FlexMesh FlexMesh;
 
   // PUBLIC METHODS /////////////////////////////////////////////////////
 public :

Modified: short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.hh	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/meshio/MeshBuilder.hh	2011-03-08 22:01:45 UTC (rev 18079)
@@ -34,6 +34,7 @@
 #include "spatialdata/units/unitsfwd.hh" // USES Nondimensional
 
 #include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/utils/sievetypes.hh" // USE FlexMesh
 
 // MeshBuilder ----------------------------------------------------------
 /// Helper class for constructing Sieve mesh data structures.
@@ -42,7 +43,7 @@
 
   // PUBLIC TYPEDEFS ////////////////////////////////////////////////////
 public :
-  typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
+  typedef pylith::FlexMesh FlexMesh;
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////
 public :

Modified: short/3D/PyLith/trunk/libsrc/meshio/UCDFaultFile.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/UCDFaultFile.hh	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/meshio/UCDFaultFile.hh	2011-03-08 22:01:45 UTC (rev 18079)
@@ -30,7 +30,7 @@
 
 #include "pylith/topology/topologyfwd.hh" // USES Mesh, SubMesh
 
-#include "pylith/utils/sievetypes.hh" // USES ALE::Obj, ALE::Mesh
+#include "pylith/utils/sievetypes.hh" // USES ALE::Obj, ALE::Mesh, FlexMesh
 
 // UCDFaultFile ---------------------------------------------------------
 /** @brief C++ object for reading a fault mesh from a UCD file.
@@ -44,7 +44,7 @@
 class pylith::meshio::UCDFaultFile
 { // UCDFaultFile
   friend class TestUCDFaultFile; // unit testing
-  typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
+  typedef pylith::FlexMesh FlexMesh;
 
 // PUBLIC METHODS ///////////////////////////////////////////////////////
 public :

Modified: short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2011-03-08 22:01:45 UTC (rev 18079)
@@ -272,6 +272,8 @@
 
   if (origSieveMesh->getIntSections()->size() > 0) {
     ALE::Obj<std::set<std::string> > names = origSieveMesh->getIntSections();
+    const int numVertices = newSieveMesh->depthStratum(0)->size();
+    const int numCells    = newSieveMesh->heightStratum(0)->size();
     assert(!names.isNull());
 
     std::set<std::string>::const_iterator namesBegin = names->begin();
@@ -286,11 +288,23 @@
 	newSieveMesh->getIntSection(*n_iter);
       assert(!newSection.isNull());
 
-      // We assume all integer sections are complete sections
-      newSection->setChart(newSieveMesh->getSieve()->getChart());
+      // We assume all integer sections are supported on either cells or vertices
+      SieveMesh::point_type firstPoint;
+      IntSection::chart_type::const_iterator chartEnd = origSection->getChart().end();
+      for(IntSection::chart_type::const_iterator c_iter = origSection->getChart().begin(); c_iter != chartEnd; ++c_iter) {
+        if (origSection->getFiberDimension(*c_iter)) {
+          firstPoint = *c_iter;
+          break;
+        } // if
+      }
+      if (origSieveMesh->height(firstPoint) == 0) {
+        newSection->setChart(IntSection::chart_type(0, numCells));
+      } else {
+        newSection->setChart(IntSection::chart_type(numCells, numCells+numVertices));
+      } // if/else
       DistributionType::distributeSection(origSection, partition, renumbering,
-					  sendMeshOverlap, recvMeshOverlap, 
-					  newSection);
+                                          sendMeshOverlap, recvMeshOverlap, 
+                                          newSection);
 #if 0 // DEBUGGING
       std::string serialName("Serial ");
       std::string parallelName("Parallel ");

Modified: short/3D/PyLith/trunk/libsrc/topology/MeshRefiner.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/MeshRefiner.hh	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/topology/MeshRefiner.hh	2011-03-08 22:01:45 UTC (rev 18079)
@@ -28,6 +28,8 @@
 // Include directives ---------------------------------------------------
 #include "topologyfwd.hh" // forward declarations
 
+#include "pylith/utils/sievetypes.hh" // USE FlexMesh
+
 // RefineTri3 --------------------------------------------------------
 /// Object for refinement of cells.
 template<typename cellrefiner_type>
@@ -35,7 +37,7 @@
 { // MeshRefiner
   typedef IMesh<PetscInt,PetscScalar> mesh_type;
   typedef mesh_type::point_type point_type;
-  typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
+  typedef pylith::FlexMesh FlexMesh;
 
 // PUBLIC MEMBERS ///////////////////////////////////////////////////////
 public :

Modified: short/3D/PyLith/trunk/libsrc/utils/sievetypes.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/utils/sievetypes.hh	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/libsrc/utils/sievetypes.hh	2011-03-08 22:01:45 UTC (rev 18079)
@@ -38,6 +38,9 @@
   /// Sieve submesh.
   typedef ALE::IMesh<PetscInt,PetscScalar,ALE::LabelSifter<int, SieveMesh::point_type> > SieveSubMesh;
 
+  /// Sieve flexible mesh.
+  typedef ALE::Mesh<PetscInt,PetscScalar> FlexMesh;
+
 } // pylith
 
 #endif // pylith_utils_sievetypes_hh

Modified: short/3D/PyLith/trunk/pylith/perf/Memory.py
===================================================================
--- short/3D/PyLith/trunk/pylith/perf/Memory.py	2011-03-08 19:37:16 UTC (rev 18078)
+++ short/3D/PyLith/trunk/pylith/perf/Memory.py	2011-03-08 22:01:45 UTC (rev 18079)
@@ -34,12 +34,12 @@
   if pointerSize == 4:
     sizeSetEntry = 12
     sizeMapEntry = 16
-    sizeArrow    = 40 # 32 bit
+    sizeArrow    = 40 # 32 bit, 3 ints + set entry + map entry
 
   elif pointerSize == 8:
     sizeSetEntry = 24
     sizeMapEntry = 32
-    sizeArrow    = 56 # 64 bit
+    sizeArrow    = 68 # 64 bit, 3 ints + set entry + map entry
 
   elif pointerSize is None:
     sizeSetEntry = 0



More information about the CIG-COMMITS mailing list