[cig-commits] r22726 - short/3D/PyLith/trunk/libsrc/pylith/topology

brad at geodynamics.org brad at geodynamics.org
Wed Aug 21 09:19:44 PDT 2013


Author: brad
Date: 2013-08-21 09:19:44 -0700 (Wed, 21 Aug 2013)
New Revision: 22726

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh
   short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.icc
Log:
Added interface to optimized DMPlexVecGetClosure for submesh visitor (DMPlexGetClosure does not seem to currently support this use).

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh	2013-08-21 15:06:24 UTC (rev 22725)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.hh	2013-08-21 16:19:44 UTC (rev 22726)
@@ -106,6 +106,14 @@
 		  PetscInt* valuesSize,
 		  const PetscInt cell) const;
 
+  /** Get array of values associated with closure.
+   *
+   * @param values Array of values for cell.
+   * @param cell Finite-element cell.
+   */
+  void getClosure(scalar_array* values,
+		  const PetscInt cell) const;
+
   /** Restore array of values associated with closure.
    *
    * @param valuesCell Array of values for cell.

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.icc	2013-08-21 15:06:24 UTC (rev 22725)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/VisitorSubMesh.icc	2013-08-21 16:19:44 UTC (rev 22726)
@@ -116,6 +116,22 @@
 } // getClosure
 
 // ----------------------------------------------------------------------
+// Get coordinates array associated with closure.
+inline
+void
+pylith::topology::VecVisitorSubMesh::getClosure(scalar_array* values,
+						const PetscInt cell) const
+{ // getClosure
+  assert(_dm);
+  assert(_section);
+  assert(_localVec);
+  assert(values);
+  PetscScalar* valuesCell = &(*values)[0];
+  PetscInt valuesSize = values->size();
+  PetscErrorCode err = DMPlexVecGetClosure(_dm, _section, _localVec, cell, &valuesSize, &valuesCell);PYLITH_CHECK_ERROR(err);
+} // getClosure
+
+// ----------------------------------------------------------------------
 // Restore coordinates array associated with closure.
 inline
 void



More information about the CIG-COMMITS mailing list