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

brad at geodynamics.org brad at geodynamics.org
Mon Feb 1 21:04:04 PST 2010


Author: brad
Date: 2010-02-01 21:04:03 -0800 (Mon, 01 Feb 2010)
New Revision: 16209

Modified:
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.hh
   short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc
   short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.hh
   short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am
Log:
Worked on updating unit tests with StaticFriction.

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc	2010-02-02 02:40:38 UTC (rev 16208)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.cc	2010-02-02 05:04:03 UTC (rev 16209)
@@ -150,7 +150,8 @@
  _getInitialTractions();
 
  // Setup fault constitutive model.
- _initConstitutiveModel();
+  assert(0 != _friction);
+  _friction->initialize(*_faultMesh, _quadrature);
 
  // Create field for diagonal entries of Jacobian at conventional
  // vertices i and j associated with Lagrange vertex k
@@ -1738,13 +1739,6 @@
 } // _getInitialTractions
 
 // ----------------------------------------------------------------------
-void
-pylith::faults::FaultCohesiveDynL::_initConstitutiveModel(void)
-{ // _initConstitutiveModel
- // :TODO: ADD STUFF HERE
-} // _initConstitutiveModel
-
-// ----------------------------------------------------------------------
 // Update diagonal of Jacobian at conventional vertices i and j
 //  associated with Lagrange vertex k.
 void

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.hh	2010-02-02 02:40:38 UTC (rev 16208)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveDynL.hh	2010-02-02 05:04:03 UTC (rev 16209)
@@ -257,10 +257,6 @@
    */
   void _getInitialTractions(void);
 
-  /** Setup fault constitutive model.
-   */
-  void _initConstitutiveModel(void);
-
   /** Update diagonal of Jacobian at conventional vertices i and j
    *  associated with Lagrange vertex k.
    *

Modified: short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2010-02-02 02:40:38 UTC (rev 16208)
+++ short/3D/PyLith/trunk/libsrc/faults/FaultCohesiveKin.cc	2010-02-02 05:04:03 UTC (rev 16209)
@@ -94,7 +94,7 @@
   _faultMesh = new topology::SubMesh();
   CohesiveTopology::createFaultParallel(_faultMesh, &_cohesiveToFault, mesh, id(), useLagrangeConstraints());
 
-  //_initializeCohesiveInfo(mesh);
+  _initializeCohesiveInfo(mesh);
 
   delete _fields;
   _fields = new topology::Fields<topology::Field<topology::SubMesh> >(
@@ -1338,6 +1338,12 @@
         _cohesiveVertices[index].positive = v_positive;
         _cohesiveVertices[index].negative = v_negative;
         _cohesiveVertices[index].fault = v_fault;
+	std::cout << "cohesiveVertices[" << index << "]: "
+		  << "l: " << v_lagrange
+		  << ", p: " << v_positive
+		  << ", n: " << v_negative
+		  << ", f: " << v_fault
+		  << std::endl;
         indexMap[v_lagrange] = index; // add index to map
         ++index;
       } // if

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc	2010-02-02 02:40:38 UTC (rev 16208)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.cc	2010-02-02 05:04:03 UTC (rev 16209)
@@ -26,6 +26,7 @@
 #include "pylith/topology/SolutionFields.hh" // USES SolutionFields
 #include "pylith/topology/Jacobian.hh" // USES Jacobian
 #include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
+#include "pylith/friction/StaticFriction.hh" // USES StaticFriction
 
 #include "spatialdata/geocoords/CSCart.hh" // USES CSCart
 #include "spatialdata/spatialdb/SimpleDB.hh" // USES SimpleDB
@@ -50,7 +51,8 @@
   _quadrature = new feassemble::Quadrature<topology::SubMesh>();
   CPPUNIT_ASSERT(0 != _quadrature);
   _dbInitialTract = 0;
-
+  _friction = 0;
+  _dbFriction = 0;
   _flipFault = false;
 } // setUp
 
@@ -62,6 +64,8 @@
   delete _data; _data = 0;
   delete _quadrature; _quadrature = 0;
   delete _dbInitialTract; _dbInitialTract = 0;
+  delete _friction; _friction = 0;
+  delete _dbFriction; _dbFriction = 0;
 } // tearDown
 
 // ----------------------------------------------------------------------
@@ -678,6 +682,24 @@
   delete _dbInitialTract; _dbInitialTract = db;
   fault->dbInitialTract(db);
 
+  // Setup friction
+  spatialdata::spatialdb::SimpleDB* dbFriction =
+      new spatialdata::spatialdb::SimpleDB("static friction");
+  CPPUNIT_ASSERT(0 != dbFriction);
+  spatialdata::spatialdb::SimpleIOAscii ioFriction;
+  if (2 == _data->spaceDim)
+    ioFriction.filename("data/static_friction_2d.spatialdb");
+  else if (3 == _data->spaceDim)
+    ioFriction.filename("data/static_friction_3d.spatialdb");
+  dbFriction->ioHandler(&ioFriction);
+  delete _dbFriction; _dbFriction = dbFriction;
+  friction::StaticFriction* friction = new pylith::friction::StaticFriction();
+  CPPUNIT_ASSERT(0 != friction);
+  friction->label("static friction");
+  friction->dbProperties(dbFriction);
+  _friction = friction;
+  fault->frictionModel(friction);
+
   int firstFaultVertex    = 0;
   int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(_data->label)->size();
   int firstFaultCell      = mesh->sieveMesh()->getIntSection(_data->label)->size();
@@ -693,7 +715,7 @@
   const double upDir[] = { 0.0, 0.0, 1.0 };
   const double normalDir[] = { 1.0, 0.0, 0.0 };
   
-  fault->initialize(*mesh, upDir, normalDir); 
+  fault->initialize(*mesh, upDir, normalDir);
   
   // Setup fields
   fields->add("disp(t)", "displacement");

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.hh	2010-02-02 02:40:38 UTC (rev 16208)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/TestFaultCohesiveDynL.hh	2010-02-02 05:04:03 UTC (rev 16209)
@@ -26,6 +26,7 @@
 #include "pylith/faults/faultsfwd.hh" // forward declarations
 #include "pylith/topology/topologyfwd.hh" // USES Mesh, SubMesh
 #include "pylith/feassemble/feassemblefwd.hh" // HOLDSA Quadrature
+#include "pylith/friction/frictionfwd.hh" // HOLDSA FrictionModel
 #include "spatialdata/spatialdb/spatialdbfwd.hh" // HOLDSA SpatialDB
 #include <vector> // HASA std::vector
 /// Namespace for pylith package
@@ -62,6 +63,8 @@
   CohesiveDynLData* _data; ///< Data for testing
   feassemble::Quadrature<topology::SubMesh>* _quadrature; ///< Fault quad.
   spatialdata::spatialdb::SpatialDB* _dbInitialTract; ///< Initial tractions.
+  friction::FrictionModel* _friction; ///< Friction model
+  spatialdata::spatialdb::SpatialDB* _dbFriction; ///< Friction parameters.
   bool _flipFault; ///< If true, flip fault orientation.
 
   // PUBLIC METHODS /////////////////////////////////////////////////////

Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am	2010-02-02 02:40:38 UTC (rev 16208)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/Makefile.am	2010-02-02 05:04:03 UTC (rev 16209)
@@ -15,6 +15,8 @@
 	bulkprops_1d.spatialdb \
 	bulkprops_2d.spatialdb \
 	bulkprops_3d.spatialdb \
+	static_friction_2d.spatialdb \
+	static_friction_3d.spatialdb \
 	line2.mesh \
 	line2_finalslip.spatialdb \
 	line2_sliptime.spatialdb \



More information about the CIG-COMMITS mailing list