[cig-commits] r17114 - in short/3D/PyLith/branches/pylith-scecdynrup: . examples/3d/hex8 examples/greensfns/hex8/gfspatialdb libsrc/faults libsrc/friction libsrc/meshio libsrc/topology modulesrc/friction modulesrc/meshio pylith pylith/friction pylith/meshio tests/2d unittests/libtests/friction/data
brad at geodynamics.org
brad at geodynamics.org
Mon Aug 23 17:00:53 PDT 2010
Author: brad
Date: 2010-08-23 17:00:52 -0700 (Mon, 23 Aug 2010)
New Revision: 17114
Added:
short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step02.cfg
short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfspatialdb/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.icc
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/DataWriterHDF5.i
short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5Mesh.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubMesh.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubSubMesh.py
short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/faultstrip/
Modified:
short/3D/PyLith/branches/pylith-scecdynrup/configure.ac
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/meshiofwd.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/meshio.i
short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh
Log:
Merge from trunk.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/configure.ac
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/configure.ac 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/configure.ac 2010-08-24 00:00:52 UTC (rev 17114)
@@ -330,6 +330,7 @@
examples/greensfns/hex8/Makefile
examples/greensfns/hex8/gfimpulses/Makefile
examples/greensfns/hex8/gfresponses/Makefile
+ examples/greensfns/hex8/gfspatialdb/Makefile
examples/twocells/twohex8/Makefile
examples/twocells/twoquad4/Makefile
examples/twocells/twotet4/Makefile
Added: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step02.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step02.cfg (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step02.cfg 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,121 @@
+# -*- Python -*-
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# PROBLEM DESCRIPTION
+# ----------------------------------------------------------------------
+
+#
+# This is a purely elastic static problem using both Dirichlet
+# (displacement) boundary conditions and Neumann (traction) boundary
+# conditions. The lower (minimum z) boundary is held fixed in the
+# z-direction. On the negative x-boundary, displacements are held fixed in
+# the x and y-directions. On the positive x-boundary, tractions
+# corresponding to 1 MPa of shear in the +y direction and 1 MPa of normal
+# stress in the -x direction are applied.
+
+# ----------------------------------------------------------------------
+# RUNNING THE SIMULATON
+# ----------------------------------------------------------------------
+
+# This is not a self-contained simulation configuration file. This
+# file only specifies parameters specific to tutorial step02.
+# The general parameters are specificed in the pylithapp.cfg
+# file which PyLith reads by default.
+#
+# To run the simulation:
+# pylith step02.cfg
+#
+# Output will be directed to directory output.
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[pylithapp.timedependent]
+# Set bc to an array of 3 boundary conditions: 'x_pos','x_neg', and 'z_neg'.
+bc = [x_pos,x_neg,z_neg]
+
+[pylithapp.timedependent.implicit]
+# Set the output to an array of 2 output managers.
+# We will output the solution over the domain and the ground surface.
+output = [domain,subdomain]
+
+# Set subdomain component to OutputSolnSubset (subset of domain).
+output.subdomain = pylith.meshio.OutputSolnSubset
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+# Set the parameters for Dirichlet boundary conditions applied on the
+# -x and -z faces of the box, and the Neumann boundary conditions
+# applied on the +x face of the box.
+#
+# We fix the x and y degrees of freedom on the -x face, and
+# fix the z degree of freedom on the bottom (-z) face.
+#
+# We apply axial and shear tractions on the +x face.
+#
+# For x_pos, we change the database from ZeroDispDB (which
+# specifies a zero value) to SimpleDB (which uses a data file to
+# specify a spatial variation), and we change the boundary condition type
+# to Neumann (traction).
+#
+# For x_neg and z_neg, we keep the default ZeroDispDB, since we just want zero
+# displacements on those boundaries.
+#
+
+# The label corresponds to the name of the nodeset in CUBIT.
+
+# +x face -- first change bc type to Neumann
+[pylithapp.timedependent.bc]
+x_pos = pylith.bc.Neumann
+
+# +x face
+[pylithapp.timedependent.bc.x_pos]
+label = face_xpos
+db_initial = spatialdata.spatialdb.SimpleDB
+db_initial.label = Neumann BC on +x
+db_initial.iohandler.filename = spatialdb/tractions_axial_shear.spatialdb
+
+output.cell_info_fields = [initial-value]
+output.writer.filename = output/step02-traction.vtk
+output.cell_filter = pylith.meshio.CellFilterAvgSubMesh
+
+# We must specify quadrature information for the cell faces.
+quadrature.cell = pylith.feassemble.FIATLagrange
+quadrature.cell.dimension = 2
+quadrature.cell.quad_order = 2
+
+# -x face
+[pylithapp.timedependent.bc.x_neg]
+bc_dof = [0, 1]
+label = face_xneg
+db_initial.label = Dirichlet BC on -x
+
+# -z face
+[pylithapp.timedependent.bc.z_neg]
+bc_dof = [2]
+label = face_zneg
+db_initial.label = Dirichlet BC on -z
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+# Give basename for VTK domain output of solution over domain.
+[pylithapp.problem.formulation.output.domain.writer]
+filename = output/step02.vtk
+
+# Give basename for VTK domain output of solution over ground surface.
+[pylithapp.problem.formulation.output.subdomain]
+label = face_zpos ; Name of nodeset for subdomain
+writer.filename = output/step02-groundsurf.vtk
+
+# Give basename for VTK output of upper_crust state variables.
+[pylithapp.timedependent.materials.upper_crust.output]
+cell_filter = pylith.meshio.CellFilterAvgMesh
+writer.filename = output/step02-upper_crust.vtk
+
+# Give basename for VTK output of lower_crust state variables.
+[pylithapp.timedependent.materials.lower_crust.output]
+cell_filter = pylith.meshio.CellFilterAvgMesh
+writer.filename = output/step02-lower_crust.vtk
Copied: short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfspatialdb/Makefile.am (from rev 17113, short/3D/PyLith/trunk/examples/greensfns/hex8/gfspatialdb/Makefile.am)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfspatialdb/Makefile.am (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/greensfns/hex8/gfspatialdb/Makefile.am 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,20 @@
+# -*- Makefile -*-
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+
+# End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/faults/FaultCohesiveDyn.cc 2010-08-24 00:00:52 UTC (rev 17114)
@@ -654,8 +654,6 @@
double_array lagrangeTpdtVertex(spaceDim);
double_array dLagrangeTpdtVertex(spaceDim);
- _updateSlipRate(*fields);
-
// Update time step in friction (can vary).
_friction->timeStep(_dt);
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/SlipWeakening.cc 2010-08-24 00:00:52 UTC (rev 17114)
@@ -306,7 +306,8 @@
assert(0 != numStateVars);
assert(0 != numProperties);
- if (slipRate != 0.0) {
+ const double tolerance = 1.0e-12;
+ if (slipRate > tolerance) {
const double slipPrev = stateVars[s_slipPrev];
stateVars[s_slipPrev] = stateVars[s_slipCum];
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.cc 2010-08-24 00:00:52 UTC (rev 17114)
@@ -2,11 +2,17 @@
//
// ----------------------------------------------------------------------
//
-// Brad T. Aagaard
-// U.S. Geological Survey
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
//
-// {LicenseText}
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
// ----------------------------------------------------------------------
//
@@ -288,7 +294,8 @@
assert(0 != numStateVars);
assert(0 != numProperties);
- if (slipRate != 0.0) {
+ const double tolerance = 1.0e-12;
+ if (slipRate > tolerance) {
const double dt = _dt;
stateVars[s_time] += dt;
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/friction/TimeWeakening.hh 2010-08-24 00:00:52 UTC (rev 17114)
@@ -2,11 +2,17 @@
//
// ----------------------------------------------------------------------
//
-// Brad T. Aagaard
-// U.S. Geological Survey
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
//
-// {LicenseText}
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
// ----------------------------------------------------------------------
//
Copied: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.cc (from rev 17113, short/3D/PyLith/trunk/libsrc/meshio/DataWriterHDF5.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.cc 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,296 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include <portinfo>
+
+#include <petscmesh_viewers.hh> // USES HDF5Viewer
+
+#include <cassert> // USES assert()
+#include <sstream> // USES std::ostringstream
+#include <stdexcept> // USES std::runtime_error
+
+// ----------------------------------------------------------------------
+// Constructor
+template<typename mesh_type, typename field_type>
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::DataWriterHDF5(void) :
+ _filename("output.h5"),
+ _viewer(0)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+template<typename mesh_type, typename field_type>
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::~DataWriterHDF5(void)
+{ // destructor
+ deallocate();
+} // destructor
+
+// ----------------------------------------------------------------------
+// Deallocate PETSc and local data structures.
+template<typename mesh_type, typename field_type>
+void
+pylith::meshio::DataWriterHDF5<mesh_type, field_type>::deallocate(void)
+{ // deallocate
+ if (0 != _viewer)
+ PetscViewerDestroy(_viewer);
+ _viewer = 0;
+} // deallocate
+
+// ----------------------------------------------------------------------
+// Copy constructor.
+template<typename mesh_type, typename field_type>
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::DataWriterHDF5(const DataWriterHDF5<mesh_type, field_type>& w) :
+ DataWriter<mesh_type, field_type>(w),
+ _filename(w._filename),
+ _viewer(0)
+{ // copy constructor
+} // copy constructor
+
+// ----------------------------------------------------------------------
+// Prepare file for data at a new time step.
+template<typename mesh_type, typename field_type>
+void
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::openTimeStep(const double t,
+ const mesh_type& mesh,
+ const char* label,
+ const int labelId)
+{ // openTimeStep
+#if 0
+ // MATT - This stuff needs to be updated for HDF5.
+
+ try {
+ PetscErrorCode err = 0;
+
+ const std::string& filename = _hdf5Filename(t);
+
+ err = PetscViewerCreate(mesh.comm(), &_viewer);
+ CHECK_PETSC_ERROR(err);
+ err = PetscViewerSetType(_viewer, PETSCVIEWERASCII);
+ CHECK_PETSC_ERROR(err);
+ err = PetscViewerSetFormat(_viewer, PETSC_VIEWER_ASCII_HDF5);
+ CHECK_PETSC_ERROR(err);
+ err = PetscViewerFileSetName(_viewer, filename.c_str());
+ CHECK_PETSC_ERROR(err);
+
+ const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh = mesh.sieveMesh();
+
+ err = HDF5Viewer::writeHeader(sieveMesh, _viewer);
+ CHECK_PETSC_ERROR(err);
+ //std::cout << "Wrote header for " << filename << std::endl;
+ err = HDF5Viewer::writeVertices(sieveMesh, _viewer);
+ CHECK_PETSC_ERROR(err);
+ //std::cout << "Wrote vertices for " << filename << std::endl;
+ if (0 == label) {
+ err = HDF5Viewer::writeElements(sieveMesh, _viewer);
+ CHECK_PETSC_ERROR(err);
+ } else {
+ const std::string labelName =
+ (sieveMesh->hasLabel("censored depth")) ? "censored depth" : "depth";
+ err = HDF5Viewer::writeElements(sieveMesh, label, labelId, labelName, 0, _viewer);
+ CHECK_PETSC_ERROR(err);
+ } // if
+ //std::cout << "Wrote elements for " << filename << std::endl;
+
+ _wroteVertexHeader = false;
+ _wroteCellHeader = false;
+ } catch (const std::exception& err) {
+ std::ostringstream msg;
+ msg << "Error while preparing for writing data to HDF5 file "
+ << _filename << " at time " << t << ".\n" << err.what();
+ throw std::runtime_error(msg.str());
+ } catch (const ALE::Exception& err) {
+ std::ostringstream msg;
+ msg << "Error while preparing for writing data to HDF5 file "
+ << _filename << " at time " << t << ".\n" << err.msg();
+ throw std::runtime_error(msg.str());
+ } catch (...) {
+ std::ostringstream msg;
+ msg << "Unknown error while preparing for writing data to HDF5 file "
+ << _filename << " at time " << t << ".\n";
+ throw std::runtime_error(msg.str());
+ } // try/catch
+
+#endif
+} // openTimeStep
+
+// ----------------------------------------------------------------------
+/// Cleanup after writing data for a time step.
+template<typename mesh_type, typename field_type>
+void
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::closeTimeStep(void)
+{ // closeTimeStep
+ PetscViewerDestroy(_viewer); _viewer = 0;
+} // closeTimeStep
+
+// ----------------------------------------------------------------------
+// Write field over vertices to file.
+template<typename mesh_type, typename field_type>
+void
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::writeVertexField(
+ const double t,
+ const field_type& field,
+ const mesh_type& mesh)
+{ // writeVertexField
+#if 0
+ // MATT - This stuff needs to be update for HDF5.
+
+ typedef typename mesh_type::SieveMesh SieveMesh;
+ typedef typename field_type::Mesh::RealSection RealSection;
+
+ try {
+ int rank = 0;
+ MPI_Comm_rank(field.mesh().comm(), &rank);
+
+ const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
+ assert(!sieveMesh.isNull());
+ const std::string labelName =
+ (sieveMesh->hasLabel("censored depth")) ? "censored depth" : "depth";
+ const ALE::Obj<typename SieveMesh::numbering_type>& numbering =
+ sieveMesh->getFactory()->getNumbering(sieveMesh, labelName, 0);
+ assert(!numbering.isNull());
+
+ const ALE::Obj<RealSection>& section = field.section();
+ assert(!section.isNull());
+ assert(!sieveMesh->getLabelStratum(labelName, 0).isNull());
+
+ const int localFiberDim =
+ (sieveMesh->getLabelStratum(labelName, 0)->size() > 0) ?
+ section->getFiberDimension(*sieveMesh->getLabelStratum(labelName, 0)->begin()) : 0;
+ int fiberDim = 0;
+ MPI_Allreduce((void *) &localFiberDim, (void *) &fiberDim, 1,
+ MPI_INT, MPI_MAX, field.mesh().comm());
+ assert(fiberDim > 0);
+ const int enforceDim =
+ (field.vectorFieldType() != topology::FieldBase::VECTOR) ? fiberDim : 3;
+
+ PetscErrorCode err = 0;
+ if (!_wroteVertexHeader) {
+ err = PetscViewerASCIIPrintf(_viewer, "POINT_DATA %d\n",
+ numbering->getGlobalSize());
+ CHECK_PETSC_ERROR(err);
+ _wroteVertexHeader = true;
+ } // if
+
+ err = HDF5Viewer::writeField(section, field.label(), fiberDim, numbering,
+ _viewer, enforceDim, _precision);
+ CHECK_PETSC_ERROR(err);
+ } catch (const std::exception& err) {
+ std::ostringstream msg;
+ msg << "Error while writing field '" << field.label() << "' at time "
+ << t << " to HDF5 file '" << _filename << "'.\n" << err.what();
+ throw std::runtime_error(msg.str());
+ } catch (...) {
+ std::ostringstream msg;
+ msg << "Error while writing field '" << field.label() << "' at time "
+ << t << " to HDF5 file '" << _filename << "'.\n";
+ throw std::runtime_error(msg.str());
+ } // try/catch
+
+#endif
+} // writeVertexField
+
+// ----------------------------------------------------------------------
+// Write field over cells to file.
+template<typename mesh_type, typename field_type>
+void
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::writeCellField(
+ const double t,
+ const field_type& field,
+ const char* label,
+ const int labelId)
+{ // writeCellField
+#if 0
+ // MATT - This stuff needs to be update to HDF5.
+
+ typedef typename field_type::Mesh::SieveMesh SieveMesh;
+ typedef typename field_type::Mesh::RealSection RealSection;
+
+ try {
+ int rank = 0;
+ MPI_Comm_rank(field.mesh().comm(), &rank);
+
+ // Correctly handle boundary and fault meshes
+ // Cannot just use mesh->depth() because boundaries report the wrong thing
+ const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
+ assert(!sieveMesh.isNull());
+ const int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
+ const int depth = (0 == label) ? cellDepth : labelId;
+ const std::string labelName = (0 == label) ?
+ ((sieveMesh->hasLabel("censored depth")) ?
+ "censored depth" : "depth") : label;
+ assert(!sieveMesh->getFactory().isNull());
+ const ALE::Obj<typename SieveMesh::numbering_type>& numbering =
+ sieveMesh->getFactory()->getNumbering(sieveMesh, labelName, depth);
+ assert(!numbering.isNull());
+ assert(!sieveMesh->getLabelStratum(labelName, depth).isNull());
+ const ALE::Obj<RealSection>& section = field.section();
+ assert(!section.isNull());
+
+ const int localFiberDim =
+ (sieveMesh->getLabelStratum(labelName, depth)->size() > 0) ?
+ section->getFiberDimension(*sieveMesh->getLabelStratum(labelName, depth)->begin()) : 0;
+ int fiberDim = 0;
+ MPI_Allreduce((void *) &localFiberDim, (void *) &fiberDim, 1,
+ MPI_INT, MPI_MAX, field.mesh().comm());
+ assert(fiberDim > 0);
+ const int enforceDim =
+ (field.vectorFieldType() != topology::FieldBase::VECTOR) ? fiberDim : 3;
+
+ PetscErrorCode err = 0;
+ if (!_wroteCellHeader) {
+ err = PetscViewerASCIIPrintf(_viewer, "CELL_DATA %d\n",
+ numbering->getGlobalSize());
+ CHECK_PETSC_ERROR(err);
+ _wroteCellHeader = true;
+ } // if
+
+ HDF5Viewer::writeField(section, field.label(), fiberDim, numbering,
+ _viewer, enforceDim, _precision);
+ } catch (const std::exception& err) {
+ std::ostringstream msg;
+ msg << "Error while writing field '" << field.label() << "' at time "
+ << t << " to HDF5 file '" << _filename << "'.\n" << err.what();
+ throw std::runtime_error(msg.str());
+ } catch (...) {
+ std::ostringstream msg;
+ msg << "Error while writing field '" << field.label() << "' at time "
+ << t << " to HDF5 file '" << _filename << "'.\n";
+ throw std::runtime_error(msg.str());
+ } // try/catch
+
+#endif
+} // writeCellField
+
+// ----------------------------------------------------------------------
+// Generate filename for HDF5 file.
+template<typename mesh_type, typename field_type>
+std::string
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::_hdf5Filename(const double t) const
+{ // _hdf5Filename
+ std::ostringstream filename;
+ const int indexExt = _filename.find(".h5");
+ const int numTimeSteps = DataWriter<mesh_type, field_type>::_numTimeSteps;
+ if (0 == numTimeSteps)
+ filename << std::string(_filename, 0, indexExt) << "_info.hdf5";
+
+ return std::string(filename.str());
+} // _hdf5Filename
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.hh (from rev 17113, short/3D/PyLith/trunk/libsrc/meshio/DataWriterHDF5.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.hh 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+/**
+ * @file libsrc/meshio/DataWriterHDF5.hh
+ *
+ * @brief Object for writing finite-element data to HDF5 file.
+ *
+ * HDF5 schema for PyLith output.
+ *
+ * / - root group
+ * geometry - group
+ coordsys - attribute string with coordinate system
+ * vertices - dataset [nvertices, spacedim]
+ * topology - group
+ * cell_type - attribute string with cell type
+ * cells - dataset [ncells, ncorners]
+ * vertex_fields - group
+ * VERTEX_FIELD (name of vertex field) - dataset
+ * [ntimesteps, nvertices, fiberdim]
+ * cell_fields - group
+ * CELL_FIELD (name of cell field) - dataset
+ * [ntimesteps, ncells, fiberdim]
+ */
+
+#if !defined(pylith_meshio_datawriterhdf5_hh)
+#define pylith_meshio_datawriterhdf5_hh
+
+// Include directives ---------------------------------------------------
+#include "DataWriter.hh" // ISA DataWriter
+
+// DataWriterHDF5 --------------------------------------------------------
+/// Object for writing finite-element data to HDF5 file.
+template<typename mesh_type, typename field_type>
+class pylith::meshio::DataWriterHDF5 : public DataWriter<mesh_type,field_type>
+{ // DataWriterHDF5
+ friend class TestDataWriterHDF5Mesh; // unit testing
+ friend class TestDataWriterHDF5SubMesh; // unit testing
+ friend class TestDataWriterHDF5BCMesh; // unit testing
+ friend class TestDataWriterHDF5FaultMesh; // unit testing
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public :
+
+ /// Constructor
+ DataWriterHDF5(void);
+
+ /// Destructor
+ ~DataWriterHDF5(void);
+
+ /** Make copy of this object.
+ *
+ * @returns Copy of this.
+ */
+ DataWriter<mesh_type, field_type>* clone(void) const;
+
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
+ /** Set filename for HDF5 file.
+ *
+ * @param filename Name of HDF5 file.
+ */
+ void filename(const char* filename);
+
+ /** Prepare file for data at a new time step.
+ *
+ * @param t Time stamp for new data
+ * @param mesh Finite-element mesh.
+ * @param label Name of label defining cells to include in output
+ * (=0 means use all cells in mesh).
+ * @param labelId Value of label defining which cells to include.
+ */
+ void openTimeStep(const double t,
+ const mesh_type& mesh,
+ const char* label =0,
+ const int labelId =0);
+
+ /// Cleanup after writing data for a time step.
+ void closeTimeStep(void);
+
+ /** Write field over vertices to file.
+ *
+ * @param t Time associated with field.
+ * @param field Field over vertices.
+ * @param mesh Mesh associated with output.
+ */
+ void writeVertexField(const double t,
+ const field_type& field,
+ const mesh_type& mesh);
+
+ /** Write field over cells to file.
+ *
+ * @param t Time associated with field.
+ * @param field Field over cells.
+ * @param label Name of label defining cells to include in output
+ * (=0 means use all cells in mesh).
+ * @param labelId Value of label defining which cells to include.
+ */
+ void writeCellField(const double t,
+ const field_type& field,
+ const char* label =0,
+ const int labelId =0);
+
+// PRIVATE METHODS //////////////////////////////////////////////////////
+private :
+
+ /** Copy constructor.
+ *
+ * @param w Object to copy.
+ */
+ DataWriterHDF5(const DataWriterHDF5& w);
+
+ /** Generate filename for HDF5 file.
+ *
+ * @param t Time in seconds.
+ */
+ std::string _hdf5Filename(const double t) const;
+
+// NOT IMPLEMENTED //////////////////////////////////////////////////////
+private :
+
+ const DataWriterHDF5& operator=(const DataWriterHDF5&); ///< Not implemented
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private :
+
+ std::string _filename; ///< Name of HDF5 file.
+
+ PetscViewer _viewer; ///< Output file
+
+}; // DataWriterHDF5
+
+#include "DataWriterHDF5.icc" // inline methods
+#include "DataWriterHDF5.cc" // template definitions
+
+#endif // pylith_meshio_datawriterhdf5_hh
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.icc (from rev 17113, short/3D/PyLith/trunk/libsrc/meshio/DataWriterHDF5.icc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.icc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/DataWriterHDF5.icc 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,42 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawriterhdf5_hh)
+#error "DataWriterHDF5.icc must be included only from DataWriterHDF5.hh"
+#else
+
+// Make copy of this object.
+template<typename mesh_type, typename field_type>
+inline
+pylith::meshio::DataWriter<mesh_type, field_type>*
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::clone(void) const {
+ return new DataWriterHDF5(*this);
+}
+
+// Set filename for HDF5 file.
+template<typename mesh_type, typename field_type>
+inline
+void
+pylith::meshio::DataWriterHDF5<mesh_type,field_type>::filename(const char* filename) {
+ _filename = filename;
+}
+
+
+#endif
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/Makefile.am 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/Makefile.am 2010-08-24 00:00:52 UTC (rev 17114)
@@ -29,6 +29,9 @@
DataWriterVTK.hh \
DataWriterVTK.icc \
DataWriterVTK.cc \
+ DataWriterHDF5.hh \
+ DataWriterHDF5.icc \
+ DataWriterHDF5.cc \
MeshBuilder.hh \
MeshIO.hh \
MeshIO.icc \
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/meshiofwd.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/meshiofwd.hh 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/meshio/meshiofwd.hh 2010-08-24 00:00:52 UTC (rev 17114)
@@ -49,6 +49,7 @@
template<typename mesh_type, typename field_type> class OutputManager;
template<typename mesh_type, typename field_type> class DataWriter;
template<typename mesh_type, typename field_type> class DataWriterVTK;
+ template<typename mesh_type, typename field_type> class DataWriterHDF5;
template<typename mesh_type, typename field_type> class CellFilter;
template<typename mesh_type, typename field_type> class CellFilterAvg;
template<typename field_type> class VertexFilter;
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/topology/RefineUniform.cc 2010-08-24 00:00:52 UTC (rev 17114)
@@ -109,16 +109,24 @@
const ALE::Obj<SieveMesh>& newSieveMesh = newMesh->sieveMesh();
assert(!newSieveMesh.isNull());
+ std::map<edge_type, point_type> edge2vertex;
+
+#if 0 // ORIGINAL VERSION
ALE::Obj<SieveMesh::sieve_type> newSieve =
new SieveMesh::sieve_type(mesh.comm(), mesh.debug());
- std::map<edge_type, point_type> edge2vertex;
-
-#if 0 // DON'T KNOW NEW INTERFACE
newSieveMesh->setSieve(newSieve);
ALE::MeshBuilder<Mesh>::refineTetrahedra(*mesh.sieveMesh(), * newSieveMesh,
edge2vertex);
+#else
+#if 0 // DON'T KNOW NEW INTERFACE
+ // Is arg to CellRefiner constructor the new mesh or the old mesh?
+ ALE::MeshBuilder<SieveMesh>::CellRefiner<SieveMesh,edge_type> refiner(*newSieveMesh);
+
+ ALE::MeshBuilder<SieveMesh>::refineGeneral< SieveMesh,
+ ALE::MeshBuilder<SieveMesh>::CellRefiner<SieveMesh,edge_type> >(*sieveMesh, *newSieveMesh, refiner);
#endif
+#endif
// Fix material ids
const int numCells = sieveMesh->heightStratum(0)->size();
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i 2010-08-24 00:00:52 UTC (rev 17114)
@@ -2,11 +2,17 @@
//
// ----------------------------------------------------------------------
//
-// Brad T. Aagaard
-// U.S. Geological Survey
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
//
-// {LicenseText}
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
// ----------------------------------------------------------------------
//
Copied: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/DataWriterHDF5.i (from rev 17113, short/3D/PyLith/trunk/modulesrc/meshio/DataWriterHDF5.i)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/DataWriterHDF5.i (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/DataWriterHDF5.i 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,102 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+/**
+ * @file modulesrc/meshio/DataWriterHDF5.i
+ *
+ * @brief Python interface to C++ DataWriterHDF5 object.
+ */
+
+namespace pylith {
+ namespace meshio {
+
+ template<typename mesh_type, typenam field_type>
+ class pylith::meshio::DataWriterHDF5 :
+ public DataWriter<mesh_type, field_type>
+ { // DataWriterHDF5
+
+ // PUBLIC METHODS /////////////////////////////////////////////////
+ public :
+
+ /// Constructor
+ DataWriterHDF5(void);
+
+ /// Destructor
+ ~DataWriterHDF5(void);
+
+ /** Make copy of this object.
+ *
+ * @returns Copy of this.
+ */
+ DataWriter<mesh_type, field_type>* clone(void) const;
+
+ /// Deallocate PETSc and local data structures.
+ void deallocate(void);
+
+ /** Set filename for HDF5 file.
+ *
+ * @param filename Name of HDF5 file.
+ */
+ void filename(const char* filename);
+
+ /** Prepare file for data at a new time step.
+ *
+ * @param t Time stamp for new data
+ * @param mesh Finite-element mesh.
+ * @param label Name of label defining cells to include in output
+ * (=0 means use all cells in mesh).
+ * @param labelId Value of label defining which cells to include.
+ */
+ void openTimeStep(const double t,
+ const mesh_type& mesh,
+ const char* label =0,
+ const int labelId =0);
+
+ /// Cleanup after writing data for a time step.
+ void closeTimeStep(void);
+
+ /** Write field over vertices to file.
+ *
+ * @param t Time associated with field.
+ * @param field Field over vertices.
+ * @param mesh Mesh for output.
+ */
+ void writeVertexField(const double t,
+ const field_type& field,
+ const mesh_type& mesh);
+
+ /** Write field over cells to file.
+ *
+ * @param t Time associated with field.
+ * @param field Field over cells.
+ * @param label Name of label defining cells to include in output
+ * (=0 means use all cells in mesh).
+ * @param labelId Value of label defining which cells to include.
+ */
+ void writeCellField(const double t,
+ const field_type& field,
+ const char* label =0,
+ const int labelId =0);
+
+ }; // DataWriterHDF5
+
+ } // meshio
+} // pylith
+
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/Makefile.am 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/Makefile.am 2010-08-24 00:00:52 UTC (rev 17114)
@@ -36,6 +36,7 @@
CellFilterAvg.i \
DataWriter.i \
DataWriterVTK.i \
+ DataWriterHDF5.i \
OutputManager.i \
OutputSolnSubset.i
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/meshio.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/meshio.i 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/meshio/meshio.i 2010-08-24 00:00:52 UTC (rev 17114)
@@ -35,6 +35,7 @@
#include "pylith/meshio/CellFilterAvg.hh"
#include "pylith/meshio/DataWriter.hh"
#include "pylith/meshio/DataWriterVTK.hh"
+#include "pylith/meshio/DataWriterHDF5.hh"
#include "pylith/meshio/OutputManager.hh"
#include "pylith/meshio/OutputSolnSubset.hh"
@@ -69,6 +70,7 @@
%include "CellFilterAvg.i"
%include "DataWriter.i"
%include "DataWriterVTK.i"
+%include "DataWriterHDF5.i"
%include "OutputManager.i"
%include "OutputSolnSubset.i"
@@ -91,6 +93,10 @@
%template(SubMeshDataWriterVTK) pylith::meshio::DataWriterVTK<pylith::topology::SubMesh, pylith::topology::Field<pylith::topology::Mesh> >;
%template(SubSubMeshDataWriterVTK) pylith::meshio::DataWriterVTK<pylith::topology::SubMesh, pylith::topology::Field<pylith::topology::SubMesh> >;
+%template(MeshDataWriterHDF5) pylith::meshio::DataWriterHDF5<pylith::topology::Mesh, pylith::topology::Field<pylith::topology::Mesh> >;
+%template(SubMeshDataWriterHDF5) pylith::meshio::DataWriterHDF5<pylith::topology::SubMesh, pylith::topology::Field<pylith::topology::Mesh> >;
+%template(SubSubMeshDataWriterHDF5) pylith::meshio::DataWriterHDF5<pylith::topology::SubMesh, pylith::topology::Field<pylith::topology::SubMesh> >;
+
%template(MeshOutputManager) pylith::meshio::OutputManager<pylith::topology::Mesh, pylith::topology::Field<pylith::topology::Mesh> >;
%template(SubMeshOutputManager) pylith::meshio::OutputManager<pylith::topology::SubMesh, pylith::topology::Field<pylith::topology::SubMesh> >;
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/Makefile.am 2010-08-24 00:00:52 UTC (rev 17114)
@@ -91,6 +91,10 @@
meshio/DataWriterVTKMesh.py \
meshio/DataWriterVTKSubMesh.py \
meshio/DataWriterVTKSubSubMesh.py \
+ meshio/DataWriterHDF5.py \
+ meshio/DataWriterHDF5Mesh.py \
+ meshio/DataWriterHDF5SubMesh.py \
+ meshio/DataWriterHDF5SubSubMesh.py \
meshio/MeshIOObj.py \
meshio/MeshIOAscii.py \
meshio/MeshIOCubit.py \
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/friction/TimeWeakening.py 2010-08-24 00:00:52 UTC (rev 17114)
@@ -2,11 +2,17 @@
#
# ----------------------------------------------------------------------
#
-# Brad T. Aagaard
-# U.S. Geological Survey
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
#
-# <LicenseText>
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
#
+# Copyright (c) 2010 University of California, Davis
+#
+# See COPYING for license information.
+#
# ----------------------------------------------------------------------
#
Copied: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5.py (from rev 17113, short/3D/PyLith/trunk/pylith/meshio/DataWriterHDF5.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5.py (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5.py 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pyre/meshio/DataWriterHDF5.py
+##
+## @brief Python object for writing finite-element data to HDF5 file.
+
+from DataWriter import DataWriter
+
+# DataWriterHDF5 class
+class DataWriterHDF5(DataWriter):
+ """
+ Python object for writing finite-element data to HDF5 file.
+
+ Inventory
+
+ \b Properties
+ @li \b filename Name of HDF5 file.
+
+ \b Facilities
+ @li None
+ """
+
+ # INVENTORY //////////////////////////////////////////////////////////
+
+ import pyre.inventory
+
+ filename = pyre.inventory.str("filename", default="output.h5")
+ filename.meta['tip'] = "Name of HDF5 file."
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="datawriterhdf5"):
+ """
+ Constructor.
+ """
+ DataWriter.__init__(self, name)
+ return
+
+
+ def initialize(self, normalizer):
+ """
+ Initialize writer.
+ """
+ DataWriter.initialize(self, normalizer)
+ return
+
+
+# End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5Mesh.py (from rev 17113, short/3D/PyLith/trunk/pylith/meshio/DataWriterHDF5Mesh.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5Mesh.py (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5Mesh.py 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pyre/meshio/DataWriterHDF5Mesh.py
+##
+## @brief Python object for writing finite-element data to HDF5 file.
+
+from DataWriterHDF5 import DataWriterHDF5
+from meshio import MeshDataWriterHDF5 as ModuleDataWriterHDF5
+
+# DataWriterHDF5Mesh class
+class DataWriterHDF5Mesh(DataWriterHDF5, ModuleDataWriterHDF5):
+ """
+ Python object for writing finite-element data to HDF5 file.
+
+ Inventory
+
+ Factory: output_data_writer
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="datawriterhdf5mesh"):
+ """
+ Constructor.
+ """
+ DataWriterHDF5.__init__(self, name)
+ ModuleDataWriterHDF5.__init__(self)
+ return
+
+
+ def initialize(self, normalizer):
+ """
+ Initialize writer.
+ """
+ DataWriterHDF5.initialize(self, normalizer)
+
+ ModuleDataWriterHDF5.filename(self, self.filename)
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def output_data_writer():
+ """
+ Factory associated with DataWriter.
+ """
+ return DataWriterHDF5Mesh()
+
+
+# End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubMesh.py (from rev 17113, short/3D/PyLith/trunk/pylith/meshio/DataWriterHDF5SubMesh.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubMesh.py (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubMesh.py 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,69 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pyre/meshio/DataWriterVTKSubMesh.py
+##
+## @brief Python object for writing finite-element data to VTK file.
+
+from DataWriterVTK import DataWriterVTK
+from meshio import SubMeshDataWriterVTK as ModuleDataWriterVTK
+
+# DataWriterVTKSubMesh class
+class DataWriterVTKSubMesh(DataWriterVTK, ModuleDataWriterVTK):
+ """
+ Python object for writing finite-element data to VTK file.
+
+ Inventory
+
+ Factory: output_data_writer
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="datawritervtksubmesh"):
+ """
+ Constructor.
+ """
+ DataWriterVTK.__init__(self, name)
+ ModuleDataWriterVTK.__init__(self)
+ return
+
+
+ def initialize(self, normalizer):
+ """
+ Initialize writer.
+ """
+ DataWriterVTK.initialize(self, normalizer)
+
+ ModuleDataWriterVTK.filename(self, self.filename)
+ ModuleDataWriterVTK.timeFormat(self, self.timeFormat)
+ ModuleDataWriterVTK.timeConstant(self, self.timeConstantN)
+ ModuleDataWriterVTK.precision(self, self.precision)
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def output_data_writer():
+ """
+ Factory associated with DataWriter.
+ """
+ return DataWriterVTKSubMesh()
+
+
+# End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubSubMesh.py (from rev 17113, short/3D/PyLith/trunk/pylith/meshio/DataWriterHDF5SubSubMesh.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubSubMesh.py (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/DataWriterHDF5SubSubMesh.py 2010-08-24 00:00:52 UTC (rev 17114)
@@ -0,0 +1,66 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard, U.S. Geological Survey
+# Charles A. Williams, GNS Science
+# Matthew G. Knepley, University of Chicago
+#
+# This code was developed as part of the Computational Infrastructure
+# for Geodynamics (http://geodynamics.org).
+#
+# Copyright (c) 2010 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ----------------------------------------------------------------------
+#
+
+## @file pyre/meshio/DataWriterHDF5SubSubMesh.py
+##
+## @brief Python object for writing finite-element data to HDF5 file.
+
+from DataWriterHDF5 import DataWriterHDF5
+from meshio import SubSubMeshDataWriterHDF5 as ModuleDataWriterHDF5
+
+# DataWriterHDF5SubSubMesh class
+class DataWriterHDF5SubSubMesh(DataWriterHDF5, ModuleDataWriterHDF5):
+ """
+ Python object for writing finite-element data to HDF5 file.
+
+ Inventory
+
+ Factory: output_data_writer
+ """
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ def __init__(self, name="datawriterhdf5submesh"):
+ """
+ Constructor.
+ """
+ DataWriterHDF5.__init__(self, name)
+ ModuleDataWriterHDF5.__init__(self)
+ return
+
+
+ def initialize(self, normalizer):
+ """
+ Initialize writer.
+ """
+ DataWriterHDF5.initialize(self, normalizer)
+
+ ModuleDataWriterHDF5.filename(self, self.filename)
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def output_data_writer():
+ """
+ Factory associated with DataWriter.
+ """
+ return DataWriterHDF5SubSubMesh()
+
+
+# End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/faultstrip (from rev 17113, short/3D/PyLith/trunk/tests/2d/faultstrip)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.cc 2010-08-24 00:00:52 UTC (rev 17114)
@@ -2,11 +2,17 @@
//
// ======================================================================
//
-// Brad T. Aagaard
-// U.S. Geological Survey
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
//
-// {LicenseText}
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
// ======================================================================
//
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh 2010-08-23 23:53:05 UTC (rev 17113)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/TimeWeakeningData.hh 2010-08-24 00:00:52 UTC (rev 17114)
@@ -2,11 +2,17 @@
//
// ======================================================================
//
-// Brad T. Aagaard
-// U.S. Geological Survey
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
//
-// {LicenseText}
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
//
+// Copyright (c) 2010 University of California, Davis
+//
+// See COPYING for license information.
+//
// ======================================================================
//
More information about the CIG-COMMITS
mailing list