[cig-commits] r15133 - in short/3D/PyLith/trunk: libsrc/bc unittests/libtests/bc

brad at geodynamics.org brad at geodynamics.org
Sat Jun 6 21:04:26 PDT 2009


Author: brad
Date: 2009-06-06 21:04:26 -0700 (Sat, 06 Jun 2009)
New Revision: 15133

Modified:
   short/3D/PyLith/trunk/libsrc/bc/PointForce.hh
   short/3D/PyLith/trunk/libsrc/bc/PointForce.icc
   short/3D/PyLith/trunk/libsrc/bc/TimeDependent.cc
   short/3D/PyLith/trunk/libsrc/bc/TimeDependent.hh
   short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.cc
   short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.hh
   short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.icc
   short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc
   short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.hh
Log:
Cleaned up method names. Added another unit test.

Modified: short/3D/PyLith/trunk/libsrc/bc/PointForce.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/PointForce.hh	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/libsrc/bc/PointForce.hh	2009-06-07 04:04:26 UTC (rev 15133)
@@ -70,7 +70,7 @@
    *
    * @returns Nondimensionalizer.
    */
-  const spatialdata::units::Nondimensional& getNormalizer(void) const;
+  const spatialdata::units::Nondimensional& _getNormalizer(void) const;
 
   // NOT IMPLEMENTED ////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/libsrc/bc/PointForce.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/PointForce.icc	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/libsrc/bc/PointForce.icc	2009-06-07 04:04:26 UTC (rev 15133)
@@ -19,7 +19,7 @@
 // Get manager of scales used to nondimensionalize problem.
 inline
 const spatialdata::units::Nondimensional&
-pylith::bc::PointForce::getNormalizer(void) const {
+pylith::bc::PointForce::_getNormalizer(void) const {
   assert(0 != _normalizer);
   return *_normalizer;
 }

Modified: short/3D/PyLith/trunk/libsrc/bc/TimeDependent.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/TimeDependent.cc	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/libsrc/bc/TimeDependent.cc	2009-06-07 04:04:26 UTC (rev 15133)
@@ -68,14 +68,14 @@
 { // verifyConfiguration
   if (0 != _dbRate && 0 == _dbRateTime) {
     std::ostringstream msg;
-    msg << "Time dependent boundary condition '" << getLabel() << "',\n has a rate "
+    msg << "Time dependent boundary condition '" << _getLabel() << "',\n has a rate "
 	<< "of change spatial database but no rate of change start time "
 	<< "spatial database.";
     throw std::runtime_error(msg.str());
   } // if
   if (0 == _dbRate && 0 != _dbRateTime) {
     std::ostringstream msg;
-    msg << "Time dependent boundary condition '" << getLabel() << "',\n has a rate "
+    msg << "Time dependent boundary condition '" << _getLabel() << "',\n has a rate "
 	<< "of change start time spatial database but no rate of change "
 	<< "spatial database.";
     throw std::runtime_error(msg.str());
@@ -83,21 +83,21 @@
 
   if (0 != _dbChange && 0 == _dbChangeTime) {
     std::ostringstream msg;
-    msg << "Time dependent boundary condition '" << getLabel() << "',\n has a "
+    msg << "Time dependent boundary condition '" << _getLabel() << "',\n has a "
 	<< "change in value spatial database but change in value start time "
 	<< "spatial database.";
     throw std::runtime_error(msg.str());
   } // if
   if (0 == _dbChange && 0 != _dbChangeTime) {
     std::ostringstream msg;
-    msg << "Time dependent boundary condition '" << getLabel() << "',\n has a "
+    msg << "Time dependent boundary condition '" << _getLabel() << "',\n has a "
 	<< "change in value start time spatial database but change in value "
 	<< "spatial database.";
     throw std::runtime_error(msg.str());
   } // if
   if (0 == _dbChange && 0 != _dbTimeHistory) {
     std::ostringstream msg;
-    msg << "Time dependent boundary condition '" << getLabel() << "',\n has a "
+    msg << "Time dependent boundary condition '" << _getLabel() << "',\n has a "
 	<< "time history database but not change in value spatial database.";
     throw std::runtime_error(msg.str());
   } // if

Modified: short/3D/PyLith/trunk/libsrc/bc/TimeDependent.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/TimeDependent.hh	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/libsrc/bc/TimeDependent.hh	2009-06-07 04:04:26 UTC (rev 15133)
@@ -104,14 +104,14 @@
    * @returns Label of surface (from mesh generator).
    */
   virtual
-  const char* getLabel(void) const = 0;
+  const char* _getLabel(void) const = 0;
 
   /** Get manager of scales used to nondimensionalize problem.
    *
    * @returns Nondimensionalizer.
    */
   virtual
-  const spatialdata::units::Nondimensional& getNormalizer(void) const = 0;
+  const spatialdata::units::Nondimensional& _getNormalizer(void) const = 0;
 
   // PROTECTED MEMBERS //////////////////////////////////////////////////
 protected :

Modified: short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.cc	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.cc	2009-06-07 04:04:26 UTC (rev 15133)
@@ -50,7 +50,7 @@
 						 const double valueScale,
 						 const char* fieldName)
 { // _queryDatabases
-  const double timeScale = getNormalizer().timeScale();
+  const double timeScale = _getNormalizer().timeScale();
   const double rateScale = valueScale / timeScale;
 
   const int numPoints = _points.size();
@@ -198,7 +198,7 @@
   assert(0 != cs);
   const int spaceDim = cs->spaceDim();
 
-  const double lengthScale = getNormalizer().lengthScale();
+  const double lengthScale = _getNormalizer().lengthScale();
 
   double_array coordsVertex(spaceDim);
   const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
@@ -217,7 +217,7 @@
     // Get dimensionalized coordinates of vertex
     coordinates->restrictPoint(_points[iPoint], 
 			       &coordsVertex[0], coordsVertex.size());
-    getNormalizer().dimensionalize(&coordsVertex[0], coordsVertex.size(),
+    _getNormalizer().dimensionalize(&coordsVertex[0], coordsVertex.size(),
 				lengthScale);
     int err = db->query(&valuesVertex[0], valuesVertex.size(), 
 			&coordsVertex[0], coordsVertex.size(), cs);
@@ -229,7 +229,7 @@
       msg << ") using spatial database " << db->label() << ".";
       throw std::runtime_error(msg.str());
     } // if
-    getNormalizer().nondimensionalize(&valuesVertex[0], valuesVertex.size(),
+    _getNormalizer().nondimensionalize(&valuesVertex[0], valuesVertex.size(),
 				   scale);
     section->updatePoint(_points[iPoint], &valuesVertex[0]);
   } // for
@@ -249,7 +249,7 @@
 
   const int numPoints = _points.size();
   const int numBCDOF = _bcDOF.size();
-  const double timeScale = getNormalizer().timeScale();
+  const double timeScale = _getNormalizer().timeScale();
 
   const ALE::Obj<RealSection>& changeSection = (0 != _dbChange) ?
     _parameters->get("change").section() : 0;
@@ -314,7 +314,7 @@
 	double scale = 1.0;
 	if (0 != _dbTimeHistory) {
 	  double tDim = t - tChange;
-	  getNormalizer().dimensionalize(&tDim, 1, timeScale);
+	  _getNormalizer().dimensionalize(&tDim, 1, timeScale);
 	  const int err = _dbTimeHistory->query(&scale, tDim);
 	  if (0 != err) {
 	    std::ostringstream msg;

Modified: short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.hh	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.hh	2009-06-07 04:04:26 UTC (rev 15133)
@@ -47,7 +47,7 @@
    *
    * @returns Label of surface (from mesh generator).
    */
-  const char* getLabel(void) const;
+  const char* _getLabel(void) const;
 
   /** Query databases for time dependent parameters.
    *

Modified: short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.icc	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/libsrc/bc/TimeDependentPoints.icc	2009-06-07 04:04:26 UTC (rev 15133)
@@ -17,7 +17,7 @@
 // Get label of boundary condition surface.
 inline
 const char*
-pylith::bc::TimeDependentPoints::getLabel(void) const {
+pylith::bc::TimeDependentPoints::_getLabel(void) const {
   return label();
 }
 

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc	2009-06-07 04:04:26 UTC (rev 15133)
@@ -60,6 +60,21 @@
 } // testConstructor
 
 // ----------------------------------------------------------------------
+// Test constructor.
+void
+pylith::bc::TestPointForce::testNormalizer(void)
+{ // testNormalizer
+  PointForce bc;
+
+  spatialdata::units::Nondimensional normalizer;
+  const double scale = 4.0;
+  normalizer.lengthScale(4.0);
+
+  bc.normalizer(normalizer);
+  CPPUNIT_ASSERT_EQUAL(scale, bc._getNormalizer().lengthScale());
+} // testNormalizer
+
+// ----------------------------------------------------------------------
 // Test initialize().
 void
 pylith::bc::TestPointForce::testInitialize(void)

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.hh	2009-06-07 03:49:00 UTC (rev 15132)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.hh	2009-06-07 04:04:26 UTC (rev 15133)
@@ -42,6 +42,7 @@
   CPPUNIT_TEST_SUITE( TestPointForce );
 
   CPPUNIT_TEST( testConstructor );
+  CPPUNIT_TEST( testNormalizer );
 
   CPPUNIT_TEST_SUITE_END();
 
@@ -57,6 +58,9 @@
   /// Test constructor.
   void testConstructor(void);
 
+  /// Test normalizer().
+  void testNormalizer(void);
+
   /// Test initialize().
   void testInitialize(void);
 



More information about the CIG-COMMITS mailing list