[cig-commits] r16439 - in short/3D/PyLith/trunk: libsrc/friction unittests/libtests/friction unittests/libtests/friction/data

surendra at geodynamics.org surendra at geodynamics.org
Tue Mar 23 12:50:00 PDT 2010


Author: surendra
Date: 2010-03-23 12:49:59 -0700 (Tue, 23 Mar 2010)
New Revision: 16439

Modified:
   short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.cc
   short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.hh
   short/3D/PyLith/trunk/libsrc/friction/StaticFriction.cc
   short/3D/PyLith/trunk/libsrc/friction/StaticFriction.hh
   short/3D/PyLith/trunk/unittests/libtests/friction/TestFrictionModel.cc
   short/3D/PyLith/trunk/unittests/libtests/friction/data/RateStateAgeingData.cc
   short/3D/PyLith/trunk/unittests/libtests/friction/data/StaticFrictionData.cc
   short/3D/PyLith/trunk/unittests/libtests/friction/data/friction_static.spatialdb
Log:
Added cohesion to StaticFriction and RateSTateAgeing.  Also, updated corresponding unit tests

Modified: short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.cc	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.cc	2010-03-23 19:49:59 UTC (rev 16439)
@@ -33,7 +33,7 @@
     namespace _RateStateAgeing {
 
       // Number of physical properties.
-      const int numProperties = 5;
+      const int numProperties = 6;
 
       // Physical properties.
       const pylith::materials::Metadata::ParamDescription properties[] = {
@@ -42,6 +42,7 @@
         { "characteristic_slip_distance", 1, pylith::topology::FieldBase::SCALAR },
         { "constitutive_parameter_a", 1, pylith::topology::FieldBase::SCALAR },
         { "constitutive_parameter_b", 1, pylith::topology::FieldBase::SCALAR },
+	{ "cohesion", 1, pylith::topology::FieldBase::SCALAR },
       };
 
       // Number of State Variables.
@@ -53,13 +54,14 @@
       };
 
       // Values expected in spatial database
-      const int numDBProperties = 5;
+      const int numDBProperties = 6;
       const char* dbProperties[] = {
           "reference-friction-coefficient"
           "reference-slip-rate"
           "characteristic-slip-distance"
           "constitutive-parameter-a"
           "constitutive-parameter-b"
+	  "cohesion"
       };
 
       const int numDBStateVars = 1;
@@ -81,6 +83,8 @@
   pylith::friction::RateStateAgeing::p_L + 1;
 const int pylith::friction::RateStateAgeing::p_b = 
   pylith::friction::RateStateAgeing::p_a + 1;
+const int pylith::friction::RateStateAgeing::p_cohesion =
+  pylith::friction::RateStateAgeing::p_b + 1;
 
 // Indices of database values (order must match dbProperties)
 const int pylith::friction::RateStateAgeing::db_coef = 0;
@@ -92,6 +96,8 @@
   pylith::friction::RateStateAgeing::db_L + 1;
 const int pylith::friction::RateStateAgeing::db_b = 
   pylith::friction::RateStateAgeing::db_a + 1;
+const int pylith::friction::RateStateAgeing::db_cohesion =
+  pylith::friction::RateStateAgeing::db_b + 1;
 
 // Indices of state variables.
 const int pylith::friction::RateStateAgeing::s_state = 0;
@@ -135,6 +141,7 @@
   const double dc = dbValues[db_L];
   const double a = dbValues[db_a];
   const double b = dbValues[db_b];
+  const double cohesion = dbValues[db_cohesion];
  
   if (frictionCoef <= 0.0) {
     std::ostringstream msg;
@@ -173,6 +180,7 @@
   propValues[p_L] = dc;
   propValues[p_a] = a;
   propValues[p_b] = b;
+  propValues[p_cohesion] = cohesion;
 
 } // _dbToProperties
 
@@ -188,9 +196,11 @@
 
   const double lengthScale = _normalizer->lengthScale();
   const double timeScale = _normalizer->timeScale();
+  const double pressureScale = _normalizer->pressureScale();
 
   values[p_slipRate0] /= lengthScale / timeScale;
   values[p_L] /= lengthScale;
+  values[p_cohesion] /= pressureScale;
 } // _nondimProperties
 
 // ----------------------------------------------------------------------
@@ -205,9 +215,11 @@
 
   const double lengthScale = _normalizer->lengthScale();
   const double timeScale = _normalizer->timeScale();
+  const double pressureScale = _normalizer->pressureScale();
 
   values[p_slipRate0] *= lengthScale / timeScale;
   values[p_L] *= lengthScale;
+  values[p_cohesion] *= pressureScale;
 } // _dimProperties
 
 // ----------------------------------------------------------------------
@@ -290,10 +302,10 @@
     const double sinhArg = 0.5 * slipRate / slipRate0 * expTerm;
 
     mu_f = a * asinh(sinhArg);
-    friction = -mu_f * normalTraction;
+    friction = -mu_f * normalTraction + properties[p_cohesion];
   } // if
 
-  PetscLogFlops(10);
+  PetscLogFlops(11);
 
   return friction;
 } // _calcFriction

Modified: short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.hh	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/libsrc/friction/RateStateAgeing.hh	2010-03-23 19:49:59 UTC (rev 16439)
@@ -155,12 +155,14 @@
   static const int p_L;
   static const int p_a;
   static const int p_b;
+  static const int p_cohesion;
 
   static const int db_coef;
   static const int db_slipRate0;
   static const int db_L;
   static const int db_a;
   static const int db_b;
+  static const int db_cohesion;
 
   /// Indices for state variables in section and spatial database.
   static const int s_state;

Modified: short/3D/PyLith/trunk/libsrc/friction/StaticFriction.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/friction/StaticFriction.cc	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/libsrc/friction/StaticFriction.cc	2010-03-23 19:49:59 UTC (rev 16439)
@@ -33,16 +33,19 @@
     namespace _StaticFriction {
 
       // Number of physical properties.
-      const int numProperties = 1;
+      const int numProperties = 2;
 
       // Physical properties.
       const pylith::materials::Metadata::ParamDescription properties[] = {
 	{ "friction_coefficient", 1, pylith::topology::FieldBase::SCALAR },
+	{ "cohesion", 1, pylith::topology::FieldBase::SCALAR },
       };
 
       // Values expected in spatial database
-      const int numDBProperties = 1;
-      const char* dbProperties[] = { "friction-coefficient" };      
+      const int numDBProperties = 2;
+      const char* dbProperties[] = { "friction-coefficient", 
+				     "cohesion"
+};      
       
     } // _StaticFriction
   } // friction
@@ -50,9 +53,13 @@
 
 // Indices of physical properties
 const int pylith::friction::StaticFriction::p_coef = 0;
+const int pylith::friction::StaticFriction::p_cohesion =
+  pylith::friction::StaticFriction::p_coef + 1;
 
 // Indices of database values (order must match dbProperties)
 const int pylith::friction::StaticFriction::db_coef = 0;
+const int pylith::friction::StaticFriction::db_cohesion =
+  pylith::friction::StaticFriction::db_coef + 1;
 
 // ----------------------------------------------------------------------
 // Default constructor.
@@ -84,6 +91,7 @@
   assert(_StaticFriction::numDBProperties == numDBValues);
 
   const double coef = dbValues[db_coef];
+  const double cohesion = dbValues[db_cohesion];
  
   if (coef <= 0.0) {
     std::ostringstream msg;
@@ -94,6 +102,7 @@
   } // if
 
   propValues[p_coef] = coef;
+  propValues[p_cohesion] = cohesion;
 } // _dbToProperties
 
 // ----------------------------------------------------------------------
@@ -106,7 +115,9 @@
   assert(0 != values);
   assert(nvalues == _StaticFriction::numProperties);
 
-  // No dimensions
+  const double pressureScale = _normalizer->pressureScale();
+
+  values[p_cohesion] /= pressureScale;
 } // _nondimProperties
 
 // ----------------------------------------------------------------------
@@ -119,7 +130,9 @@
   assert(0 != values);
   assert(nvalues == _StaticFriction::numProperties);
 
-  // No dimensions
+  const double pressureScale = _normalizer->pressureScale();
+
+  values[p_cohesion] *= pressureScale;
 } // _dimProperties
 
 // ----------------------------------------------------------------------
@@ -138,9 +151,10 @@
   assert(0 == numStateVars);
 
   const double friction = (normalTraction < 0.0) ?
-    -properties[p_coef] * normalTraction : 0.0;
+    -properties[p_coef] * normalTraction + properties[p_cohesion]: 
+    0.0;
 
-  PetscLogFlops(1);
+  PetscLogFlops(2);
 
   return friction;
 } // _calcFriction

Modified: short/3D/PyLith/trunk/libsrc/friction/StaticFriction.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/friction/StaticFriction.hh	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/libsrc/friction/StaticFriction.hh	2010-03-23 19:49:59 UTC (rev 16439)
@@ -92,7 +92,10 @@
 private :
 
   static const int p_coef;
+  static const int p_cohesion;
+
   static const int db_coef;
+  static const int db_cohesion;
 
   // NOT IMPLEMENTED ////////////////////////////////////////////////////
 private :

Modified: short/3D/PyLith/trunk/unittests/libtests/friction/TestFrictionModel.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/friction/TestFrictionModel.cc	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/unittests/libtests/friction/TestFrictionModel.cc	2010-03-23 19:49:59 UTC (rev 16439)
@@ -123,8 +123,8 @@
 void
 pylith::friction::TestFrictionModel::testInitialize(void)
 { // testInitialize
-  const double propertiesE[] = { 0.55, 0.45 };
-  const int numProperties = 1;
+  const double propertiesE[] = { 0.55, 1000000, 0.45, 1000000 };
+  const int numProperties = 2;
 
   topology::Mesh mesh;
   faults::FaultCohesiveDyn fault;
@@ -222,8 +222,8 @@
 void
 pylith::friction::TestFrictionModel::testRetrievePropsAndVars(void)
 { // testRetrievePropsAndVars
-  const double propertiesE[] = { 0.45 };
-  const int numProperties = 1;
+  const double propertiesE[] = { 0.45, 1000000 };
+  const int numProperties = 2;
   const double* stateVarsE = 0;
   const int numStateVars = 0;
   const int vertex = 2;
@@ -273,7 +273,8 @@
   const double slipRate = -2.3;
   const double normalTraction = -2.4;
   const double frictionCoef = 0.45;
-  const double frictionE = -normalTraction*frictionCoef;
+  const double cohesion = 1000000;
+  const double frictionE = -normalTraction*frictionCoef + cohesion;
   const int vertex = 2;
 
   topology::Mesh mesh;
@@ -308,6 +309,7 @@
     const double slip = 1.2;
     const double slipRate = -2.3;
     const double normalTraction = -2.4;
+    const double cohesion = 1000000;
     const int vertex = 2;
     
     friction.timeStep(data.dt);
@@ -323,10 +325,11 @@
     const double slip = 0.25;
     const double slipRate = 0.64;
     const double normalTraction = -2.3;
+    const double cohesion = 1000000;
     const double dt = 0.01;
 
-    const size_t numProperties = 3;
-    const double properties[3] = { 0.6, 0.5, 0.004 };
+    const size_t numProperties = 4;
+    const double properties[4] = { 0.6, 0.5, 0.004, 1000000 };
     const size_t numStateVars = 2;
     const double stateVars[2] = { 0.5, 0.1 };
     const double stateVarsUpdated[2] = { 0.65, 0.5 };

Modified: short/3D/PyLith/trunk/unittests/libtests/friction/data/RateStateAgeingData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/friction/data/RateStateAgeingData.cc	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/unittests/libtests/friction/data/RateStateAgeingData.cc	2010-03-23 19:49:59 UTC (rev 16439)
@@ -14,15 +14,15 @@
 
 const int pylith::friction::RateStateAgeingData::_numLocs = 2;
 
-const int pylith::friction::RateStateAgeingData::_numProperties = 5;
+const int pylith::friction::RateStateAgeingData::_numProperties = 6;
 
 const int pylith::friction::RateStateAgeingData::_numStateVars = 1;
 
-const int pylith::friction::RateStateAgeingData::_numDBProperties = 5;
+const int pylith::friction::RateStateAgeingData::_numDBProperties = 6;
 
 const int pylith::friction::RateStateAgeingData::_numDBStateVars = 1;
 
-const int pylith::friction::RateStateAgeingData::_numPropsVertex = 5;
+const int pylith::friction::RateStateAgeingData::_numPropsVertex = 6;
 
 const int pylith::friction::RateStateAgeingData::_numVarsVertex = 1;
 
@@ -42,6 +42,7 @@
   1,
   1,
   1,
+  1,
 };
 
 const int pylith::friction::RateStateAgeingData::_numStateVarValues[] = {
@@ -54,6 +55,7 @@
   "characteristic-slip-distance",
   "constitutive-parameter-a",
   "constitutive-parameter-b",
+  "cohesion",
 };
 
 const char* pylith::friction::RateStateAgeingData::_dbStateVarValues[] = {
@@ -66,11 +68,13 @@
   0.0370,
   0.0125,
   0.0172,
+  1000000,
   0.5,
   0.000002,
   0.0470,
   0.0225,
   0.0272,
+  1000000,
 };
 
 const double pylith::friction::RateStateAgeingData::_dbStateVars[] = {
@@ -84,11 +88,13 @@
   0.0370,
   0.0125,
   0.0172,
+  1000000,
   0.5,
   0.000002,
   0.0470,
   0.0225,
   0.0272,
+  1000000,
 };
 
 const double pylith::friction::RateStateAgeingData::_stateVars[] = {
@@ -102,11 +108,13 @@
   0.0000370,
   0.0125,
   0.0172,
+  0.000044444444,
   0.5,
   0.000000002,
   0.0000470,
   0.0225,
   0.0272,
+  0.000044444444,
 };
 
 const double pylith::friction::RateStateAgeingData::_stateVarsNondim[] = {
@@ -115,8 +123,8 @@
 };
 
 const double pylith::friction::RateStateAgeingData::_friction[] = {
-  1.285949009547604,
-  1.164378652801948,
+  1000001.285949009547604,
+  1000001.164378652801948,
 };
 
 const double pylith::friction::RateStateAgeingData::_slip[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/friction/data/StaticFrictionData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/friction/data/StaticFrictionData.cc	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/unittests/libtests/friction/data/StaticFrictionData.cc	2010-03-23 19:49:59 UTC (rev 16439)
@@ -14,15 +14,15 @@
 
 const int pylith::friction::StaticFrictionData::_numLocs = 2;
 
-const int pylith::friction::StaticFrictionData::_numProperties = 1;
+const int pylith::friction::StaticFrictionData::_numProperties = 2;
 
 const int pylith::friction::StaticFrictionData::_numStateVars = 0;
 
-const int pylith::friction::StaticFrictionData::_numDBProperties = 1;
+const int pylith::friction::StaticFrictionData::_numDBProperties = 2;
 
 const int pylith::friction::StaticFrictionData::_numDBStateVars = 0;
 
-const int pylith::friction::StaticFrictionData::_numPropsVertex = 1;
+const int pylith::friction::StaticFrictionData::_numPropsVertex = 2;
 
 const int pylith::friction::StaticFrictionData::_numVarsVertex = 0;
 
@@ -38,40 +38,48 @@
 
 const int pylith::friction::StaticFrictionData::_numPropertyValues[] = {
 1,
+1,
 };
 
 const int* pylith::friction::StaticFrictionData::_numStateVarValues = 0;
 
 const char* pylith::friction::StaticFrictionData::_dbPropertyValues[] = {
 "friction-coefficient",
+"cohesion",
 };
 
 const char** pylith::friction::StaticFrictionData::_dbStateVarValues = 0;
 
 const double pylith::friction::StaticFrictionData::_dbProperties[] = {
   0.6,
+  1000000,
   0.6,
+  1000000,
 };
 
 const double* pylith::friction::StaticFrictionData::_dbStateVars = 0;
 
 const double pylith::friction::StaticFrictionData::_properties[] = {
   0.6,
+  1000000,
   0.6,
+  1000000,
 };
 
 const double* pylith::friction::StaticFrictionData::_stateVars = 0;
 
 const double pylith::friction::StaticFrictionData::_propertiesNondim[] = {
    0.6,
+   0.000044444444,
    0.6,
+   0.000044444444,
 };
 
 const double* pylith::friction::StaticFrictionData::_stateVarsNondim = 0;
 
 const double pylith::friction::StaticFrictionData::_friction[] = {
-  1.32,
-   0.0,
+  1000001.32,
+  0.0,
 };
 
 const double pylith::friction::StaticFrictionData::_slip[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/friction/data/friction_static.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/friction/data/friction_static.spatialdb	2010-03-23 04:02:54 UTC (rev 16438)
+++ short/3D/PyLith/trunk/unittests/libtests/friction/data/friction_static.spatialdb	2010-03-23 19:49:59 UTC (rev 16439)
@@ -1,8 +1,8 @@
 #SPATIAL.ascii 1
 SimpleDB {
-  num-values = 1
-  value-names =  friction-coefficient
-  value-units =  none
+  num-values = 2
+  value-names = friction-coefficient cohesion
+  value-units =  none Pa
   num-locs = 2
   data-dim = 1
   space-dim = 2
@@ -11,5 +11,5 @@
     space-dim = 2
   }
 }
-0.0   1.0   0.6
-0.0  -1.0   0.4
+0.0   1.0   0.6 1000000
+0.0  -1.0   0.4 1000000



More information about the CIG-COMMITS mailing list