[cig-commits] r21044 - in short/3D/PyLith/branches/v1.7-trunk: . doc/releasenotes doc/userguide doc/userguide/cover doc/userguide/install doc/userguide/tutorials/3dhex8/dike doc/userguide/tutorials/3dtet4 examples/2d/greensfns/reverse examples/2d/greensfns/strikeslip libsrc/pylith/faults pylith/bc pylith/meshio pylith/problems tests_auto/eqinfo unittests/pytests/bc unittests/pytests/meshio unittests/pytests/meshio/data

brad at geodynamics.org brad at geodynamics.org
Fri Nov 16 10:50:44 PST 2012


Author: brad
Date: 2012-11-16 10:50:43 -0800 (Fri, 16 Nov 2012)
New Revision: 21044

Added:
   short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.1.txt
   short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/point.txt
Modified:
   short/3D/PyLith/branches/v1.7-trunk/README
   short/3D/PyLith/branches/v1.7-trunk/configure.ac
   short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.0.txt
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/cover/cover.pdf
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/cover/cover.svg.gz
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/cover/cover_small.jpg
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/install/install.lyx
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/preface.lyx
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dhex8/dike/dike.lyx
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dtet4/3dtet4.lyx
   short/3D/PyLith/branches/v1.7-trunk/doc/userguide/userguide.lyx
   short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/reverse/pylithapp.cfg
   short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/strikeslip/pylithapp.cfg
   short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
   short/3D/PyLith/branches/v1.7-trunk/pylith/bc/DirichletBC.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/meshio/PointsList.py
   short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py
   short/3D/PyLith/branches/v1.7-trunk/setup.py
   short/3D/PyLith/branches/v1.7-trunk/tests_auto/eqinfo/TestEqInfo.py
   short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/bc/TestDirichletBC.py
   short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/TestOutputSolnPoints.py
   short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/Makefile.am
Log:
Merge from stable.

Modified: short/3D/PyLith/branches/v1.7-trunk/README
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/README	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/README	2012-11-16 18:50:43 UTC (rev 21044)
@@ -1,4 +1,4 @@
-We are pleased to announce release of PyLith version 1.8.0
+We are pleased to announce release of PyLith version 1.8.1
 
 Please submit bug reports via the World Wide Web at:
     http://geodynamics.org/roundup    
@@ -62,6 +62,29 @@
   formulation = pylith.problems.ExplicitTet4
 
 ----------------------------------------------------------------------
+Version 1.8.1
+----------------------------------------------------------------------
+
+* Bug fixes
+
+  - Fixed two MPI related bugs in computing Green's functions in
+    parallel. The number of impulses corresponded to only those on
+    process 0.
+
+  - Fixed bug when reading in list of output points with just one
+    point.
+
+  - Adjusted autoconf Python setup macro to remove temporary
+    sysconfig.pyc file.
+
+  - Added check to make sure degree of freedom specified in Dirichlet
+    BC is consistent with spatial dimension of problem.
+
+  - Corrected two typos in the manual related to fault opening and
+    tractions in examples/3d/hex8/step20 and updating to the use of
+    cell.dimension for the quadrature scheme with tets.
+
+----------------------------------------------------------------------
 Version 1.8.0
 ----------------------------------------------------------------------
 
@@ -103,6 +126,12 @@
     size using an Exodus-II vertex field. Note that this required
     updating the NetCDF library.
 
+  * New CUBIT meshing examples demonstrating how to merge surfaces and
+    use and an Exodus-II vertex field to specify the discretization
+    size.
+    + examples/meshing/surface_nurbs/merge_surfs
+    + examples/meshing/cubit_cellsize
+
 * Bug fixes
 
   - Fixed omission of synchronization of stable time step computation

Modified: short/3D/PyLith/branches/v1.7-trunk/configure.ac
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/configure.ac	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/configure.ac	2012-11-16 18:50:43 UTC (rev 21044)
@@ -17,7 +17,7 @@
 # Process this file with autoconf to produce a configure script.
 
 AC_PREREQ(2.59)
-AC_INIT([PyLith], [1.8.0], [cig-short at geodynamics.org])
+AC_INIT([PyLith], [1.8.1], [cig-short at geodynamics.org])
 AC_CONFIG_AUX_DIR([./aux-config])
 AC_CONFIG_HEADER([portinfo])
 AC_CONFIG_MACRO_DIR([m4])

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.0.txt
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.0.txt	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.0.txt	2012-11-16 18:50:43 UTC (rev 21044)
@@ -64,6 +64,12 @@
     size using an Exodus-II vertex field. Note that this required
     updating the NetCDF library.
 
+  * New CUBIT meshing examples demonstrating how to merge surfaces and
+    use and an Exodus-II vertex field to specify the discretization
+    size.
+    + examples/meshing/surface_nurbs/merge_surfs
+    + examples/meshing/cubit_cellsize
+
 * Bug fixes
 
   - Fixed omission of synchronization of stable time step computation

Copied: short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.1.txt (from rev 21043, short/3D/PyLith/branches/v1.8-stable/doc/releasenotes/announce_v1.8.1.txt)
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.1.txt	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/doc/releasenotes/announce_v1.8.1.txt	2012-11-16 18:50:43 UTC (rev 21044)
@@ -0,0 +1,123 @@
+Greetings,
+
+I am pleased to announce the release of PyLith 1.8.1, a finite-element
+code designed to solve dynamic elastic problems and quasi-static
+viscoelastic problems in tectonic deformation.
+
+This release fixes a few bugs in PyLith v1.8.0. We strongly recommend
+all users of previous PyLith releases switch to this latest
+release.
+
+See the README file for changes required to switch to the v1.8.x
+release series from previous versions.
+
+You can download the source code and binaries from
+
+    http://geodynamics.org/cig/software/packages/short/pylith
+
+Detailed installation instructions for the binary packages are in the
+User Manual with detailed building instructions for a few platforms in
+the INSTALL file bundled with the PyLith Installer utility.
+
+
+RELEASE NOTES - PyLith v1.8.1
+
+* Bug fixes
+
+  - Fixed two MPI related bugs in computing Green's functions in
+    parallel. The number of impulses corresponded to only those on
+    processor 0.
+
+  - Fixed bug when reading in list of output points with just one
+    point.
+
+  - Adjusted autoconf Python setup macro to remove temporary
+    sysconfig.pyc file.
+
+  - Added check to make sure degree of freedom specified in Dirichlet
+    BC is consistent with spatial dimension of problem.
+
+  - Corrected two typos in the manual related to fault opening and
+    tractions in examples/3d/hex8/step20 and updating to the use of
+    cell.dimension for the quadrature scheme with tets.
+
+RELEASE NOTES - PyLith v1.8.0
+
+* New features
+
+  * Additional flexibility in PETSc nonlinear solver parameters
+
+    The default line search type for the PETSc nonlinear (SNES) solver
+    is a customized backtrace method included in PyLith. The user may
+    now select alternative line search types (basic, bt, l2, cp)
+    available in PETSc.
+
+  * Post-processing utility pylith_eqinfo to compute slip information.
+
+    This post-processing utility computes the moment magnitude,
+    seismic moment, seismic potency, and average slip at
+    user-specified snapshots in time from PyLith HDF5 output.
+    Information is given for each fault and across all faults. See
+    the Post-processing section of the manual in the Running PyLith
+    chapter for more information.
+
+  * Computation of the stable time step for explicit time-stepping.
+
+    The stable time step for explicit time-stepping is computed based
+    on the CFL condition and minimum edge lengths. For triangular and
+    tetrahedral cells we also account for a reduction in the stable
+    time step due to distorted cells (e.g., slivers and needles). See
+    the Stable time step section in the Materials chapter of the
+    manual for more information.
+
+  * Output the stable time step for each cell in a material.
+ 
+    Output cell_info_fields "stable_dt_implicit" and
+    "stable_dt_explicit" can be included in material output.
+
+  * Added netCDF Python module to binary distribution to provide
+    Python interface to NetCDF files, including Exodus-II files. This
+    is used in a new meshing example for setting the discretization
+    size using an Exodus-II vertex field. Note that this required
+    updating the NetCDF library.
+
+  * New CUBIT meshing examples demonstrating how to merge surfaces and
+    use and an Exodus-II vertex field to specify the discretization
+    size.
+    + examples/meshing/surface_nurbs/merge_surfs
+    + examples/meshing/cubit_cellsize
+
+* Bug fixes
+
+  - Fixed omission of synchronization of stable time step computation
+    among processors. Minimum time step among all processors rather
+    than local value should be used.
+
+  - Fixed density scale not being set in NondimElasticQuasistatic.
+    Density scale should be set based on shear modulus, length scale,
+    and relaxation time.
+
+  - Added warning when initial state for a fault constitutive model is
+    not set. If an initial state value is not given, for rate-state
+    friction using a default value of L / reference slip rate. Other
+    fault constitutive models use a default value of 0.0 for initial
+    state variables.
+
+  - Separated tensor components in Xdmf files to avoid confusion. The
+    corresponding HDF5 files remain unchanged.
+
+  - Removed explicit time-stepping formulation with non-lumped
+    Jacobian. This formulation was not setup properly for spontaneous
+    rupture models and is too computationally expensive for practical
+    problems. The ExplicitLumped* formulations are now simply Explicit*.
+
+  - Fixed parallel bug that resulting in inconsistent orientation of
+    fault slip directions. Flipping the fault orientation was not
+    synchronized across processors. This bug would only appear when
+    running in parallel with faults that change from dipping in one
+    direction to dipping in the opposite direction.
+
+  - Fixed bug in setting name of field in OutputSolnPoints when output
+    multiple fields. This bug caused the name of the first output
+    field to be used and output data to overwrite each other.
+

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/cover/cover.pdf
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/cover/cover.svg.gz
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/cover/cover_small.jpg
===================================================================
(Binary files differ)

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/install/install.lyx
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/doc/userguide/install/install.lyx	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/doc/userguide/install/install.lyx	2012-11-16 18:50:43 UTC (rev 21044)
@@ -253,7 +253,7 @@
 
 \begin_deeper
 \begin_layout LyX-Code
-$ tar -xzf pylith-1.8.0-linux-i686.tgz
+$ tar -xzf pylith-1.8.1-linux-i686.tgz
 \end_layout
 
 \end_deeper
@@ -328,7 +328,7 @@
 
 \begin_deeper
 \begin_layout LyX-Code
-$ tar -xzf pylith-1.8.0-darwin-10.5.tgz
+$ tar -xzf pylith-1.8.1-darwin-10.5.tgz
 \end_layout
 
 \end_deeper

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/preface.lyx
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/doc/userguide/preface.lyx	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/doc/userguide/preface.lyx	2012-11-16 18:50:43 UTC (rev 21044)
@@ -190,14 +190,14 @@
  Strand, and C.
  Williams (2011), 
 \emph on
-PyLith User Manual, Version 1.8.0.
+PyLith User Manual, Version 1.8.1.
 
 \emph default
  Davis, CA: Computational Infrastructure of Geodynamics.
 \begin_inset Newline newline
 \end_inset
 
-URL: geodynamics.org/cig/software/pylith/pylith_manual-1.8.0.pdf
+URL: geodynamics.org/cig/software/pylith/pylith_manual-1.8.1.pdf
 \end_layout
 
 \begin_layout Section

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dhex8/dike/dike.lyx
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dhex8/dike/dike.lyx	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dhex8/dike/dike.lyx	2012-11-16 18:50:43 UTC (rev 21044)
@@ -171,7 +171,7 @@
 \family typewriter
 open_free_surface
 \family default
- to True in order for the tractions to be imposed when the fault is open;
+ to False in order for the tractions to be imposed when the fault is open;
  the default behavior for fault opening is a free surface (the two sides
  of the fault are completely uncoupled).
  The most important fault parameters for prescribing the tensile fault tractions
@@ -183,7 +183,7 @@
 \end_layout
 
 \begin_layout LyX-Code
-open_free_surface = True
+open_free_surface = False
 \begin_inset Newline newline
 \end_inset
 

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dtet4/3dtet4.lyx
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dtet4/3dtet4.lyx	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/doc/userguide/tutorials/3dtet4/3dtet4.lyx	2012-11-16 18:50:43 UTC (rev 21044)
@@ -520,7 +520,7 @@
 \end_layout
 
 \begin_layout LyX-Code
-quadrature.cell.shape = tetrahedron
+quadrature.cell.dimension = 3
 \end_layout
 
 \begin_layout LyX-Code
@@ -548,7 +548,7 @@
 \end_layout
 
 \begin_layout LyX-Code
-quadrature.cell.shape = tetrahedron
+quadrature.cell.dimension = 3
 \end_layout
 
 \begin_layout LyX-Code

Modified: short/3D/PyLith/branches/v1.7-trunk/doc/userguide/userguide.lyx
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/doc/userguide/userguide.lyx	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/doc/userguide/userguide.lyx	2012-11-16 18:50:43 UTC (rev 21044)
@@ -136,7 +136,7 @@
 \begin_inset Newline newline
 \end_inset
 
-Version 1.8.0
+Version 1.8.1
 \end_layout
 
 \begin_layout Date

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/reverse/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/reverse/pylithapp.cfg	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/reverse/pylithapp.cfg	2012-11-16 18:50:43 UTC (rev 21044)
@@ -153,7 +153,7 @@
 sub_pc_factor_shift_type = nonzero
 
 ksp_rtol = 1.0e-8
-ksp_atol = 1.0e-20
+ksp_atol = 1.0e-10
 ksp_max_it = 500
 
 ksp_monitor = true

Modified: short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/strikeslip/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/strikeslip/pylithapp.cfg	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/examples/2d/greensfns/strikeslip/pylithapp.cfg	2012-11-16 18:50:43 UTC (rev 21044)
@@ -154,7 +154,7 @@
 sub_pc_factor_shift_type = nonzero
 
 ksp_rtol = 1.0e-8
-ksp_atol = 1.0e-20
+ksp_atol = 1.0e-10
 ksp_max_it = 500
 
 ksp_monitor = true

Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc	2012-11-16 18:50:43 UTC (rev 21044)
@@ -90,12 +90,14 @@
 pylith::faults::FaultCohesiveImpulses::impulseDOF(const int* flags,
 						  const int size)
 { // impulseDOF
-  if (size > 0)
+  if (size > 0) {
     assert(flags);
+  } // if
 
   _impulseDOF.resize(size);
-  for (int i=0; i < size; ++i)
+  for (int i=0; i < size; ++i) {
     _impulseDOF[i] = flags[i];
+  } // for
 } // impulseDOF
 
 // ----------------------------------------------------------------------
@@ -118,7 +120,15 @@
 int
 pylith::faults::FaultCohesiveImpulses::numImpulses(void) const
 { // numImpulses
-  return _impulsePoints.size();
+  assert(_faultMesh);
+  const ALE::Obj<SieveSubMesh>& faultSieveMesh = _faultMesh->sieveMesh();
+  assert(!faultSieveMesh.isNull());
+  MPI_Comm comm = faultSieveMesh->comm();
+  int numImpulsesLocal = _impulsePoints.size();
+  int numImpulses = 0;
+  MPI_Allreduce(&numImpulsesLocal, &numImpulses, 1, MPI_INT, MPI_SUM, comm);
+
+  return numImpulses;
 } // numImpulses
 
 // ----------------------------------------------------------------------
@@ -181,7 +191,7 @@
 // Get vertex field associated with integrator.
 const pylith::topology::Field<pylith::topology::SubMesh>&
 pylith::faults::FaultCohesiveImpulses::vertexField(const char* name,
-                                              const topology::SolutionFields* fields)
+						   const topology::SolutionFields* fields)
 { // vertexField
   assert(_faultMesh);
   assert(_quadrature);
@@ -196,11 +206,9 @@
   PylithScalar scale = 0.0;
   int fiberDim = 0;
   if (0 == strcasecmp("slip", name)) {
-    const topology::Field<topology::SubMesh>& dispRel = 
-      _fields->get("relative disp");
+    const topology::Field<topology::SubMesh>& dispRel = _fields->get("relative disp");
     _allocateBufferVectorField();
-    topology::Field<topology::SubMesh>& buffer =
-        _fields->get("buffer (vector)");
+    topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     buffer.copy(dispRel);
     buffer.label("slip");
     FaultCohesiveLagrange::globalToFault(&buffer, orientation);
@@ -210,50 +218,41 @@
     const ALE::Obj<RealSection>& orientationSection = _fields->get(
       "orientation").section();
     assert(!orientationSection.isNull());
-    const ALE::Obj<RealSection>& dirSection = orientationSection->getFibration(
-      0);
+    const ALE::Obj<RealSection>& dirSection = orientationSection->getFibration(0);
     assert(!dirSection.isNull());
     _allocateBufferVectorField();
-    topology::Field<topology::SubMesh>& buffer =
-        _fields->get("buffer (vector)");
+    topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     buffer.copy(dirSection);
     buffer.label("strike_dir");
     buffer.scale(1.0);
     return buffer;
 
   } else if (2 == cohesiveDim && 0 == strcasecmp("dip_dir", name)) {
-    const ALE::Obj<RealSection>& orientationSection = _fields->get(
-      "orientation").section();
+    const ALE::Obj<RealSection>& orientationSection = _fields->get("orientation").section();
     assert(!orientationSection.isNull());
-    const ALE::Obj<RealSection>& dirSection = orientationSection->getFibration(
-      1);
+    const ALE::Obj<RealSection>& dirSection = orientationSection->getFibration(1);
     _allocateBufferVectorField();
-    topology::Field<topology::SubMesh>& buffer =
-        _fields->get("buffer (vector)");
+    topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     buffer.copy(dirSection);
     buffer.label("dip_dir");
     buffer.scale(1.0);
     return buffer;
 
   } else if (0 == strcasecmp("normal_dir", name)) {
-    const ALE::Obj<RealSection>& orientationSection = _fields->get(
-      "orientation").section();
+    const ALE::Obj<RealSection>& orientationSection = _fields->get("orientation").section();
     assert(!orientationSection.isNull());
     const int space = (0 == cohesiveDim) ? 0 : (1 == cohesiveDim) ? 1 : 2;
-    const ALE::Obj<RealSection>& dirSection = orientationSection->getFibration(
-      space);
+    const ALE::Obj<RealSection>& dirSection = orientationSection->getFibration(space);
     assert(!dirSection.isNull());
     _allocateBufferVectorField();
-    topology::Field<topology::SubMesh>& buffer =
-        _fields->get("buffer (vector)");
+    topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     buffer.copy(dirSection);
     buffer.label("normal_dir");
     buffer.scale(1.0);
     return buffer;
 
   } else if (0 == strcasecmp("impulse_amplitude", name)) {
-    topology::Field<topology::SubMesh>& amplitude =
-        _fields->get("impulse amplitude");
+    topology::Field<topology::SubMesh>& amplitude = _fields->get("impulse amplitude");
     return amplitude;
 
   } else if (0 == strcasecmp("area", name)) {
@@ -264,8 +263,7 @@
     assert(fields);
     const topology::Field<topology::Mesh>& dispT = fields->get("disp(t)");
     _allocateBufferVectorField();
-    topology::Field<topology::SubMesh>& buffer =
-        _fields->get("buffer (vector)");
+    topology::Field<topology::SubMesh>& buffer = _fields->get("buffer (vector)");
     _calcTractionsChange(&buffer, dispT);
     return buffer;
 
@@ -303,8 +301,7 @@
 
   // Create section to hold amplitudes of impulses.
   _fields->add("impulse amplitude", "impulse_amplitude");
-  topology::Field<topology::SubMesh>& amplitude = 
-    _fields->get("impulse amplitude");
+  topology::Field<topology::SubMesh>& amplitude = _fields->get("impulse amplitude");
   topology::Field<topology::SubMesh>& dispRel = _fields->get("relative disp");
   const int fiberDim = 1;
   amplitude.newSection(dispRel, fiberDim);
@@ -322,8 +319,7 @@
   assert(!faultSieveMesh.isNull());
 
   scalar_array coordsVertex(spaceDim);
-  const ALE::Obj<RealSection>& coordsSection =
-    faultSieveMesh->getRealSection("coordinates");
+  const ALE::Obj<RealSection>& coordsSection = faultSieveMesh->getRealSection("coordinates");
   assert(!coordsSection.isNull());
 
   assert(_dbImpulseAmp);
@@ -338,12 +334,10 @@
     const int v_fault = _cohesiveVertices[iVertex].fault;
 
     coordsSection->restrictPoint(v_fault, &coordsVertex[0], coordsVertex.size());
-    _normalizer->dimensionalize(&coordsVertex[0], coordsVertex.size(),
-				lengthScale);
+    _normalizer->dimensionalize(&coordsVertex[0], coordsVertex.size(), lengthScale);
 
     amplitudeVertex = 0.0;
-    int err = _dbImpulseAmp->query(&amplitudeVertex, 1,
-				   &coordsVertex[0], coordsVertex.size(), cs);
+    int err = _dbImpulseAmp->query(&amplitudeVertex, 1, &coordsVertex[0], coordsVertex.size(), cs);
     if (err) {
       std::ostringstream msg;
       msg << "Could not find amplitude for Green's function impulses at \n" << "(";
@@ -389,13 +383,14 @@
   assert(!faultSieveMesh.isNull());
 
   // Gather number of points on each processor.
-  const int numImpulsesLocal = pointOrder.size();
+  int numImpulsesLocal = pointOrder.size();
   const int commSize = faultSieveMesh->commSize();
   const int commRank = faultSieveMesh->commRank();
   int_array numImpulsesAll(commSize);
   MPI_Comm comm = faultSieveMesh->comm();
-  MPI_Allgather((void*)&numImpulsesLocal, 1, MPI_INT, (void*)&numImpulsesAll[0], commSize, MPI_INT, comm);
-  
+  PetscErrorCode err = 0;
+  err = MPI_Allgather(&numImpulsesLocal, 1, MPI_INT, &numImpulsesAll[0], 1, MPI_INT, comm);CHKERRXX(err);
+
   int localOffset = 0;
   for (int i=0; i < commRank; ++i) {
     localOffset += numImpulsesAll[i];
@@ -423,8 +418,11 @@
   for (int irank=0; irank < commSize; ++irank) {
     MPI_Barrier(comm);
     if (commRank == irank) {
-      for (int i=0; i < _impulsePoints.size(); ++i, ++impulse) {
-	const ImpulseInfoStruct& info = _impulsePoints[impulse];
+      std::cout << "RANK: " << commRank << ", # impulses: " << _impulsePoints.size() << std::endl;
+      const srcs_type::const_iterator impulsePointsEnd = _impulsePoints.end();
+      for (srcs_type::const_iterator piter=_impulsePoints.begin(); piter != impulsePointsEnd; ++piter) {
+	const int impulse = piter->first;
+	const ImpulseInfoStruct& info = piter->second;
 	const PylithScalar* amplitudeVertex = amplitudeSection->restrictPoint(_cohesiveVertices[info.indexCohesive].fault);
 	std::cout << "["<<irank<<"]: " << impulse << " -> (" << info.indexCohesive << "," << info.indexDOF << "), v_fault: " << _cohesiveVertices[info.indexCohesive].fault << ", amplitude: " << amplitudeVertex[0] << std::endl;
       } // for

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/bc/DirichletBC.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/bc/DirichletBC.py	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/bc/DirichletBC.py	2012-11-16 18:50:43 UTC (rev 21044)
@@ -80,6 +80,11 @@
     self._eventLogger.eventBegin(logEvent)
 
     BoundaryCondition.verifyConfiguration(self, self.mesh)
+    spaceDim = self.mesh.coordsys().spaceDim()
+    for d in self.bcDOF:
+      if d < 0 or d >= spaceDim:
+        raise ValueError("Attempting to constrain DOF (%d) that doesn't exist. Space dimension is %d." % \
+                         (d, spaceDim))
 
     self._eventLogger.eventEnd(logEvent)
     return

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/meshio/PointsList.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/meshio/PointsList.py	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/meshio/PointsList.py	2012-11-16 18:50:43 UTC (rev 21044)
@@ -89,6 +89,10 @@
       points = numpy.loadtxt(self.filename,
                              comments=self.commentDelimiter, 
                              delimiter=self.valueDelimiter)
+    ndims = len(points.shape)
+    if ndims == 1:
+      spaceDim = points.shape[0]
+      points = points.reshape((1,spaceDim))
     return points
   
 

Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py	2012-11-16 18:50:43 UTC (rev 21044)
@@ -151,7 +151,7 @@
     for material in self.materials.components():
       material.useElasticBehavior(True)
 
-    nimpulses = self.source.numImpulses()*self.source.numComponents()
+    nimpulses = self.source.numImpulses()
     ipulse = 0;
     dt = 1.0
     while ipulse < nimpulses:

Modified: short/3D/PyLith/branches/v1.7-trunk/setup.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/setup.py	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/setup.py	2012-11-16 18:50:43 UTC (rev 21044)
@@ -22,7 +22,7 @@
 setup(
     
     name = 'PyLith', 
-    version = '1.8.0',
+    version = '1.8.1',
 
     zip_safe = False,
     packages = find_packages(),

Modified: short/3D/PyLith/branches/v1.7-trunk/tests_auto/eqinfo/TestEqInfo.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/tests_auto/eqinfo/TestEqInfo.py	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/tests_auto/eqinfo/TestEqInfo.py	2012-11-16 18:50:43 UTC (rev 21044)
@@ -22,6 +22,7 @@
 
 import unittest
 import numpy
+import math
 
 class TestEqInfo(unittest.TestCase):
   """
@@ -32,7 +33,6 @@
     """
     Check earthquake stats.
     """
-    tol = 1.0e-6
     attrs = ["timestamp",
              "ruparea",
              "potency",
@@ -53,9 +53,12 @@
       for (valueE, value) in zip(valuesE, values):
         msg = "Mismatch in value for attribute '%s', %g != %g." % (attr, valueE, value)
         if valueE != 0.0:
-          self.assertAlmostEqual(valueE, value, msg=msg, delta=abs(tol*valueE))
+          if math.isinf(math.fabs(valueE)):
+            self.assertAlmostEqual(1.0, math.fabs(value)/1.0e+30, places=6, msg=msg)
+          else:
+            self.assertAlmostEqual(1.0, value/valueE, places=6, msg=msg)
         else:
-          self.assertAlmostEqual(valueE, value, msg=msg, delta=tol)
+          self.assertAlmostEqual(valueE, value, places=6, msg=msg)
         
     return
 

Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/bc/TestDirichletBC.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/bc/TestDirichletBC.py	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/bc/TestDirichletBC.py	2012-11-16 18:50:43 UTC (rev 21044)
@@ -99,6 +99,22 @@
     return
 
 
+  def test_verifyConfiguration(self):
+    """
+    Test verifyConfiguration().
+
+    WARNING: This is not a rigorous test of verifyConfiguration() because we
+    don't verify the results.
+    """
+
+    (mesh, bc, field) = self._initialize()
+    bc.verifyConfiguration()
+
+    # We should really add something here to check to make sure things
+    # actually initialized correctly    
+    return
+
+
   def test_setConstraintSizes(self):
     """
     Test setConstraintSizes().

Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/TestOutputSolnPoints.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/TestOutputSolnPoints.py	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/TestOutputSolnPoints.py	2012-11-16 18:50:43 UTC (rev 21044)
@@ -102,6 +102,22 @@
     return
   
   
+  def test_initialize2(self):
+    """
+    Test initialize().
+    """
+    output = OutputSolnPoints()
+    output.inventory.reader.inventory.filename = "data/point.txt"
+    output.inventory.reader._configure()
+    output.inventory.writer.inventory.filename = "test.vtk"
+    output.inventory.writer._configure()
+    output._configure()
+
+    output.preinitialize()
+    output.initialize(self.mesh, self.normalizer)
+    return
+
+
   def test_initialize(self):
     """
     Test initialize().

Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/Makefile.am	2012-11-16 02:12:16 UTC (rev 21043)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/Makefile.am	2012-11-16 18:50:43 UTC (rev 21044)
@@ -23,7 +23,8 @@
 	cube2.txt \
 	twohex8.exo \
 	twohex8.txt \
-	points.txt
+	points.txt \
+	point.txt
 
 noinst_TMP = \
 	cube2_test.txt \

Copied: short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/point.txt (from rev 21043, short/3D/PyLith/branches/v1.8-stable/unittests/pytests/meshio/data/point.txt)
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/point.txt	                        (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/pytests/meshio/data/point.txt	2012-11-16 18:50:43 UTC (rev 21044)
@@ -0,0 +1,2 @@
+# Here is a point within the volume of the hex8 mesh.
+ 0.5  0.2  0.0



More information about the CIG-COMMITS mailing list