[cig-commits] r15197 - in short/3D/PyLith/trunk: . libsrc/topology modulesrc/topology tests/2d/quad4

brad at geodynamics.org brad at geodynamics.org
Thu Jun 11 11:11:40 PDT 2009


Author: brad
Date: 2009-06-11 11:11:39 -0700 (Thu, 11 Jun 2009)
New Revision: 15197

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/topology/Fields.hh
   short/3D/PyLith/trunk/libsrc/topology/Mesh.cc
   short/3D/PyLith/trunk/libsrc/topology/Mesh.hh
   short/3D/PyLith/trunk/libsrc/topology/SolutionFields.cc
   short/3D/PyLith/trunk/libsrc/topology/SolutionFields.hh
   short/3D/PyLith/trunk/libsrc/topology/SubMesh.cc
   short/3D/PyLith/trunk/libsrc/topology/SubMesh.hh
   short/3D/PyLith/trunk/modulesrc/topology/Fields.i
   short/3D/PyLith/trunk/modulesrc/topology/Mesh.i
   short/3D/PyLith/trunk/modulesrc/topology/SubMesh.i
   short/3D/PyLith/trunk/tests/2d/quad4/testpylith.py
Log:
More work on adding deallocate() methods to allow explicit deallocation from Python.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/TODO	2009-06-11 18:11:39 UTC (rev 15197)
@@ -55,6 +55,7 @@
       materials C++, SWIG
       meshio C++, SWIG
       problems C++, SWIG
+      topology C++, SWIG
 
 2. Add missing unit tests
 

Modified: short/3D/PyLith/trunk/libsrc/topology/Fields.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Fields.hh	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/libsrc/topology/Fields.hh	2009-06-11 18:11:39 UTC (rev 15197)
@@ -43,9 +43,11 @@
   Fields(const typename field_type::Mesh& mesh);
 
   /// Destructor.
+  virtual
   ~Fields(void);
 
   /// Deallocate PETSc and local data structures.
+  virtual
   void deallocate(void);
   
   /** Check if fields contains a given field.

Modified: short/3D/PyLith/trunk/libsrc/topology/Mesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Mesh.cc	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/libsrc/topology/Mesh.cc	2009-06-11 18:11:39 UTC (rev 15197)
@@ -44,10 +44,18 @@
 // Default destructor
 pylith::topology::Mesh::~Mesh(void)
 { // destructor
-  delete _coordsys; _coordsys = 0;
+  deallocate();
 } // destructor
 
 // ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::topology::Mesh::deallocate(void)
+{ // deallocate
+  delete _coordsys; _coordsys = 0;
+} // deallocate
+  
+// ----------------------------------------------------------------------
 // Create Sieve mesh.
 void
 pylith::topology::Mesh::createSieveMesh(const int dim)

Modified: short/3D/PyLith/trunk/libsrc/topology/Mesh.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Mesh.hh	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/libsrc/topology/Mesh.hh	2009-06-11 18:11:39 UTC (rev 15197)
@@ -72,6 +72,9 @@
   /// Default destructor
   ~Mesh(void);
 
+  /// Deallocate PETSc and local data structures.
+  void deallocate(void);
+  
   /** Create Sieve mesh.
    *
    * @param dim Dimension associated with mesh cells.

Modified: short/3D/PyLith/trunk/libsrc/topology/SolutionFields.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/SolutionFields.cc	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/libsrc/topology/SolutionFields.cc	2009-06-11 18:11:39 UTC (rev 15197)
@@ -28,9 +28,18 @@
 // Destructor.
 pylith::topology::SolutionFields::~SolutionFields(void)
 { // destructor
+  deallocate();
 } // destructor
 
 // ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::topology::SolutionFields::deallocate(void)
+{ // deallocate
+  Fields<Field<Mesh> >::deallocate();
+} // deallocate
+  
+// ----------------------------------------------------------------------
 // Set name of solution field.
 void
 pylith::topology::SolutionFields::solutionName(const char* name)

Modified: short/3D/PyLith/trunk/libsrc/topology/SolutionFields.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/SolutionFields.hh	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/libsrc/topology/SolutionFields.hh	2009-06-11 18:11:39 UTC (rev 15197)
@@ -46,6 +46,9 @@
   /// Destructor.
   ~SolutionFields(void);
 
+  /// Deallocate PETSc and local data structures.
+  void deallocate(void);
+  
   /** Set name of field used in the solve.
    *
    * @param name Name of field that holds the solution.

Modified: short/3D/PyLith/trunk/libsrc/topology/SubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/SubMesh.cc	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/libsrc/topology/SubMesh.cc	2009-06-11 18:11:39 UTC (rev 15197)
@@ -40,10 +40,18 @@
 // Default destructor
 pylith::topology::SubMesh::~SubMesh(void)
 { // destructor
-  delete _coordsys; _coordsys = 0;
+  deallocate();
 } // destructor
 
 // ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::topology::SubMesh::deallocate(void)
+{ // deallocate
+  delete _coordsys; _coordsys = 0;
+} // deallocate
+  
+// ----------------------------------------------------------------------
 // Create Sieve mesh.
 void
 pylith::topology::SubMesh::createSubMesh(const Mesh& mesh,

Modified: short/3D/PyLith/trunk/libsrc/topology/SubMesh.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/SubMesh.hh	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/libsrc/topology/SubMesh.hh	2009-06-11 18:11:39 UTC (rev 15197)
@@ -64,6 +64,9 @@
   /// Default destructor
   ~SubMesh(void);
 
+  /// Deallocate PETSc and local data structures.
+  void deallocate(void);
+  
   /** Create Sieve mesh.
    *
    * @param mesh Finite-element mesh over domain.

Modified: short/3D/PyLith/trunk/modulesrc/topology/Fields.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/Fields.i	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/modulesrc/topology/Fields.i	2009-06-11 18:11:39 UTC (rev 15197)
@@ -33,9 +33,11 @@
       Fields(const typename field_type::Mesh& mesh);
 
       /// Destructor.
+      virtual
       ~Fields(void);
 
       /// Deallocate PETSc and local data structures.
+      virtual
       void deallocate(void);
 
       /** Check if fields contains a given field.

Modified: short/3D/PyLith/trunk/modulesrc/topology/Mesh.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/Mesh.i	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/modulesrc/topology/Mesh.i	2009-06-11 18:11:39 UTC (rev 15197)
@@ -40,6 +40,10 @@
       /// Default destructor
       ~Mesh(void);
       
+      /// Deallocate PETSc and local data structures.
+      virtual
+      void deallocate(void);
+
       /** Create Sieve mesh.
        *
        * @param dim Dimension associated with mesh cells.

Modified: short/3D/PyLith/trunk/modulesrc/topology/SubMesh.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/SubMesh.i	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/modulesrc/topology/SubMesh.i	2009-06-11 18:11:39 UTC (rev 15197)
@@ -39,6 +39,10 @@
       /// Default destructor
       ~SubMesh(void);
       
+      /// Deallocate PETSc and local data structures.
+      virtual
+      void deallocate(void);
+
       /** Create Sieve mesh.
        *
        * @param mesh Finite-element mesh over domain.

Modified: short/3D/PyLith/trunk/tests/2d/quad4/testpylith.py
===================================================================
--- short/3D/PyLith/trunk/tests/2d/quad4/testpylith.py	2009-06-11 17:43:28 UTC (rev 15196)
+++ short/3D/PyLith/trunk/tests/2d/quad4/testpylith.py	2009-06-11 18:11:39 UTC (rev 15197)
@@ -23,8 +23,8 @@
   from TestAxialShearDisp import TestAxialShearDisp
   suite.addTest(unittest.makeSuite(TestAxialShearDisp))
 
-  #from TestAxialShearTract import TestShearShearTract
-  #suite.addTest(unittest.makeSuite(TestShearShearTract))
+  #from TestAxialShearTract import TestAxislShearTract
+  #suite.addTest(unittest.makeSuite(TestAxialShearTract))
 
   #from TestDislocation import TestDislocation
   #suite.addTest(unittest.makeSuite(TestDislocation))



More information about the CIG-COMMITS mailing list