[cig-commits] r21999 - in short/3D/PyLith/trunk: libsrc/pylith/feassemble libsrc/pylith/topology modulesrc/topology tests_auto/1d/line2

brad at geodynamics.org brad at geodynamics.org
Tue May 7 13:41:31 PDT 2013


Author: brad
Date: 2013-05-07 13:41:30 -0700 (Tue, 07 May 2013)
New Revision: 21999

Modified:
   short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
   short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh
   short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.hh
   short/3D/PyLith/trunk/modulesrc/topology/Field.i
   short/3D/PyLith/trunk/tests_auto/1d/line2/extensionforce.cfg
Log:
Code cleanup.

Modified: short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2013-05-07 19:56:46 UTC (rev 21998)
+++ short/3D/PyLith/trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2013-05-07 20:41:30 UTC (rev 21999)
@@ -296,9 +296,9 @@
   assert(_material);
   assert(_normalizer);
 
-  if (0 == _outputFields)
-    _outputFields =
-      new topology::Fields<topology::Field<topology::Mesh> >(mesh);
+  if (!_outputFields) {
+    _outputFields = new topology::Fields<topology::Field<topology::Mesh> >(mesh);assert(_outputFields);
+  } // if
   
   if (0 == strcasecmp(name, "total_strain")) {
 

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc	2013-05-07 19:56:46 UTC (rev 21998)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.cc	2013-05-07 20:41:30 UTC (rev 21999)
@@ -1000,63 +1000,6 @@
 template<typename mesh_type>
 template<typename scatter_mesh_type>
 void
-pylith::topology::Field<mesh_type>::createScatter(const scatter_mesh_type& mesh,
-						  const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
-						  const char* context)
-{ // createScatter
-  PYLITH_METHOD_BEGIN;
-
-  assert(!numbering.isNull());
-  assert(context);
-  PetscErrorCode err = 0;
-
-  const bool createScatterOk = true;
-  ScatterInfo& sinfo = _getScatter(context, createScatterOk);
-  
-  // Only create if scatter and scatterVec do not alreay exist.
-  if (sinfo.scatter) {
-    assert(sinfo.scatterVec);
-    assert(sinfo.vector);
-    PYLITH_METHOD_END;
-  } // if
-
-  PetscInt localSize, globalSize;
-
-  err = PetscObjectReference((PetscObject) _dm);PYLITH_CHECK_ERROR(err);
-  err = PetscObjectReference((PetscObject) _globalVec);PYLITH_CHECK_ERROR(err);
-  err = PetscObjectSetName((PetscObject) _globalVec, _metadata["default"].label.c_str());PYLITH_CHECK_ERROR(err);
-  err = VecGetSize(_localVec,  &localSize);PYLITH_CHECK_ERROR(err);
-  err = VecGetSize(_globalVec, &globalSize);PYLITH_CHECK_ERROR(err);
-  //assert(order->getLocalSize()  == localSize);
-  //assert(order->getGlobalSize() == globalSize);
-
-  err = DMDestroy(&sinfo.dm);PYLITH_CHECK_ERROR(err);
-  err = VecDestroy(&sinfo.vector);PYLITH_CHECK_ERROR(err);
-  sinfo.vector = _globalVec;
-  sinfo.dm     = _dm;
-
-#if 0
-  std::cout << "CONTEXT: " << context 
-	    << ", orderLabel: " << orderLabel
-	    << ", section size w/BC: " << _section->sizeWithBC()
-	    << ", section size: " << _section->size()
-	    << ", global numbering size: " << numbering->getGlobalSize()
-	    << ", global size: " << order->getGlobalSize()
-	    << std::endl;
-#endif
-  
-  PYLITH_METHOD_END;
-} // createScatter
-
-// ----------------------------------------------------------------------
-// Create PETSc vector scatter for field. This is used to transfer
-// information from the "global" PETSc vector view to the "local"
-// PETSc section view. The PETSc vector does not contain constrained
-// DOF. Use createScatterWithBC() to include the constrained DOF in
-// the PETSc vector.
-template<typename mesh_type>
-template<typename scatter_mesh_type>
-void
 pylith::topology::Field<mesh_type>::createScatterWithBC(const scatter_mesh_type& mesh,
 							const char* context)
 { // createScatterWithBC

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh	2013-05-07 19:56:46 UTC (rev 21998)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.hh	2013-05-07 20:41:30 UTC (rev 21999)
@@ -41,7 +41,7 @@
 /** @brief Vector field over the vertices or cells of a finite-element
  * mesh.
  *
- * Extends Sieve real general section by adding metadata.
+ * Extends PETSc section and vector by adding metadata.
  */
 template<typename mesh_type>
 class pylith::topology::Field : public FieldBase
@@ -204,7 +204,7 @@
    */
   PetscVec globalVector(void) const;
 
-  /** Get the number of sieve points in the chart.
+  /** Get the number of points in the chart.
    *
    * @returns the chart size.
    */
@@ -216,13 +216,13 @@
    */
   int sectionSize(void) const;
 
-  /** Create sieve section.
+  /** Create PETSc section.
    *
    * @note Don't forget to call label().
    */
   void newSection(void);
 
-  /** Create sieve section and set chart and fiber dimesion for a list
+  /** Create PETSc section and set chart and fiber dimesion for a list
    * of points.
    *
    * @param pStart First point
@@ -235,7 +235,7 @@
 		  const PetscInt pEnd,
 		  const int fiberDim);
 
-  /** Create sieve section and set chart and fiber dimesion for a list
+  /** Create PETSc section and set chart and fiber dimesion for a list
    * of points.
    *
    * @param points Points over which to define section.
@@ -246,7 +246,7 @@
   void newSection(const int_array& points,
                   const int fiberDim);
 
-  /** Create sieve section and set chart and fiber dimesion for a list
+  /** Create PETSc section and set chart and fiber dimesion for a list
    * of points.
    *
    * @param points Points over which to define section.
@@ -259,7 +259,7 @@
                   const PetscInt num,
                   const int fiberDim);
 
-  /** Create sieve section and set chart and fiber dimesion.
+  /** Create PETSc section and set chart and fiber dimesion.
    *
    * @param domain Type of points over which to define section.
    * @param dim Fiber dimension for section.
@@ -359,7 +359,7 @@
 
   /** Create PETSc vector scatter for field. This is used to transfer
    * information from the "global" PETSc vector view to the "local"
-   * Sieve section view. The PETSc vector does not contain constrained
+   * PETSc section view. The PETSc vector does not contain constrained
    * DOF. Use createScatterWithBC() to include the constrained DOF in
    * the PETSc vector.
    *
@@ -373,22 +373,7 @@
 
   /** Create PETSc vector scatter for field. This is used to transfer
    * information from the "global" PETSc vector view to the "local"
-   * Sieve section view. The PETSc vector does not contain constrained
-   * DOF. Use createScatterWithBC() to include the constrained DOF in
-   * the PETSc vector.
-   *
-   * @param mesh Mesh associated with scatter.
-   * @param numbering Numbering used to select points in section.
-   * @param context Label for context associated with vector.
-   */
-  template<typename scatter_mesh_type>
-  void createScatter(const scatter_mesh_type& mesh,
-		     const typename ALE::Obj<typename SieveMesh::numbering_type> numbering,
-		     const char* context ="");
-
-  /** Create PETSc vector scatter for field. This is used to transfer
-   * information from the "global" PETSc vector view to the "local"
-   * Sieve section view. The PETSc vector includes constrained
+   * PETSc section view. The PETSc vector includes constrained
    * DOF. Use createScatter() if constrained DOF should be omitted
    * from the PETSc vector.
    *
@@ -402,7 +387,7 @@
 
   /** Create PETSc vector scatter for field. This is used to transfer
    * information from the "global" PETSc vector view to the "local"
-   * Sieve section view. The PETSc vector includes constrained
+   * PETSc section view. The PETSc vector includes constrained
    * DOF. Use createScatter() if constrained DOF should be omitted
    * from the PETSc vector.
    *
@@ -444,7 +429,7 @@
 			      const char* context ="") const;
 
   /// Scatter PETSc vector information across processors to update the
-  /// Sieve section view of the field.
+  /// PETSc section view of the field.
   void scatterVectorToSection(const char* context ="") const;
 
   /** Scatter section information across processors to update the

Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.hh	2013-05-07 19:56:46 UTC (rev 21998)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/SubMesh.hh	2013-05-07 20:41:30 UTC (rev 21999)
@@ -34,7 +34,7 @@
 // SubMesh -----------------------------------------------------------------
 /** @brief C++ PyLith finite-element mesh.
  *
- * Extends Sieve mesh over subset of domain to include coordinate
+ * Extends mesh over subset of domain to include coordinate
  * system associated with domain. Also has functions to simply
  * creating submeshes from groups of vertices.
  */
@@ -75,7 +75,7 @@
   /// Deallocate PETSc and local data structures.
   void deallocate(void);
   
-  /** Create Sieve mesh.
+  /** Create mesh.
    *
    * @param mesh Finite-element mesh over domain.
    * @param label Label for vertices marking boundary.

Modified: short/3D/PyLith/trunk/modulesrc/topology/Field.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/Field.i	2013-05-07 19:56:46 UTC (rev 21998)
+++ short/3D/PyLith/trunk/modulesrc/topology/Field.i	2013-05-07 20:41:30 UTC (rev 21999)
@@ -43,15 +43,6 @@
     class Field : public FieldBase
     { // Field
 
-      // PRIVATE TYPEDEFS ///////////////////////////////////////////////
-    private:
-
-      // Convenience typedefs
-      typedef typename mesh_type::RealSection RealSection;
-      typedef typename mesh_type::SieveMesh SieveMesh;
-      typedef typename SieveMesh::label_sequence label_sequence;
-      typedef typename RealSection::chart_type chart_type;
-      
       // PUBLIC MEMBERS /////////////////////////////////////////////////
     public :
 
@@ -127,7 +118,7 @@
        */
       int spaceDim(void) const;
       
-      /** Get the number of sieve points in the chart.
+      /** Get the number of points in the chart.
        *
        * @returns the chart size.
        */
@@ -139,10 +130,10 @@
        */
       int sectionSize(void) const;
       
-      /// Create sieve section.
+      /// Create PETSc section.
       void newSection(void);
 
-      /** Create sieve section and set chart and fiber dimesion.
+      /** Create PETSc section and set chart and fiber dimesion.
        *
        * @param domain Type of points over which to define section.
        * @param dim Fiber dimension for section.
@@ -207,7 +198,7 @@
 
       /** Create PETSc vector scatter for field. This is used to transfer
        * information from the "global" PETSc vector view to the "local"
-       * Sieve section view.
+       * PETSc section view.
        *
        * @param mesh Mesh associated with scatter.
        * @param context Label for context associated with vector.
@@ -243,7 +234,7 @@
 				  const char* context ="") const;
 
       /// Scatter PETSc vector information across processors to update the
-      /// Sieve section view of the field.
+      /// PETSc section view of the field.
       void scatterVectorToSection(const char* context ="") const;
 
       /** Scatter section information across processors to update the

Modified: short/3D/PyLith/trunk/tests_auto/1d/line2/extensionforce.cfg
===================================================================
--- short/3D/PyLith/trunk/tests_auto/1d/line2/extensionforce.cfg	2013-05-07 19:56:46 UTC (rev 21998)
+++ short/3D/PyLith/trunk/tests_auto/1d/line2/extensionforce.cfg	2013-05-07 20:41:30 UTC (rev 21999)
@@ -58,7 +58,7 @@
 bc_dof = [0]
 label = end points
 db_initial = spatialdata.spatialdb.SimpleDB
-db_initial.label = Dirichlet BC
+db_initial.label = Point force BC
 db_initial.iohandler.filename = extensionforce_force.spatialdb
 
 [extensionforce.timedependent.bc.fixed]
@@ -87,6 +87,10 @@
 #log_summary = true
 #start_in_debugger = true
 
+malloc =
+malloc_debug =
+malloc_dump =
+
 # ----------------------------------------------------------------------
 # output
 # ----------------------------------------------------------------------



More information about the CIG-COMMITS mailing list