[cig-commits] [commit] knepley/upgrade-petsc-interface: MeshIO: Fixed label creation - Add in all points with marked vertices in cone (67be97c)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Sun Oct 27 19:50:44 PDT 2013


Repository : ssh://geoshell/pylith

On branch  : knepley/upgrade-petsc-interface
Link       : https://github.com/geodynamics/pylith/compare/11516665d428fb2011474a51003f5a4392254f88...ddec17cceaaa7d5af70422c750708f53308ae6c9

>---------------------------------------------------------------

commit 67be97c1e9bd3838365da6ca9c7a74980d20472c
Author: Matthew G. Knepley <knepley at gmail.com>
Date:   Sun Oct 27 21:52:26 2013 -0500

    MeshIO: Fixed label creation
    - Add in all points with marked vertices in cone


>---------------------------------------------------------------

67be97c1e9bd3838365da6ca9c7a74980d20472c
 libsrc/pylith/meshio/MeshIO.cc | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/libsrc/pylith/meshio/MeshIO.cc b/libsrc/pylith/meshio/MeshIO.cc
index b4cc65f..7f0f92e 100644
--- a/libsrc/pylith/meshio/MeshIO.cc
+++ b/libsrc/pylith/meshio/MeshIO.cc
@@ -290,27 +290,27 @@ pylith::meshio::MeshIO::_setGroup(const std::string& name,
     } // for
     // Also add any non-cells which have all vertices marked
     for(PetscInt p = 0; p < numPoints; ++p) {
-      const PetscInt *support;
-      PetscInt        supportSize, s;
-      const PetscInt  vertex = numCells+points[p];
-
-      err = DMPlexGetSupportSize(dmMesh, vertex, &supportSize);PYLITH_CHECK_ERROR(err);
-      err = DMPlexGetSupport(dmMesh, vertex, &support);PYLITH_CHECK_ERROR(err);
-      for (s = 0; s < supportSize; ++s) {
-        PetscInt *closure = NULL, closureSize, c, value;
-        PetscBool marked  = PETSC_TRUE;
-
-        if ((support[s] >= cStart) && (support[s] < cEnd)) continue;
-        err = DMPlexGetTransitiveClosure(dmMesh, support[s], PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+      const PetscInt vertex = numCells+points[p];
+      PetscInt      *star   = NULL, starSize, s;
+
+      err = DMPlexGetTransitiveClosure(dmMesh, vertex, PETSC_FALSE, &starSize, &star);PYLITH_CHECK_ERROR(err);
+      for (s = 0; s < starSize*2; s += 2) {
+        const PetscInt point   = star[s];
+        PetscInt      *closure = NULL, closureSize, c, value;
+        PetscBool      marked  = PETSC_TRUE;
+
+        if ((point >= cStart) && (point < cEnd)) continue;
+        err = DMPlexGetTransitiveClosure(dmMesh, point, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
         for (c = 0; c < closureSize*2; c += 2) {
           if ((closure[c] >= vStart) && (closure[c] < vEnd)) {
             err = DMLabelGetValue(label, closure[c], &value);PYLITH_CHECK_ERROR(err);
             if (value != 1) {marked = PETSC_FALSE; break;}
           }
         }
-        err = DMPlexRestoreTransitiveClosure(dmMesh, support[s], PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
-        if (marked) {err = DMLabelSetValue(label, support[s], 1);PYLITH_CHECK_ERROR(err);}
+        err = DMPlexRestoreTransitiveClosure(dmMesh, point, PETSC_TRUE, &closureSize, &closure);PYLITH_CHECK_ERROR(err);
+        if (marked) {err = DMLabelSetValue(label, point, 1);PYLITH_CHECK_ERROR(err);}
       }
+      err = DMPlexRestoreTransitiveClosure(dmMesh, vertex, PETSC_FALSE, &starSize, &star);PYLITH_CHECK_ERROR(err);
     }
   } // if/else
 



More information about the CIG-COMMITS mailing list