[cig-commits] r20728 - in short/3D/PyLith/branches/v1.7-trunk: libsrc/pylith/feassemble modulesrc/feassemble pylith/feassemble

brad at geodynamics.org brad at geodynamics.org
Tue Sep 18 17:17:12 PDT 2012


Author: brad
Date: 2012-09-18 17:17:12 -0700 (Tue, 18 Sep 2012)
New Revision: 20728

Modified:
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.hh
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.hh
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.hh
   short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTet4.i
   short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTri3.i
   short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/IntegratorElasticity.i
   short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicit.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitLgDeform.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTet4.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTri3.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicit.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicitLgDeform.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/IntegratorElasticity.py
Log:
Enabled missing invocation of IntegratorElasticity::verifyConfiguration().

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.cc	2012-09-19 00:17:12 UTC (rev 20728)
@@ -1027,6 +1027,26 @@
 } // integrateJacobian
 
 // ----------------------------------------------------------------------
+// Verify configuration is acceptable.
+void
+pylith::feassemble::ElasticityExplicitTet4::verifyConfiguration(const topology::Mesh& mesh) const
+{ // verifyConfiguration
+  IntegratorElasticity::verifyConfiguration(mesh);
+
+  assert(_quadrature);
+  assert(_material);
+  if (_spaceDim != _quadrature->spaceDim() || _cellDim != _quadrature->cellDim() || _numBasis != _quadrature->numBasis() ||  _numQuadPts != _quadrature->numQuadPts()) {
+    std::ostringstream msg;
+    msg << "User specified quadrature settings material '" << _material->label() << "' do not match ElasticityExplicitTet4 hardwired quadrature settings.\n"
+	<< "  Space dim: " << _spaceDim << " (code), " << _quadrature->spaceDim() << " (user)\n"
+	<< "  Cell dim: " << _cellDim << " (code), " << _quadrature->cellDim() << " (user)\n"
+	<< "  # basis fns: " << _numBasis << " (code), " << _quadrature->numBasis() << " (user)\n"
+	<< "  # quad points: " << _numQuadPts << " (code), " << _quadrature->numQuadPts() << " (user)";
+    throw std::runtime_error(msg.str());
+  } // if
+} // verifyConfiguration
+
+// ----------------------------------------------------------------------
 // Compute volume of tetrahedral cell.
 PylithScalar
 pylith::feassemble::ElasticityExplicitTet4::_volume(const scalar_array& coordinatesCell) const

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.hh	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTet4.hh	2012-09-19 00:17:12 UTC (rev 20728)
@@ -147,6 +147,12 @@
 			 const PylithScalar t,
 			 topology::SolutionFields* const fields);
 
+  /** Verify configuration is acceptable.
+   *
+   * @param mesh Finite-element mesh
+   */
+  void verifyConfiguration(const topology::Mesh& mesh) const;
+
 // PRIVATE METHODS //////////////////////////////////////////////////////
 private :
 

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.cc	2012-09-19 00:17:12 UTC (rev 20728)
@@ -938,6 +938,26 @@
 } // integrateJacobian
 
 // ----------------------------------------------------------------------
+// Verify configuration is acceptable.
+void
+pylith::feassemble::ElasticityExplicitTri3::verifyConfiguration(const topology::Mesh& mesh) const
+{ // verifyConfiguration
+  IntegratorElasticity::verifyConfiguration(mesh);
+
+  assert(_quadrature);
+  assert(_material);
+  if (_spaceDim != _quadrature->spaceDim() || _cellDim != _quadrature->cellDim() || _numBasis != _quadrature->numBasis() ||  _numQuadPts != _quadrature->numQuadPts()) {
+    std::ostringstream msg;
+    msg << "User specified quadrature settings material '" << _material->label() << "' do not match ElasticityExplicitTri3 hardwired quadrature settings.\n"
+	<< "  Space dim: " << _spaceDim << " (code), " << _quadrature->spaceDim() << " (user)\n"
+	<< "  Cell dim: " << _cellDim << " (code), " << _quadrature->cellDim() << " (user)\n"
+	<< "  # basis fns: " << _numBasis << " (code), " << _quadrature->numBasis() << " (user)\n"
+	<< "  # quad points: " << _numQuadPts << " (code), " << _quadrature->numQuadPts() << " (user)";
+    throw std::runtime_error(msg.str());
+  } // if
+} // verifyConfiguration
+
+// ----------------------------------------------------------------------
 // Compute area of triangular cell.
 PylithScalar
 pylith::feassemble::ElasticityExplicitTri3::_area(

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.hh	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/ElasticityExplicitTri3.hh	2012-09-19 00:17:12 UTC (rev 20728)
@@ -147,6 +147,12 @@
 			 const PylithScalar t,
 			 topology::SolutionFields* const fields);
 
+  /** Verify configuration is acceptable.
+   *
+   * @param mesh Finite-element mesh
+   */
+  void verifyConfiguration(const topology::Mesh& mesh) const;
+
 // PRIVATE METHODS //////////////////////////////////////////////////////
 private :
 

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.cc	2012-09-19 00:17:12 UTC (rev 20728)
@@ -245,8 +245,8 @@
 pylith::feassemble::IntegratorElasticity::verifyConfiguration(
 					   const topology::Mesh& mesh) const
 { // verifyConfiguration
-  assert(0 != _quadrature);
-  assert(0 != _material);
+  assert(_quadrature);
+  assert(_material);
 
   const int dimension = mesh.dimension();
 

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.hh	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/feassemble/IntegratorElasticity.hh	2012-09-19 00:17:12 UTC (rev 20728)
@@ -101,6 +101,7 @@
    *
    * @param mesh Finite-element mesh
    */
+  virtual
   void verifyConfiguration(const topology::Mesh& mesh) const;
 
   /** Get output fields.

Modified: short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTet4.i
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTet4.i	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTet4.i	2012-09-19 00:17:12 UTC (rev 20728)
@@ -103,6 +103,12 @@
 			     const PylithScalar t,
 			     pylith::topology::SolutionFields* const fields);
 
+      /** Verify configuration is acceptable.
+       *
+       * @param mesh Finite-element mesh
+       */
+      void verifyConfiguration(const pylith::topology::Mesh& mesh) const;
+      
     }; // ElasticityExplicitTet4
 
   } // feassemble

Modified: short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTri3.i
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTri3.i	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/ElasticityExplicitTri3.i	2012-09-19 00:17:12 UTC (rev 20728)
@@ -103,6 +103,12 @@
 			     const PylithScalar t,
 			     pylith::topology::SolutionFields* const fields);
 
+      /** Verify configuration is acceptable.
+       *
+       * @param mesh Finite-element mesh
+       */
+      void verifyConfiguration(const pylith::topology::Mesh& mesh) const;
+      
     }; // ElasticityExplicitTri3
 
   } // feassemble

Modified: short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/IntegratorElasticity.i
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/IntegratorElasticity.i	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/modulesrc/feassemble/IntegratorElasticity.i	2012-09-19 00:17:12 UTC (rev 20728)
@@ -75,6 +75,7 @@
        *
        * @param mesh Finite-element mesh
        */
+      virtual
       void verifyConfiguration(const pylith::topology::Mesh& mesh) const;
       
       /** Get cell field associated with integrator.

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicit.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicit.py	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicit.py	2012-09-19 00:17:12 UTC (rev 20728)
@@ -60,6 +60,13 @@
     return
 
 
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _verifyConfiguration(self):
+    ModuleElasticityExplicit.verifyConfiguration(self, self.mesh)
+    return
+
+
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def integrator():

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitLgDeform.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitLgDeform.py	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitLgDeform.py	2012-09-19 00:17:12 UTC (rev 20728)
@@ -63,6 +63,13 @@
     return
 
 
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _verifyConfiguration(self):
+    ModuleElasticityExplicitLgDeform.verifyConfiguration(self, self.mesh)
+    return
+
+
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def integrator():

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTet4.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTet4.py	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTet4.py	2012-09-19 00:17:12 UTC (rev 20728)
@@ -60,6 +60,13 @@
     return
 
 
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _verifyConfiguration(self):
+    ModuleElasticityExplicitTet4.verifyConfiguration(self, self.mesh)
+    return
+
+
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def integrator():

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTri3.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTri3.py	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityExplicitTri3.py	2012-09-19 00:17:12 UTC (rev 20728)
@@ -60,6 +60,13 @@
     return
 
 
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _verifyConfiguration(self):
+    ModuleElasticityExplicitTri3.verifyConfiguration(self, self.mesh)
+    return
+
+
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def integrator():

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicit.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicit.py	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicit.py	2012-09-19 00:17:12 UTC (rev 20728)
@@ -60,6 +60,13 @@
     return
 
 
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _verifyConfiguration(self):
+    ModuleElasticityImplicit.verifyConfiguration(self, self.mesh)
+    return
+
+
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def integrator():

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicitLgDeform.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicitLgDeform.py	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/ElasticityImplicitLgDeform.py	2012-09-19 00:17:12 UTC (rev 20728)
@@ -62,6 +62,13 @@
     return
 
 
+  # PRIVATE METHODS ////////////////////////////////////////////////////
+
+  def _verifyConfiguration(self):
+    ModuleElasticityImplicitLgDeform.verifyConfiguration(self, self.mesh)
+    return
+
+
 # FACTORIES ////////////////////////////////////////////////////////////
 
 def integrator():

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/IntegratorElasticity.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/IntegratorElasticity.py	2012-09-19 00:15:44 UTC (rev 20727)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/feassemble/IntegratorElasticity.py	2012-09-19 00:17:12 UTC (rev 20728)
@@ -85,7 +85,7 @@
                         self.materialObj.label(),
                         self.materialObj,
                         self.materialObj.dimension()))
-    
+    self._verifyConfiguration()
     self.output.verifyConfiguration(self.mesh)
 
     self._eventLogger.eventEnd(logEvent)    
@@ -170,6 +170,10 @@
     return
 
 
+  def _verifyConfiguration(self):
+    raise NotImplementedError("Implement _verifyConfiguration() in child class.")
+
+
   def _modelMemoryUse(self):
     """
     Model memory allocation.



More information about the CIG-COMMITS mailing list