[cig-commits] r15308 - in short/3D/PyLith/trunk: . libsrc/bc libsrc/topology modulesrc/topology

brad at geodynamics.org brad at geodynamics.org
Tue Jun 16 16:21:59 PDT 2009


Author: brad
Date: 2009-06-16 16:21:56 -0700 (Tue, 16 Jun 2009)
New Revision: 15308

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.cc
   short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.hh
   short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.icc
   short/3D/PyLith/trunk/libsrc/topology/Jacobian.cc
   short/3D/PyLith/trunk/libsrc/topology/Jacobian.hh
   short/3D/PyLith/trunk/modulesrc/topology/Jacobian.i
Log:
Made view() const. A little work on time-dependent Neumann.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2009-06-16 22:27:25 UTC (rev 15307)
+++ short/3D/PyLith/trunk/TODO	2009-06-16 23:21:56 UTC (rev 15308)
@@ -9,23 +9,15 @@
 
   Need generalized Maxwell full-scale "test".
 
-  Extensions
-
-    Constitutive model
-
-  Time dependent BC
-    fixed_dof -> bc_dof (Python only)
-    bc_dof in TimeDependentPoints, not TimeDependent
-
   Time dependent Neumann BC
 
-
-
   TimeDependent.py
-    fixed_
+    fixed_dof to bc_dof - PYRE PROPERTY
 
 BONUS
 
+  Add more to READMEs for extensions.
+
   pylithinfo (Python application, send extra args to PyLith)
 
   Memory model
@@ -90,10 +82,6 @@
 
     Add Savage-Prescott [CHARLES]
   
-  Extending PyLith [BRAD]
-
-    Material properties
-
   * Reduce memory use with ordering elements by material??
 
 2. Tidy up
@@ -209,10 +197,6 @@
   of creating handle to C++ object (not necessary in abstract base
   classes).
 
-  Create createModuleObj() methods to Python objects as standard way
-  of creating handle to C++ object (not necessary in abstract base
-  classes).
-
   Add check before calling newSection() when want to enforce at
   least 1 value.
 

Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.cc	2009-06-16 22:27:25 UTC (rev 15307)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.cc	2009-06-16 23:21:56 UTC (rev 15308)
@@ -23,17 +23,23 @@
 #include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
 
 #include <cstring> // USES strcpy()
+#include <strings.h> // USES strcasecmp()
 #include <cassert> // USES assert()
 #include <stdexcept> // USES std::runtime_error
 #include <sstream> // USES std::ostringstream
 
+//#define PRECOMPUTE_GEOMETRY
+
 // ----------------------------------------------------------------------
-typedef pylith::topology::SubMesh::SieveSubMesh SieveSubMesh;
-typedef pylith::topology::SubMesh::RealSection RealSection;
+typedef pylith::topology::SubMesh::SieveMesh SieveSubMesh;
+typedef pylith::topology::SubMesh::RealSection SubRealSection;
+typedef pylith::topology::Mesh::RealSection RealSection;
+typedef pylith::topology::Mesh::RestrictVisitor RestrictVisitor;
 
 // ----------------------------------------------------------------------
 // Default constructor.
-pylith::bc::Neumann::Neumann(void)
+pylith::bc::Neumann::Neumann(void) :
+  _db(0)
 { // constructor
 } // constructor
 
@@ -41,18 +47,28 @@
 // Destructor.
 pylith::bc::Neumann::~Neumann(void)
 { // destructor
+  deallocate();
 } // destructor
 
 // ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+void
+pylith::bc::Neumann::deallocate(void)
+{ // deallocate
+  _db = 0; // :TODO: Use shared pointer
+} // deallocate
+  
+// ----------------------------------------------------------------------
 // Initialize boundary condition. Determine orienation and compute traction
 // vector at integration points.
 void
 pylith::bc::Neumann::initialize(const topology::Mesh& mesh,
 				const double upDir[3])
 { // initialize
+  _queryDatabases();
+
   double_array up(upDir, 3);
-  _queryDatabases(up);
-  _paramsLocalToGlobal();
+  _paramsLocalToGlobal(up);
 
   // Get 'surface' cells (1 dimension lower than top-level cells)
   const ALE::Obj<SieveSubMesh>& subSieveMesh = _boundaryMesh->sieveMesh();
@@ -87,27 +103,27 @@
   double_array orientation(orientationSize);
 
   // Set names based on dimension of problem.
-  // 1-D problem = {'normal-traction'}
-  // 2-D problem = {'shear-traction', 'normal-traction'}
-  // 3-D problem = {'horiz-shear-traction', 'vert-shear-traction',
-  //                'normal-traction'}
+  // 1-D problem = {'traction-normal'}
+  // 2-D problem = {'traction-shear', 'traction-normal'}
+  // 3-D problem = {'traction-shear-horiz', 'traction-shear-vert',
+  //                'traction-normal'}
   _db->open();
   switch (spaceDim)
     { // switch
     case 1 : {
-      const char* valueNames[] = {"normal-traction"};
+      const char* valueNames[] = {"traction-normal"};
       _db->queryVals(valueNames, 1);
       break;
     } // case 1
     case 2 : {
-      const char* valueNames[] = {"shear-traction", "normal-traction"};
+      const char* valueNames[] = {"traction-shear", "traction-normal"};
       _db->queryVals(valueNames, 2);
       break;
     } // case 2
     case 3 : {
-      const char* valueNames[] = {"horiz-shear-traction",
-				  "vert-shear-traction",
-				  "normal-traction"};
+      const char* valueNames[] = {"traction-shear-horiz",
+				  "traction-shear-vert",
+				  "traction-normal"};
       _db->queryVals(valueNames, 3);
       break;
     } // case 3
@@ -486,6 +502,36 @@
 
   const double lengthScale = _getNormalizer().lengthScale();
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
   double_array coordsVertex(spaceDim);
   const ALE::Obj<SieveMesh>& sieveMesh = _boundaryMesh->sieveMesh();
   assert(!sieveMesh.isNull());

Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.hh	2009-06-16 22:27:25 UTC (rev 15307)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.hh	2009-06-16 23:21:56 UTC (rev 15308)
@@ -38,6 +38,15 @@
   /// Destructor.
   ~Neumann(void);
 
+  /// Deallocate PETSc and local data structures.
+  void deallocate(void);
+  
+  /** Set database for boundary condition parameters.
+   *
+   * @param db Spatial database
+   */
+  void db(spatialdata::spatialdb::SpatialDB* const db);
+
   /** Initialize boundary condition.
    *
    * @param mesh Finite-element mesh.
@@ -87,6 +96,11 @@
   cellField(const char* name,
 	    topology::SolutionFields* const fields);
 
+  // PRIVATE MEMBERS ////////////////////////////////////////////////////
+private :
+
+  spatialdata::spatialdb::SpatialDB* _db; ///< Spatial database w/parameters
+
   // PROTECTED METHODS //////////////////////////////////////////////////
 protected :
 

Modified: short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.icc	2009-06-16 22:27:25 UTC (rev 15307)
+++ short/3D/PyLith/trunk/libsrc/bc/Neumann_NEW.icc	2009-06-16 23:21:56 UTC (rev 15308)
@@ -14,6 +14,13 @@
 #error "Neumann.icc can only be included from Neumann.hh"
 #endif
 
+// Set database for boundary condition parameters.
+inline
+void
+pylith::bc::Neumann::db(spatialdata::spatialdb::SpatialDB* const db) {
+  _db = db;
+}
+
 // Get label of boundary condition surface.
 inline
 const char*

Modified: short/3D/PyLith/trunk/libsrc/topology/Jacobian.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Jacobian.cc	2009-06-16 22:27:25 UTC (rev 15307)
+++ short/3D/PyLith/trunk/libsrc/topology/Jacobian.cc	2009-06-16 23:21:56 UTC (rev 15308)
@@ -111,7 +111,7 @@
 // ----------------------------------------------------------------------
 // View matrix to stdout.
 void
-pylith::topology::Jacobian::view(void)
+pylith::topology::Jacobian::view(void) const
 { // view
   PetscErrorCode err = MatView(_matrix, PETSC_VIEWER_STDOUT_WORLD);
   CHECK_PETSC_ERROR(err);

Modified: short/3D/PyLith/trunk/libsrc/topology/Jacobian.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/topology/Jacobian.hh	2009-06-16 22:27:25 UTC (rev 15307)
+++ short/3D/PyLith/trunk/libsrc/topology/Jacobian.hh	2009-06-16 23:21:56 UTC (rev 15308)
@@ -71,7 +71,7 @@
   void zero(void);
 
   /// View matrix to stdout.
-  void view(void);
+  void view(void) const;
 
   /** Write matrix to binary file.
    *

Modified: short/3D/PyLith/trunk/modulesrc/topology/Jacobian.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/Jacobian.i	2009-06-16 22:27:25 UTC (rev 15307)
+++ short/3D/PyLith/trunk/modulesrc/topology/Jacobian.i	2009-06-16 23:21:56 UTC (rev 15308)
@@ -64,7 +64,7 @@
       void zero(void);
       
       /// View matrix to stdout.
-      void view(void);
+      void view(void) const;
       
       /** Write matrix to binary file.
        *



More information about the CIG-COMMITS mailing list