[cig-commits] r16692 - in short/3D/PyLith/trunk/libsrc: problems topology

knepley at geodynamics.org knepley at geodynamics.org
Wed May 12 05:51:19 PDT 2010


Author: knepley
Date: 2010-05-12 05:51:19 -0700 (Wed, 12 May 2010)
New Revision: 16692

Modified:
   short/3D/PyLith/trunk/libsrc/problems/SolverLinear.cc
   short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
   short/3D/PyLith/trunk/libsrc/topology/ReverseCuthillMcKee.cc
Log:
1) Should ahve fixed distribution
2) Added first bit of code for fault FS


Modified: short/3D/PyLith/trunk/libsrc/problems/SolverLinear.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/problems/SolverLinear.cc	2010-05-12 09:25:46 UTC (rev 16691)
+++ short/3D/PyLith/trunk/libsrc/problems/SolverLinear.cc	2010-05-12 12:51:19 UTC (rev 16692)
@@ -91,6 +91,26 @@
     err = PCSetFromOptions(pc); CHECK_PETSC_ERROR(err);
 #if defined(FIELD_SPLIT)
     constructFieldSplit(residual.section(), sieveMesh->getFactory()->getGlobalOrder(sieveMesh, "default", residual.section()), residual.vector(), pc);
+    if (residual.section()->getNumSpaces() > sieveMesh->getDimension()) {
+      KSP     *ksps;
+      Mat      A, M;
+      PetscInt num, m, n;
+
+      err = PCFieldSplitGetSubKSP(pc, &num, &ksps); CHECK_PETSC_ERROR(err);
+      // Put in PC matrix for fault
+      MatStructure flag;
+      err = KSPGetOperators(ksps[num-1], &A, PETSC_NULL, &flag); CHECK_PETSC_ERROR(err);
+      err = PetscObjectReference((PetscObject) A); CHECK_PETSC_ERROR(err);
+      err = MatGetLocalSize(A, &m, &n); CHECK_PETSC_ERROR(err);
+      err = MatCreate(sieveMesh->comm(), &M); CHECK_PETSC_ERROR(err);
+      err = MatSetSizes(M, m, n, PETSC_DECIDE, PETSC_DECIDE); CHECK_PETSC_ERROR(err);
+      err = MatSeqAIJSetPreallocation(M, 1, PETSC_NULL); CHECK_PETSC_ERROR(err);
+      err = MatMPIAIJSetPreallocation(M, 1, PETSC_NULL, 0, PETSC_NULL); CHECK_PETSC_ERROR(err);
+      err = MatSetFromOptions(M); CHECK_PETSC_ERROR(err);
+      err = KSPSetOperators(ksps[num-1], A, M, flag); CHECK_PETSC_ERROR(err);
+      // Create a mapping to indices for that space (might be in FS)
+      err = PetscFree(ksps); CHECK_PETSC_ERROR(err);
+    }
 #endif
   }
 } // initialize

Modified: short/3D/PyLith/trunk/libsrc/topology/Distributor.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2010-05-12 09:25:46 UTC (rev 16691)
+++ short/3D/PyLith/trunk/libsrc/topology/Distributor.cc	2010-05-12 12:51:19 UTC (rev 16692)
@@ -277,10 +277,7 @@
 					newLabel);
     newLabel->symmetrize();
 #else
-    // Get remote labels
-    ALE::New::Completion<SieveMesh,SieveMesh::point_type>::scatterCones(origLabel, newLabel, sendMeshOverlap, recvMeshOverlap, renumbering);
-    // Create local label
-    newLabel->add(origLabel, newSieveMesh->getSieve(), renumbering);
+	DistributionType::distributeLabelV(newSieveMesh->getSieve(), origLabel, partition, renumbering, sendMeshOverlap, recvMeshOverlap, newLabel);
 #if 0 // DEBUGGING
     std::string serialName("Serial ");
     std::string parallelName("Parallel ");

Modified: short/3D/PyLith/trunk/libsrc/topology/ReverseCuthillMcKee.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/ReverseCuthillMcKee.cc	2010-05-12 09:25:46 UTC (rev 16691)
+++ short/3D/PyLith/trunk/libsrc/topology/ReverseCuthillMcKee.cc	2010-05-12 12:51:19 UTC (rev 16692)
@@ -52,7 +52,7 @@
     //sieveMesh->view("MESH AFTER RELABEL");
   } // if    
 
-    //logger.stagePop();
+  //logger.stagePop();
 } // reorder
 
 



More information about the CIG-COMMITS mailing list