[cig-commits] r19077 - in short/3D/PyLith/branches/v1.6-revisedfault: doc/developer libsrc/pylith/faults libsrc/pylith/feassemble libsrc/pylith/meshio libsrc/pylith/problems modulesrc/meshio pylith/meshio tests/2d/frictionslide tests/3d/cyclicfriction tests/topology unittests/libtests/meshio unittests/pytests/meshio
brad at geodynamics.org
brad at geodynamics.org
Fri Oct 14 16:58:21 PDT 2011
Author: brad
Date: 2011-10-14 16:58:21 -0700 (Fri, 14 Oct 2011)
New Revision: 19077
Added:
short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/TestDataWriterHDF5Ext.py
Modified:
short/3D/PyLith/branches/v1.6-revisedfault/doc/developer/howto_mergefromstable.txt
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/ElasticityImplicit.cc
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.cc
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.hh
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.cc
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.hh
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5.cc
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc
short/3D/PyLith/branches/v1.6-revisedfault/modulesrc/meshio/DataWriter.i
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubSubMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5Mesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubSubMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubSubMesh.py
short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg
short/3D/PyLith/branches/v1.6-revisedfault/tests/3d/cyclicfriction/pylithapp.cfg
short/3D/PyLith/branches/v1.6-revisedfault/tests/topology/test_meshmem.py
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5BCMesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtBCMesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtFaultMesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtMesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtSubMesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5FaultMesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5Mesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5SubMesh.cc
short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/testhdf5.py
Log:
Merge from stable.
Modified: short/3D/PyLith/branches/v1.6-revisedfault/doc/developer/howto_mergefromstable.txt
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/doc/developer/howto_mergefromstable.txt 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/doc/developer/howto_mergefromstable.txt 2011-10-14 23:58:21 UTC (rev 19077)
@@ -7,7 +7,7 @@
svn log | less
# Merge from stable branch.
-svn merge -r REV_FROM_LAST_MERGE:HEAD svn+ssh://svn@geodynamics.org/cig/short/3D/PyLith/branches/v1.5-stable .
+svn merge -r REV_FROM_LAST_MERGE:HEAD svn+ssh://svn@geodynamics.org/cig/short/3D/PyLith/branches/v1.6-stable .
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/faults/FaultCohesiveDyn.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -60,7 +60,7 @@
typedef ALE::ISieveVisitor::IndicesVisitor<RealSection,SieveSubMesh::order_type,PetscInt> IndicesVisitor;
// ----------------------------------------------------------------------
-const double pylith::faults::FaultCohesiveDyn::_zeroTolerance = 1.0e-12;
+const double pylith::faults::FaultCohesiveDyn::_zeroTolerance = 1.0e-10;
// ----------------------------------------------------------------------
// Default constructor.
@@ -1615,8 +1615,8 @@
int maxIters = 0;
err = KSPGetTolerances(_ksp, &rtol, &atol, &dtol, &maxIters);
CHECK_PETSC_ERROR(err);
- rtol = _zeroTolerance;
- atol = 0.001*_zeroTolerance;
+ rtol = 1.0e-2*_zeroTolerance;
+ atol = 1.0e-5*_zeroTolerance;
err = KSPSetTolerances(_ksp, rtol, atol, dtol, maxIters);
CHECK_PETSC_ERROR(err);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/ElasticityImplicit.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/ElasticityImplicit.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/ElasticityImplicit.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -350,26 +350,19 @@
// Set variables dependent on dimension of cell
totalStrain_fn_type calcTotalStrainFn;
elasticityJacobian_fn_type elasticityJacobianFn;
- elasticityJacobian_fn_type elasticityPreconFn;
if (1 == cellDim) {
elasticityJacobianFn =
&pylith::feassemble::ElasticityImplicit::_elasticityJacobian1D;
- elasticityPreconFn =
- &pylith::feassemble::ElasticityImplicit::_elasticityPrecon1D;
calcTotalStrainFn =
&pylith::feassemble::IntegratorElasticity::_calcTotalStrain1D;
} else if (2 == cellDim) {
elasticityJacobianFn =
&pylith::feassemble::ElasticityImplicit::_elasticityJacobian2D;
- elasticityPreconFn =
- &pylith::feassemble::ElasticityImplicit::_elasticityPrecon2D;
calcTotalStrainFn =
&pylith::feassemble::IntegratorElasticity::_calcTotalStrain2D;
} else if (3 == cellDim) {
elasticityJacobianFn =
&pylith::feassemble::ElasticityImplicit::_elasticityJacobian3D;
- elasticityPreconFn =
- &pylith::feassemble::ElasticityImplicit::_elasticityPrecon3D;
calcTotalStrainFn =
&pylith::feassemble::IntegratorElasticity::_calcTotalStrain3D;
} else
@@ -513,17 +506,6 @@
jacobianVisitor, *c_iter,
&_cellMatrix[0], ADD_VALUES);
CHECK_PETSC_ERROR_MSG(err, "Update to PETSc Mat failed.");
-#if 0
- // Get laplacian matrix at quadrature points for this cell
- CALL_MEMBER_FN(*this, elasticityPreconFn)(elasticConsts);
-
- // Assemble cell contribution into PETSc preconditioner matrix.
- jacobianVisitor.clear();
- PetscErrorCode err = updateOperator(preconMat, *sieveMesh->getSieve(),
- jacobianVisitor, *c_iter,
- &_cellMatrix[0], ADD_VALUES);
- CHECK_PETSC_ERROR_MSG(err, "Update to PETSc Mat failed.");
-#endif
} // for
_needNewJacobian = false;
_material->resetNeedNewJacobian();
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -778,38 +778,6 @@
} // _elasticityJacobian1D
// ----------------------------------------------------------------------
-// Integrate laplacian term in Jacobian preconditioner for 1-D cells.
-void
-pylith::feassemble::IntegratorElasticity::_elasticityPrecon1D(
- const double_array& elasticConsts)
-{ // _elasticityPrecon1D
- const int numQuadPts = _quadrature->numQuadPts();
- const int numBasis = _quadrature->numBasis();
- const int spaceDim = _quadrature->spaceDim();
- const int cellDim = _quadrature->cellDim();
- const double_array& quadWts = _quadrature->quadWts();
- const double_array& jacobianDet = _quadrature->jacobianDet();
- const double_array& basisDeriv = _quadrature->basisDeriv();
-
- assert(1 == cellDim);
- assert(quadWts.size() == numQuadPts);
-
- for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
- const double wt = quadWts[iQuad] * jacobianDet[iQuad];
- for (int iBasis=0, iQ=iQuad*numBasis; iBasis < numBasis; ++iBasis) {
- const double valI = wt*basisDeriv[iQ+iBasis];
- for (int jBasis=0; jBasis < numBasis; ++jBasis) {
- const double valIJ = valI * basisDeriv[iQ+jBasis];
- const int iBlock = iBasis*spaceDim * (numBasis*spaceDim);
- const int jBlock = jBasis*spaceDim;
- _cellMatrix[iBlock+jBlock] += valIJ;
- } // for
- } // for
- } // for
- PetscLogFlops(numQuadPts*(1+numBasis*(1+numBasis*2)));
-} // _elasticityPrecon1D
-
-// ----------------------------------------------------------------------
// Integrate elasticity term in Jacobian for 2-D cells.
void
pylith::feassemble::IntegratorElasticity::_elasticityJacobian2D(
@@ -879,48 +847,6 @@
} // _elasticityJacobian2D
// ----------------------------------------------------------------------
-// Integrate laplacian term in Jacobian preconditioner for 2-D cells.
-void
-pylith::feassemble::IntegratorElasticity::_elasticityPrecon2D(
- const double_array& elasticConsts)
-{ // _elasticityPrecon2D
- const int numQuadPts = _quadrature->numQuadPts();
- const int numBasis = _quadrature->numBasis();
- const int spaceDim = _quadrature->spaceDim();
- const int cellDim = _quadrature->cellDim();
- const double_array& quadWts = _quadrature->quadWts();
- const double_array& jacobianDet = _quadrature->jacobianDet();
- const double_array& basisDeriv = _quadrature->basisDeriv();
-
- assert(2 == cellDim);
- assert(quadWts.size() == numQuadPts);
-
- for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
- const double wt = quadWts[iQuad] * jacobianDet[iQuad];
- // Delta_ij = C_ijkl * e_kl
- // = C_ijlk * 0.5 (u_k,l + u_l,k)
- // = 0.5 * C_ijkl * (u_k,l + u_l,k)
- for (int iBasis=0, iQ=iQuad*numBasis*spaceDim;
- iBasis < numBasis;
- ++iBasis) {
- const double Ni1 = wt*basisDeriv[iQ+iBasis*spaceDim ];
- const double Ni2 = wt*basisDeriv[iQ+iBasis*spaceDim+1];
- const int iBlock = (iBasis*spaceDim ) * (numBasis*spaceDim);
- const int iBlock1 = (iBasis*spaceDim+1) * (numBasis*spaceDim);
- for (int jBasis=0; jBasis < numBasis; ++jBasis) {
- const double Nj1 = basisDeriv[iQ+jBasis*spaceDim ];
- const double Nj2 = basisDeriv[iQ+jBasis*spaceDim+1];
- const int jBlock = (jBasis*spaceDim );
- const int jBlock1 = (jBasis*spaceDim+1);
- _cellMatrix[iBlock +jBlock ] += Ni1*Nj1;
- _cellMatrix[iBlock1+jBlock1] += Ni2*Nj2;
- } // for
- } // for
- } // for
- PetscLogFlops(numQuadPts*(1+numBasis*(2+numBasis*(4))));
-} // _elasticityPrecon2D
-
-// ----------------------------------------------------------------------
// Integrate elasticity term in Jacobian for 3-D cells.
void
pylith::feassemble::IntegratorElasticity::_elasticityJacobian3D(
@@ -1051,52 +977,7 @@
} // _elasticityJacobian3D
// ----------------------------------------------------------------------
-// Integrate laplacian term in Jacobian preconditioner for 3-D cells.
void
-pylith::feassemble::IntegratorElasticity::_elasticityPrecon3D(
- const double_array& elasticConsts)
-{ // _elasticityPrecon3D
- const int numQuadPts = _quadrature->numQuadPts();
- const int numBasis = _quadrature->numBasis();
- const int spaceDim = _quadrature->spaceDim();
- const int cellDim = _quadrature->cellDim();
- const double_array& quadWts = _quadrature->quadWts();
- const double_array& jacobianDet = _quadrature->jacobianDet();
- const double_array& basisDeriv = _quadrature->basisDeriv();
-
- assert(3 == cellDim);
- assert(quadWts.size() == numQuadPts);
-
- // Compute Jacobian for consistent tangent matrix
- for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
- const double wt = quadWts[iQuad] * jacobianDet[iQuad];
- for (int iBasis=0, iQ=iQuad*numBasis*spaceDim;
- iBasis < numBasis;
- ++iBasis) {
- const double Ni1 = wt*basisDeriv[iQ+iBasis*spaceDim+0];
- const double Ni2 = wt*basisDeriv[iQ+iBasis*spaceDim+1];
- const double Ni3 = wt*basisDeriv[iQ+iBasis*spaceDim+2];
- for (int jBasis=0; jBasis < numBasis; ++jBasis) {
- const double Nj1 = basisDeriv[iQ+jBasis*spaceDim+0];
- const double Nj2 = basisDeriv[iQ+jBasis*spaceDim+1];
- const double Nj3 = basisDeriv[iQ+jBasis*spaceDim+2];
- const int iBlock = iBasis*spaceDim * (numBasis*spaceDim);
- const int iBlock1 = (iBasis*spaceDim+1) * (numBasis*spaceDim);
- const int iBlock2 = (iBasis*spaceDim+2) * (numBasis*spaceDim);
- const int jBlock = jBasis*spaceDim;
- const int jBlock1 = jBasis*spaceDim+1;
- const int jBlock2 = jBasis*spaceDim+2;
- _cellMatrix[iBlock +jBlock ] += Ni1*Nj1;
- _cellMatrix[iBlock1+jBlock1] += Ni2*Nj2;
- _cellMatrix[iBlock2+jBlock2] += Ni3*Nj3;
- } // for
- } // for
- } // for
- PetscLogFlops(numQuadPts*(1+numBasis*(3+numBasis*(6))));
-} // _elasticityPrecon3D
-
-// ----------------------------------------------------------------------
-void
pylith::feassemble::IntegratorElasticity::_calcTotalStrain1D(
double_array* strain,
const double_array& basisDeriv,
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.hh
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.hh 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/feassemble/IntegratorElasticity.hh 2011-10-14 23:58:21 UTC (rev 19077)
@@ -197,24 +197,6 @@
*/
void _elasticityJacobian3D(const double_array& elasticConsts);
- /** Integrate laplacian term in Jacobian preconditioner for 1-D cells.
- *
- * @param elasticConsts Matrix of elasticity constants at quadrature points.
- */
- void _elasticityPrecon1D(const double_array& elasticConsts);
-
- /** Integrate laplacian term in Jacobian preconditioner for 2-D cells.
- *
- * @param elasticConsts Matrix of elasticity constants at quadrature points.
- */
- void _elasticityPrecon2D(const double_array& elasticConsts);
-
- /** Integrate laplacian term in Jacobian preconditioner for 3-D cells.
- *
- * @param elasticConsts Matrix of elasticity constants at quadrature points.
- */
- void _elasticityPrecon3D(const double_array& elasticConsts);
-
/** Compute total strain in at quadrature points of a cell.
*
* @param strain Strain tensor at quadrature points.
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -22,6 +22,7 @@
// Constructor
template<typename mesh_type, typename field_type>
pylith::meshio::DataWriter<mesh_type, field_type>::DataWriter(void) :
+ _timeScale(1.0),
_numTimeSteps(0),
_context("")
{ // constructor
@@ -43,7 +44,23 @@
{ // deallocate
} // deallocate
+
// ----------------------------------------------------------------------
+// Set time scale for simulation time.
+template<typename mesh_type, typename field_type>
+void
+pylith::meshio::DataWriter<mesh_type, field_type>::timeScale(const double value)
+{ // timeScale
+ if (value <= 0.0) {
+ std::ostringstream msg;
+ msg << "Time scale for simulation time (" << value << " must be positive.";
+ throw std::runtime_error(msg.str());
+ } // if
+
+ _timeScale = value;
+} // timeScale
+
+// ----------------------------------------------------------------------
// Prepare for writing files.
template<typename mesh_type, typename field_type>
void
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.hh
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.hh 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriter.hh 2011-10-14 23:58:21 UTC (rev 19077)
@@ -58,6 +58,12 @@
virtual
void deallocate(void);
+ /** Set time scale for simulation time.
+ *
+ * @param value Time scale
+ */
+ void timeScale(const double value);
+
/** Prepare for writing files.
*
* @param mesh Finite-element mesh.
@@ -136,6 +142,7 @@
// PROTECTED MEMBERS ////////////////////////////////////////////////////
protected :
+ double _timeScale; ///< Time scale for dimensioning time in output.
int _numTimeSteps; ///< Expected number of time steps for fields.
std::string _context; ///< Context of scatters for DataWriter.
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -471,7 +471,8 @@
PetscErrorCode err = 0;
if (0 == rank) {
- err = VecSetValue(_tstamp, 0, t, INSERT_VALUES); CHECK_PETSC_ERROR(err);
+ const double tDim = t * DataWriter<mesh_type, field_type>::_timeScale;
+ err = VecSetValue(_tstamp, 0, tDim, INSERT_VALUES); CHECK_PETSC_ERROR(err);
} // if
err = VecAssemblyBegin(_tstamp); CHECK_PETSC_ERROR(err);
err = VecAssemblyEnd(_tstamp); CHECK_PETSC_ERROR(err);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -615,7 +615,8 @@
dims[0] = _tstampIndex+1;
dims[1] = 1;
dims[2] = 1;
- _h5->writeDatasetChunk("/", "time", &t, dims, dimsChunk, ndims,
+ const double tDim = t * DataWriter<mesh_type, field_type>::_timeScale;
+ _h5->writeDatasetChunk("/", "time", &tDim, dims, dimsChunk, ndims,
_tstampIndex, H5T_NATIVE_DOUBLE);
_tstampIndex++;
Modified: short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/libsrc/pylith/problems/SolverNonlinear.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -361,7 +361,7 @@
ierr = PetscViewerASCIIPrintf(snes->ls_monitor," Line search: fnorm=%18.16e, gnorm=%18.16e, ynorm=%18.16e, minlambda=%18.16e, lambda=%18.16e, initial slope=%18.16e\n",(double)fnorm,(double)*gnorm,(double)*ynorm,(double)minlambda,(double)lambda,(double)initslope);CHKERRQ(ierr);
ierr = PetscViewerASCIISubtractTab(snes->ls_monitor,((PetscObject)snes)->tablevel);CHKERRQ(ierr);
}
- *flag = PETSC_FALSE;
+ *flag = PETSC_FALSE; // DIVERGED_LINE_SEARCH
break;
}
t1 = .5*((*gnorm)*(*gnorm) - fnorm*fnorm) - lambda*initslope;
Modified: short/3D/PyLith/branches/v1.6-revisedfault/modulesrc/meshio/DataWriter.i
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/modulesrc/meshio/DataWriter.i 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/modulesrc/meshio/DataWriter.i 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,6 +50,12 @@
virtual
void deallocate(void);
+ /** Set time scale for simulation time.
+ *
+ * @param value Time scale
+ */
+ void timeScale(const double value);
+
/** Prepare for writing files.
*
* @param mesh Finite-element mesh.
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -53,12 +53,4 @@
return
- def initialize(self, normalizer):
- """
- Initialize writer.
- """
- DataWriter.initialize(self, normalizer)
- return
-
-
# End of file
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,7 +50,10 @@
"""
DataWriterHDF5Ext.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+
ModuleDataWriterHDF5Ext.filename(self, self.filename)
+ ModuleDataWriterHDF5Ext.timeScale(self, timeScale.value)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,7 +50,10 @@
"""
DataWriterHDF5Ext.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+
ModuleDataWriterHDF5Ext.filename(self, self.filename)
+ ModuleDataWriterHDF5Ext.timeScale(self, timeScale.value)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubSubMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubSubMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5ExtSubSubMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,7 +50,10 @@
"""
DataWriterHDF5Ext.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+
ModuleDataWriterHDF5Ext.filename(self, self.filename)
+ ModuleDataWriterHDF5Ext.timeScale(self, timeScale.value)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5Mesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5Mesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5Mesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -49,8 +49,11 @@
Initialize writer.
"""
DataWriterHDF5.initialize(self, normalizer)
+
+ timeScale = normalizer.timeScale()
ModuleDataWriterHDF5.filename(self, self.filename)
+ ModuleDataWriterHDF5.timeScale(self, timeScale.value)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,7 +50,10 @@
"""
DataWriterHDF5.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+
ModuleDataWriterHDF5.filename(self, self.filename)
+ ModuleDataWriterHDF5.timeScale(self, timeScale.value)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubSubMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubSubMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterHDF5SubSubMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,7 +50,10 @@
"""
DataWriterHDF5.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+
ModuleDataWriterHDF5.filename(self, self.filename)
+ ModuleDataWriterHDF5.timeScale(self, timeScale.value)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTK.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -69,19 +69,6 @@
return
- def initialize(self, normalizer):
- """
- Initialize writer.
- """
- DataWriter.initialize(self, normalizer)
-
- # Nondimensionalize
- timeScale = normalizer.timeScale()
- self.timeConstantN = normalizer.nondimensionalize(self.timeConstant,
- timeScale)
- return
-
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,9 +50,14 @@
"""
DataWriterVTK.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+ timeConstantN = normalizer.nondimensionalize(self.timeConstant,
+ timeScale)
+
ModuleDataWriterVTK.filename(self, self.filename)
+ ModuleDataWriterVTK.timeScale(self, timeScale.value)
ModuleDataWriterVTK.timeFormat(self, self.timeFormat)
- ModuleDataWriterVTK.timeConstant(self, self.timeConstantN)
+ ModuleDataWriterVTK.timeConstant(self, timeConstantN)
ModuleDataWriterVTK.precision(self, self.precision)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,9 +50,14 @@
"""
DataWriterVTK.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+ timeConstantN = normalizer.nondimensionalize(self.timeConstant,
+ timeScale)
+
ModuleDataWriterVTK.filename(self, self.filename)
+ ModuleDataWriterVTK.timeScale(self, timeScale.value)
ModuleDataWriterVTK.timeFormat(self, self.timeFormat)
- ModuleDataWriterVTK.timeConstant(self, self.timeConstantN)
+ ModuleDataWriterVTK.timeConstant(self, timeConstantN)
ModuleDataWriterVTK.precision(self, self.precision)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubSubMesh.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubSubMesh.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/pylith/meshio/DataWriterVTKSubSubMesh.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -50,9 +50,14 @@
"""
DataWriterVTK.initialize(self, normalizer)
+ timeScale = normalizer.timeScale()
+ timeConstantN = normalizer.nondimensionalize(self.timeConstant,
+ timeScale)
+
ModuleDataWriterVTK.filename(self, self.filename)
+ ModuleDataWriterVTK.timeScale(self, timeScale.value)
ModuleDataWriterVTK.timeFormat(self, self.timeFormat)
- ModuleDataWriterVTK.timeConstant(self, self.timeConstantN)
+ ModuleDataWriterVTK.timeConstant(self, timeConstantN)
ModuleDataWriterVTK.precision(self, self.precision)
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/tests/2d/frictionslide/pylithapp.cfg 2011-10-14 23:58:21 UTC (rev 19077)
@@ -96,8 +96,8 @@
sub_pc_factor_shift_type = nonzero
# KSP
-ksp_rtol = 1.0e-15
-ksp_atol = 1.0e-20
+ksp_rtol = 1.0e-8
+ksp_atol = 1.0e-12
ksp_max_it = 500
ksp_gmres_restart = 20
Modified: short/3D/PyLith/branches/v1.6-revisedfault/tests/3d/cyclicfriction/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/tests/3d/cyclicfriction/pylithapp.cfg 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/tests/3d/cyclicfriction/pylithapp.cfg 2011-10-14 23:58:21 UTC (rev 19077)
@@ -33,7 +33,7 @@
# problem
# ----------------------------------------------------------------------
[pylithapp.timedependent.formulation.time_step]
-total_time = 80.0*hour ; total time of simulation
+total_time = 60.0*hour ; total time of simulation
dt = 1.0*hour
[pylithapp.timedependent.normalizer]
@@ -95,21 +95,6 @@
th_change.filename = cycle.timedb
-# Dirichlet BC on +y face
-[pylithapp.timedependent.bc.y_pos]
-bc_dof = [1]
-label = face_ypos_nofault
-db_initial.label = Dirichlet BC on +y
-
-
-# Dirichlet BC on -y face
-[pylithapp.timedependent.bc.y_neg]
-bc_dof = [1]
-label = face_yneg_nofault
-
-db_initial.label = Dirichlet BC on -y
-
-
# Dirichlet BC on z face in z-direction
[pylithapp.timedependent.bc.z_neg]
bc_dof = [2]
@@ -183,8 +168,8 @@
sub_pc_factor_shift_type = nonzero
# Convergence parameters.
-ksp_rtol = 1.0e-10
-ksp_atol = 1.0e-12
+ksp_rtol = 1.0e-8
+ksp_atol = 1.0e-10
ksp_max_it = 200
ksp_gmres_restart = 70
@@ -195,13 +180,13 @@
# Nonlinear solver monitoring options.
snes_rtol = 1.0e-8
-snes_atol = 1.0e-10
+snes_atol = 1.0e-8
snes_max_it = 200
snes_monitor = true
+snes_ls_monitor = true
#snes_view = true
snes_converged_reason = true
#snes_monitor_solution_update = true
#info =
-
log_summary = true
Modified: short/3D/PyLith/branches/v1.6-revisedfault/tests/topology/test_meshmem.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/tests/topology/test_meshmem.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/tests/topology/test_meshmem.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -134,7 +134,7 @@
mesh = dmesh
-
+
# Refine mesh (if necessary)
from pylith.topology.RefineUniform import RefineUniform
refiner = RefineUniform()
@@ -157,6 +157,7 @@
def _showStatus(self, stage):
+ import sys
from pylith.utils.profiling import resourceUsageString
from pylith.mpi.Communicator import petsc_comm_world
comm = petsc_comm_world()
@@ -171,6 +172,7 @@
print "\nPROCESSOR %d" % comm.rank
print "\nStatus from ps: %s\n" % resourceUsageString()
self.logger.show()
+ sys.stdout.flush()
comm.barrier()
return
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5BCMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5BCMesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5BCMesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -106,9 +106,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
@@ -144,9 +146,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtBCMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtBCMesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtBCMesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -104,9 +104,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
@@ -142,9 +144,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtFaultMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtFaultMesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtFaultMesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -107,9 +107,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_faultMesh, numTimeSteps);
@@ -145,9 +147,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_faultMesh, numTimeSteps);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtMesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtMesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -113,9 +113,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_mesh, numTimeSteps);
@@ -151,9 +153,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_mesh, numTimeSteps);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtSubMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtSubMesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5ExtSubMesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -102,9 +102,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
@@ -140,9 +142,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5FaultMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5FaultMesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5FaultMesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -109,9 +109,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_faultMesh, numTimeSteps);
@@ -147,9 +149,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_faultMesh, numTimeSteps);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5Mesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5Mesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5Mesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -113,9 +113,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_mesh, numTimeSteps);
@@ -151,9 +153,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_mesh, numTimeSteps);
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5SubMesh.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5SubMesh.cc 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/libtests/meshio/TestDataWriterHDF5SubMesh.cc 2011-10-14 23:58:21 UTC (rev 19077)
@@ -104,9 +104,11 @@
writer.filename(_data->vertexFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numVertexFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
@@ -142,9 +144,11 @@
writer.filename(_data->cellFilename);
+ const double timeScale = 4.0;
+ writer.timeScale(timeScale);
+ const double t = _data->time / timeScale;
+
const int nfields = _data->numCellFields;
-
- const double t = _data->time;
const int numTimeSteps = 1;
if (0 == _data->cellsLabel) {
writer.open(*_submesh, numTimeSteps);
Copied: short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/TestDataWriterHDF5Ext.py (from rev 19075, short/3D/PyLith/branches/v1.6-stable/unittests/pytests/meshio/TestDataWriterHDF5Ext.py)
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/TestDataWriterHDF5Ext.py (rev 0)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/TestDataWriterHDF5Ext.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -0,0 +1,140 @@
+#!/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-2011 University of California, Davis
+#
+# See COPYING for license information.
+#
+# ======================================================================
+#
+
+## @file unittests/pytests/meshio/TestDataWriterHDF5Ext.py
+
+## @brief Unit testing of Python DataWriterHDF5Ext object.
+
+import unittest
+
+from pylith.meshio.DataWriterHDF5ExtMesh import DataWriterHDF5ExtMesh
+from pylith.meshio.DataWriterHDF5ExtSubMesh import DataWriterHDF5ExtSubMesh
+from pylith.meshio.DataWriterHDF5ExtSubSubMesh import DataWriterHDF5ExtSubSubMesh
+
+# ----------------------------------------------------------------------
+class TestDataWriterHDF5ExtMesh(unittest.TestCase):
+ """
+ Unit testing of Python DataWriterHDF5ExtMesh object.
+ """
+
+ def test_constructor(self):
+ """
+ Test constructor.
+ """
+ filter = DataWriterHDF5ExtMesh()
+ filter._configure()
+ return
+
+
+ def test_initialize(self):
+ """
+ Test constructor.
+ """
+ filter = DataWriterHDF5ExtMesh()
+ filter._configure()
+
+ from spatialdata.units.Nondimensional import Nondimensional
+ normalizer = Nondimensional()
+ filter.initialize(normalizer)
+ return
+
+
+ def test_factory(self):
+ """
+ Test factory method.
+ """
+ from pylith.meshio.DataWriterHDF5ExtMesh import data_writer
+ filter = data_writer()
+ return
+
+
+# ----------------------------------------------------------------------
+class TestDataWriterHDF5ExtSubMesh(unittest.TestCase):
+ """
+ Unit testing of Python DataWriterHDF5Ext object.
+ """
+
+ def test_constructor(self):
+ """
+ Test constructor.
+ """
+ filter = DataWriterHDF5ExtSubMesh()
+ filter._configure()
+ return
+
+
+ def test_initialize(self):
+ """
+ Test constructor.
+ """
+ filter = DataWriterHDF5ExtSubMesh()
+ filter._configure()
+
+ from spatialdata.units.Nondimensional import Nondimensional
+ normalizer = Nondimensional()
+ filter.initialize(normalizer)
+ return
+
+
+ def test_factory(self):
+ """
+ Test factory method.
+ """
+ from pylith.meshio.DataWriterHDF5ExtSubMesh import data_writer
+ filter = data_writer()
+ return
+
+
+# ----------------------------------------------------------------------
+class TestDataWriterHDF5ExtSubSubMesh(unittest.TestCase):
+ """
+ Unit testing of Python DataWriterHDF5Ext object.
+ """
+
+ def test_constructor(self):
+ """
+ Test constructor.
+ """
+ filter = DataWriterHDF5ExtSubSubMesh()
+ filter._configure()
+ return
+
+
+ def test_initialize(self):
+ """
+ Test constructor.
+ """
+ filter = DataWriterHDF5ExtSubSubMesh()
+ filter._configure()
+
+ from spatialdata.units.Nondimensional import Nondimensional
+ normalizer = Nondimensional()
+ filter.initialize(normalizer)
+ return
+
+
+ def test_factory(self):
+ """
+ Test factory method.
+ """
+ from pylith.meshio.DataWriterHDF5ExtSubSubMesh import data_writer
+ filter = data_writer()
+ return
+
+
+# End of file
Modified: short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/testhdf5.py
===================================================================
--- short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/testhdf5.py 2011-10-14 23:57:46 UTC (rev 19076)
+++ short/3D/PyLith/branches/v1.6-revisedfault/unittests/pytests/meshio/testhdf5.py 2011-10-14 23:58:21 UTC (rev 19077)
@@ -69,6 +69,15 @@
from TestDataWriterHDF5 import TestDataWriterHDF5SubSubMesh
suite.addTest(unittest.makeSuite(TestDataWriterHDF5SubSubMesh))
+ from TestDataWriterHDF5Ext import TestDataWriterHDF5ExtMesh
+ suite.addTest(unittest.makeSuite(TestDataWriterHDF5ExtMesh))
+
+ from TestDataWriterHDF5Ext import TestDataWriterHDF5ExtSubMesh
+ suite.addTest(unittest.makeSuite(TestDataWriterHDF5ExtSubMesh))
+
+ from TestDataWriterHDF5Ext import TestDataWriterHDF5ExtSubSubMesh
+ suite.addTest(unittest.makeSuite(TestDataWriterHDF5ExtSubSubMesh))
+
from TestXdmf import TestXdmf
suite.addTest(unittest.makeSuite(TestXdmf))
More information about the CIG-COMMITS
mailing list