[cig-commits] r7277 - in short/3D/PyLith/trunk: . libsrc/bc tests/3d/hex8 tests/3d/tet4 unittests/libtests/bc/data

brad at geodynamics.org brad at geodynamics.org
Sun Jun 17 13:53:01 PDT 2007


Author: brad
Date: 2007-06-17 13:53:00 -0700 (Sun, 17 Jun 2007)
New Revision: 7277

Modified:
   short/3D/PyLith/trunk/TODO
   short/3D/PyLith/trunk/libsrc/bc/Dirichlet.cc
   short/3D/PyLith/trunk/tests/3d/hex8/Makefile.am
   short/3D/PyLith/trunk/tests/3d/hex8/testpylith.py
   short/3D/PyLith/trunk/tests/3d/tet4/shearelasticisotropic.cfg
   short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataMultiTri3.cc
   short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataQuad4.cc
Log:
Fixed setting contrained DOF when multiple Dirichlet BC set constrained DOF. Need to have DOF sorted (constraint imposed by Sieve). Update unit tests to account for DOF being sorted.

Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO	2007-06-17 03:32:28 UTC (rev 7276)
+++ short/3D/PyLith/trunk/TODO	2007-06-17 20:53:00 UTC (rev 7277)
@@ -25,6 +25,9 @@
 MAIN PRIORITIES (Brad)
 ======================================================================
 
+add flipping of fault orientation (in case we get opposite of what we want)
+  add unit test
+
 1. Additional unit tests
 
   Unit tests with multiple cohesive cells.
@@ -36,6 +39,16 @@
     i. multiple materials
     ii. partially constrained DOF
 
+Add diagnostic output
+  cells
+    processor
+    material id
+  fault (kin)
+    orientation (3 vectors)
+    slip (vector)
+    peak rate (scalar)
+    slip time (scalar)
+
 ======================================================================
 SECONDARY PRIORITIES
 ======================================================================

Modified: short/3D/PyLith/trunk/libsrc/bc/Dirichlet.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/bc/Dirichlet.cc	2007-06-17 03:32:28 UTC (rev 7276)
+++ short/3D/PyLith/trunk/libsrc/bc/Dirichlet.cc	2007-06-17 20:53:00 UTC (rev 7277)
@@ -153,11 +153,28 @@
   const int numPoints = _points.size();
   for (int iPoint=0; iPoint < numPoints; ++iPoint) {
     const Mesh::point_type point = _points[iPoint];
+
+    // Get list of currently constrained DOF
     const int* curFixedDOF = field->getConstraintDof(point);
     const int numTotalConstrained = field->getConstraintDimension(point);
+
+    // Create array holding all constrained DOF
     int_array allFixedDOF(curFixedDOF, numTotalConstrained);
+
+    // Add in the ones for this Dirichlet BC
     for (int iDOF=0; iDOF < numFixedDOF; ++iDOF)
       allFixedDOF[_offsetLocal[iPoint]+iDOF] = _fixedDOF[iDOF];
+
+    // Fill in rest of values not yet set (will be set by another Dirichlet BC)
+    for (int iDOF=_offsetLocal[iPoint]+numFixedDOF; 
+	 iDOF < numTotalConstrained; 
+	 ++iDOF)
+      allFixedDOF[_offsetLocal[iPoint]+iDOF] = 999;
+
+    // Sort list of constrained DOF
+    std::sort(&allFixedDOF[0], &allFixedDOF[numTotalConstrained]);
+
+    // Update list of constrained DOF
     field->setConstraintDof(point, &allFixedDOF[0]);
   } // for
 } // setConstraints

Modified: short/3D/PyLith/trunk/tests/3d/hex8/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/tests/3d/hex8/Makefile.am	2007-06-17 03:32:28 UTC (rev 7276)
+++ short/3D/PyLith/trunk/tests/3d/hex8/Makefile.am	2007-06-17 20:53:00 UTC (rev 7277)
@@ -27,6 +27,7 @@
 	axialy.spatialdb \
 	axialz.spatialdb \
 	shearelasticisotropic.cfg \
+	shearplanestrain.cfg \
 	shearmaxwellisotropic.cfg \
 	shearxyz.spatialdb \
 	twocells.mesh \
@@ -49,6 +50,8 @@
 	axialmaxwellisotropic_t1.vtk \
 	shearelasticisotropic_t0.vtk \
 	shearelasticisotropic_t1.vtk \
+	shearplanestrain_t0.vtk \
+	shearplanestrain_t1.vtk \
 	shearmaxwellisotropic_t0.vtk \
 	shearmaxwellisotropic_t1.vtk
 

Modified: short/3D/PyLith/trunk/tests/3d/hex8/testpylith.py
===================================================================
--- short/3D/PyLith/trunk/tests/3d/hex8/testpylith.py	2007-06-17 03:32:28 UTC (rev 7276)
+++ short/3D/PyLith/trunk/tests/3d/hex8/testpylith.py	2007-06-17 20:53:00 UTC (rev 7277)
@@ -26,6 +26,9 @@
   from TestShearElasticIsotropic import TestShearElasticIsotropic
   suite.addTest(unittest.makeSuite(TestShearElasticIsotropic))
 
+  from TestShearPlaneStrain import TestShearPlaneStrain
+  suite.addTest(unittest.makeSuite(TestShearPlaneStrain))
+
   return suite
 
 

Modified: short/3D/PyLith/trunk/tests/3d/tet4/shearelasticisotropic.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/3d/tet4/shearelasticisotropic.cfg	2007-06-17 03:32:28 UTC (rev 7276)
+++ short/3D/PyLith/trunk/tests/3d/tet4/shearelasticisotropic.cfg	2007-06-17 20:53:00 UTC (rev 7277)
@@ -54,56 +54,20 @@
 # boundary conditions
 # ----------------------------------------------------------------------
 
-# ***********************
-# THESE WORK
-# ***********************
-#[pylithapp.timedependent.bc.x_neg]
-#fixed_dof = [0, 1, 2]
-#id = 3
-#label = 3
-#db.label = Dirichlet BC -x edge
-#db.iohandler.filename = shearxyz.spatialdb
-
-#[pylithapp.timedependent.bc.x_pos]
-#fixed_dof = [0, 1, 2]
-#id = 4
-#label = 4
-#db.label = Dirichlet BC +x edge
-#db.iohandler.filename = shearxyz.spatialdb
-
-# ***********************
-# THESE DO NOT
-# [0]PETSC ERROR: Nonconforming object sizes!
-# [0]PETSC ERROR: Invalid number of local indices 346, should be 326!
-# ***********************
 [pylithapp.timedependent.bc.x_neg]
-fixed_dof = [1, 2]
+fixed_dof = [0, 1, 2]
 id = 3
 label = 3
 db.label = Dirichlet BC -x edge
 db.iohandler.filename = shearxyz.spatialdb
 
 [pylithapp.timedependent.bc.x_pos]
-fixed_dof = [1, 2]
+fixed_dof = [0, 1, 2]
 id = 4
 label = 4
 db.label = Dirichlet BC +x edge
 db.iohandler.filename = shearxyz.spatialdb
 
-[pylithapp.timedependent.bc.y_neg]
-fixed_dof = [0]
-id = 5
-label = 5
-db.label = Dirichlet BC -y edge
-db.iohandler.filename = shearxyz.spatialdb
-
-[pylithapp.timedependent.bc.y_pos]
-fixed_dof = [0]
-id = 6
-label = 6
-db.label = Dirichlet BC +y edge
-db.iohandler.filename = shearxyz.spatialdb
-
 # ----------------------------------------------------------------------
 # PETSc
 # ----------------------------------------------------------------------

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataMultiTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataMultiTri3.cc	2007-06-17 03:32:28 UTC (rev 7276)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataMultiTri3.cc	2007-06-17 20:53:00 UTC (rev 7277)
@@ -63,7 +63,7 @@
 const int pylith::bc::DirichletDataMultiTri3::_constrainedDOF[] = {
   0, 
   1,
-  1, 0
+  0, 1
 };
 
 const double pylith::bc::DirichletDataMultiTri3::_field[] = {

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataQuad4.cc	2007-06-17 03:32:28 UTC (rev 7276)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletDataQuad4.cc	2007-06-17 20:53:00 UTC (rev 7277)
@@ -30,12 +30,12 @@
 
 const int pylith::bc::DirichletDataQuad4::_numDOF = 2;
 const int pylith::bc::DirichletDataQuad4::_numFixedDOF = 2;
-const int pylith::bc::DirichletDataQuad4::_fixedDOF[] = { 1, 0 };
+const int pylith::bc::DirichletDataQuad4::_fixedDOF[] = { 0, 1 };
 
 const int pylith::bc::DirichletDataQuad4::_numConstrainedPts = 3;
 const int pylith::bc::DirichletDataQuad4::_constrainedPoints[] = { 0, 1, 4 };
 const double pylith::bc::DirichletDataQuad4::_values[] =
-  { 0.6, 0.1, 0.3, 0.5, 0.2, 0.4 };
+  { 0.1, 0.6, 0.5, 0.3, 0.4, 0.2 };
 
 const char* pylith::bc::DirichletDataQuad4::_meshFilename = 
   "data/quad4.mesh";



More information about the cig-commits mailing list