[cig-commits] r12052 - in short/3D/PyLith/trunk/libsrc: bc meshio topology

knepley at geodynamics.org knepley at geodynamics.org
Thu May 29 07:04:18 PDT 2008


Author: knepley
Date: 2008-05-29 07:04:18 -0700 (Thu, 29 May 2008)
New Revision: 12052

Modified:
   short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
   short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc
   short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
   short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc
   short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
Log:
Fixes for distributed submeshes


Modified: short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc	2008-05-29 09:29:34 UTC (rev 12051)
+++ short/3D/PyLith/trunk/libsrc/bc/AbsorbingDampers.cc	2008-05-29 14:04:18 UTC (rev 12052)
@@ -65,7 +65,18 @@
 	<< "condition '" << _label << "'.";
     throw std::runtime_error(msg.str());
   } // if
+  _boundaryMesh->setRealSection("coordinates", 
+				mesh->getRealSection("coordinates"));
+  // Create the parallel overlap
+  Obj<Mesh::send_overlap_type> sendParallelMeshOverlap = _boundaryMesh->getSendOverlap();
+  Obj<Mesh::recv_overlap_type> recvParallelMeshOverlap = _boundaryMesh->getRecvOverlap();
+  Mesh::renumbering_type&      renumbering             = mesh->getRenumbering();
+  //   Can I figure this out in a nicer way?
+  ALE::SetFromMap<std::map<Mesh::point_type,Mesh::point_type> > globalPoints(renumbering);
 
+  ALE::OverlapBuilder<>::constructOverlap(globalPoints, renumbering, sendParallelMeshOverlap, recvParallelMeshOverlap);
+  _boundaryMesh->setCalculatedOverlap(true);
+
   //_boundaryMesh->view("ABSORBING BOUNDARY MESH");
 
   // check compatibility of quadrature and boundary mesh

Modified: short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc	2008-05-29 09:29:34 UTC (rev 12051)
+++ short/3D/PyLith/trunk/libsrc/bc/DirichletBoundary.cc	2008-05-29 14:04:18 UTC (rev 12052)
@@ -68,7 +68,16 @@
   } // if
   _boundaryMesh->setRealSection("coordinates", 
 				mesh->getRealSection("coordinates"));
+  // Create the parallel overlap
+  Obj<Mesh::send_overlap_type> sendParallelMeshOverlap = _boundaryMesh->getSendOverlap();
+  Obj<Mesh::recv_overlap_type> recvParallelMeshOverlap = _boundaryMesh->getRecvOverlap();
+  Mesh::renumbering_type&      renumbering             = mesh->getRenumbering();
+  //   Can I figure this out in a nicer way?
+  ALE::SetFromMap<std::map<Mesh::point_type,Mesh::point_type> > globalPoints(renumbering);
 
+  ALE::OverlapBuilder<>::constructOverlap(globalPoints, renumbering, sendParallelMeshOverlap, recvParallelMeshOverlap);
+  _boundaryMesh->setCalculatedOverlap(true);
+
   // Get values for degrees of freedom
   char** valueNames = (numFixedDOF > 0) ? new char*[numFixedDOF] : 0;
   for (int i=0; i < numFixedDOF; ++i) {

Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann.cc	2008-05-29 09:29:34 UTC (rev 12051)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann.cc	2008-05-29 14:04:18 UTC (rev 12052)
@@ -69,7 +69,16 @@
   } // if
   _boundaryMesh->setRealSection("coordinates", 
 				mesh->getRealSection("coordinates"));
+  // Create the parallel overlap
+  Obj<Mesh::send_overlap_type> sendParallelMeshOverlap = _boundaryMesh->getSendOverlap();
+  Obj<Mesh::recv_overlap_type> recvParallelMeshOverlap = _boundaryMesh->getRecvOverlap();
+  Mesh::renumbering_type&      renumbering             = mesh->getRenumbering();
+  //   Can I figure this out in a nicer way?
+  ALE::SetFromMap<std::map<Mesh::point_type,Mesh::point_type> > globalPoints(renumbering);
 
+  ALE::OverlapBuilder<>::constructOverlap(globalPoints, renumbering, sendParallelMeshOverlap, recvParallelMeshOverlap);
+  _boundaryMesh->setCalculatedOverlap(true);
+
   //_boundaryMesh->view("TRACTION BOUNDARY MESH");
 
   // check compatibility of quadrature and boundary mesh

Modified: short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc	2008-05-29 09:29:34 UTC (rev 12051)
+++ short/3D/PyLith/trunk/libsrc/meshio/OutputSolnSubset.cc	2008-05-29 14:04:18 UTC (rev 12052)
@@ -66,7 +66,16 @@
   } // if
   _mesh->setRealSection("coordinates", 
 			mesh->getRealSection("coordinates"));
+  // Create the parallel overlap
+  Obj<Mesh::send_overlap_type> sendParallelMeshOverlap = _mesh->getSendOverlap();
+  Obj<Mesh::recv_overlap_type> recvParallelMeshOverlap = _mesh->getRecvOverlap();
+  Mesh::renumbering_type&      renumbering             = mesh->getRenumbering();
+  //   Can I figure this out in a nicer way?
+  ALE::SetFromMap<std::map<Mesh::point_type,Mesh::point_type> > globalPoints(renumbering);
 
+  ALE::OverlapBuilder<>::constructOverlap(globalPoints, renumbering, sendParallelMeshOverlap, recvParallelMeshOverlap);
+  _mesh->setCalculatedOverlap(true);
+
   return _mesh;
 } // subdomainMesh
 

Modified: short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2008-05-29 09:29:34 UTC (rev 12051)
+++ short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2008-05-29 14:04:18 UTC (rev 12052)
@@ -46,30 +46,27 @@
   typedef ALE::DistributionNew<Mesh>        distribution_type;
   typedef distribution_type::partition_type partition_type;
 
-  // IMESH_TODO
-  //   Must distribute auxilliary sections
   const Obj<Mesh::sieve_type>        newSieve        = new Mesh::sieve_type(origMesh->comm(), origMesh->debug());
   const Obj<Mesh::send_overlap_type> sendMeshOverlap = new Mesh::send_overlap_type(origMesh->comm(), origMesh->debug());
   const Obj<Mesh::recv_overlap_type> recvMeshOverlap = new Mesh::recv_overlap_type(origMesh->comm(), origMesh->debug());
-  std::map<point_type,point_type>    renumbering;
 
   *newMesh = new Mesh(origMesh->comm(), origMesh->getDimension(), origMesh->debug());
   (*newMesh)->setSieve(newSieve);
+  // IMESH_TODO
+  //   This might be unnecessary, since the overlap for submeshes is just the restriction of the overlaps
+  // std::map<point_type,point_type>    renumbering;
+  Mesh::renumbering_type&            renumbering     = (*newMesh)->getRenumbering();
   // Distribute the mesh
   if (strlen(partitioner) != 0) {
     std::cout << "ERROR: Using default partitioner instead of " << partitioner << std::endl;
   }
   Obj<partition_type> partition = distribution_type::distributeMeshV(origMesh, (*newMesh), renumbering, sendMeshOverlap, recvMeshOverlap);
-  origMesh->view("Serial Mesh");
-  (*newMesh)->view("Parallel Mesh");
   // Distribute the coordinates
   const Obj<real_section_type>& coordinates         = origMesh->getRealSection("coordinates");
   const Obj<real_section_type>& parallelCoordinates = (*newMesh)->getRealSection("coordinates");
 
   (*newMesh)->setupCoordinates(parallelCoordinates);
   distribution_type::distributeSection(coordinates, partition, renumbering, sendMeshOverlap, recvMeshOverlap, parallelCoordinates);
-  coordinates->view("Serial Coordinates");
-  parallelCoordinates->view("Parallel Coordinates");
   // Distribute other sections
   if (origMesh->getRealSections()->size() > 1) {
     throw ALE::Exception("Need to distribute more real sections");
@@ -84,13 +81,14 @@
       // We assume all integer sections are complete sections
       newSection->setChart((*newMesh)->getSieve()->getChart());
       distribution_type::distributeSection(origSection, partition, renumbering, sendMeshOverlap, recvMeshOverlap, newSection);
-      std::cout << "Distributed integer section " << *n_iter << std::endl;
+#if 0
       std::string serialName("Serial ");
       std::string parallelName("Parallel ");
       serialName   += *n_iter;
       parallelName += *n_iter;
       origSection->view(serialName.c_str());
       newSection->view(parallelName.c_str());
+#endif
     }
   }
   if (origMesh->getArrowSections()->size() > 1) {
@@ -107,12 +105,14 @@
     ALE::New::Completion<Mesh,Mesh::point_type>::scatterCones(origLabel, newLabel, sendMeshOverlap, recvMeshOverlap, renumbering);
     // Create local label
     newLabel->add(origLabel, (*newMesh)->getSieve(), renumbering);
+#if 0
     std::string serialName("Serial ");
     std::string parallelName("Parallel ");
     serialName   += l_iter->first;
     parallelName += l_iter->first;
     origLabel->view(serialName.c_str());
     newLabel->view(parallelName.c_str());
+#endif
   }
   // Create the parallel overlap
   Obj<Mesh::send_overlap_type> sendParallelMeshOverlap = (*newMesh)->getSendOverlap();



More information about the cig-commits mailing list