[cig-commits] r19678 - in short/3D/PyLith/branches/pylith-scecdynrup: . examples/3d/hex8 examples/3d/tet4 libsrc/pylith/faults libsrc/pylith/feassemble libsrc/pylith/friction libsrc/pylith/materials libsrc/pylith/meshio libsrc/pylith/problems libsrc/pylith/topology libsrc/pylith/utils modulesrc/faults modulesrc/friction modulesrc/topology modulesrc/utils pylith/bc pylith/faults pylith/meshio pylith/perf pylith/topology pylith/utils tests/2d tests/2d/frictionslide tests/3d/cyclicfriction tests/topology unittests/libtests/faults/data unittests/libtests/friction/data unittests/libtests/materials/data unittests/libtests/meshio unittests/libtests/meshio/data unittests/libtests/topology unittests/pytests/bc unittests/pytests/faults unittests/pytests/feassemble unittests/pytests/materials unittests/pytests/topology unittests/pytests/utils
brad at geodynamics.org
brad at geodynamics.org
Fri Feb 24 13:37:43 PST 2012
Author: brad
Date: 2012-02-24 13:37:42 -0800 (Fri, 24 Feb 2012)
New Revision: 19678
Added:
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/constdefs.i
short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity/
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_vertex_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_vertex_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_vertex_t10.vtk
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/TestConstants.py
Removed:
short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/test.cfg
Modified:
short/3D/PyLith/branches/pylith-scecdynrup/TODO
short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/pylithapp.cfg
short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step14.cfg
short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/pylithapp.cfg
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/CohesiveTopology.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.icc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveLagrange.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/Integrator.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/IntegratorElasticity.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/FrictionModel.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/RateStateAgeing.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakening.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakeningTime.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/StaticFriction.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/TimeWeakening.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticIsotropic3D.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticMaterial.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStrain.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStress.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStrain1D.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStress1D.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellQpQsIsotropic3D.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/Material.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/MaxwellPlaneStrain.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/PowerLaw3D.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/CellFilterAvg.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/MeshBuilder.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/VertexFilterVecNorm.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/problems/SolverNonlinear.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/Field.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/MeshOrder.cc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.hh
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.icc
short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/utils/constdefs.h
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/Fault.i
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/FaultCohesive.i
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/RateStateAgeing.i
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/SlipWeakening.i
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/topology/SubMesh.i
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/utils.i
short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/AbsorbingDampers.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBC.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBoundary.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/Neumann.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/PointForce.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/PointsList.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Fault.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/MemoryLogger.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Mesh.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/Mesh.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/MeshGenerator.py
short/3D/PyLith/branches/pylith-scecdynrup/pylith/utils/profiling.py
short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/plot_friction.py
short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/pylithapp.cfg
short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/cyclicfriction/pylithapp.cfg
short/3D/PyLith/branches/pylith-scecdynrup/tests/topology/test_meshmem.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/StaticFrictionData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDep.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDepData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPragerPlaneStrainTimeDepData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticIsotropic3DData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticMaterialApp.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStrainData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStressData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStrain1DData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStress1DData.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.hh
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataMeshTri3.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/topology/TestRefineUniform.cc
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestAbsorbingDampers.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestNeumann.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveDyn.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveKin.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicit.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicit.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticIsotropic3D.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStrain.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStress.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStrain1D.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStress1D.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/topology/TestRefineUniform.py
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/Makefile.am
short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/testutils.py
Log:
Merge from trunk.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/TODO
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/TODO 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/TODO 2012-02-24 21:37:42 UTC (rev 19678)
@@ -1,12 +1,26 @@
======================================================================
-CURRENT ISSUES/PRIORITIES (1.7.0)
+CURRENT ISSUES/PRIORITIES
======================================================================
+* --BUGS--
+
+ DruckerPragerPlaneStrain, DruckerPrager3D
+ High-frequency oscillation in dynamic simulations
+ Extra plastic strain in quasi-static simulations
+ Charles' test (which one?) shows same behavior in 2-D and 3-D, so error is
+ in both
+
+
* Manual
- Order of tensor components for Xdmf files
- Drucker Prager fit to yield surface
- Slip-weakening healing parameter
+ - Green's functions
+ + Interpolation
+ * Approximate for quad4 and hex8 cells
+ (assume Jacobian is uniform throughout cell =? rhomboid)
+ (should be much better than nearest)
* configure
@@ -33,54 +47,42 @@
* GenMaxwellQpQs [BRAD]
- 2-D and 3-D versions
- Need to redo Maxwell time calculation. Use ratio.
- Create benchmark for test (compare against fk)
+* Cleanup
+ Add elasticPrestep() to Formulation (called from Problem)
+ Remove solnIncr, keep setField()
+
+======================================================================
+1.8.0
+======================================================================
+
* GPU utilization
+ Finite-element integrations
+
Modeled on snes/examples/tutorials/ex52.
- Refactor integration routine so that it uses batches rather than individual cells.
+ Refactor integration routine so that it uses batches rather than
+ individual cells.
+ Implicit elasticity finite-element integration
+ Explicit elasticity finite-element integration
* Reimplement parameters to use PackedFields. [BRAD]
+ Coordinate this with Matt's new Section stuff.
+
Fields
FieldsNew -> PackedFields
SolutionFields [do this in multifields]
Use PackedFields for acc, vel, disp(t+dt), disp(t), etc?
Use Field for dispIncr(t->t+dt), residual(t)
-* Cleanup
-
- Add elasticPrestep() to Formulation (called from Problem)
- Remove solnIncr, keep setField()
-
-* Scalable distribution [MATT]
-
- + It appears that topology adjustment is not currently limiting the runs
- + Need a more memory scalable Distribution
- + Consider simple distribution, followed by cleanup
- + I think the Overlap structure is probably taking up all the memory
- + send/recvMeshOverlap is only used in completeConesV() to call SimpleCopy::copy()
- + Can we use a lighter-weight structure to sit in copy()?
-
- + Need ribbon around fault in order to develop algorithm
-
-======================================================================
-CURRENT ISSUES/PRIORITIES (1.8.0)
-======================================================================
-
-* GPU finite-element integrations (possible promotion to 1.7)
-
* Higher order
* Coupling
-* Field split. DELAY??
+* Field split.
Add flag to material [default is false] for creating null vector
When setting up solver, create null vector, and pass it to KSP
@@ -93,8 +95,17 @@
+* Scalable distribution [MATT]
+ + It appears that topology adjustment is not currently limiting the runs
+ + Need a more memory scalable Distribution
+ + Consider simple distribution, followed by cleanup
+ + I think the Overlap structure is probably taking up all the memory
+ + send/recvMeshOverlap is only used in completeConesV() to call SimpleCopy::copy()
+ + Can we use a lighter-weight structure to sit in copy()?
+ + Need ribbon around fault in order to develop algorithm
+
----------------------------------------
MISCELLANEOUS
----------------------------------------
@@ -106,18 +117,6 @@
are lumped together within the same Sieve routine, we cannot
separate them.
- (2) When we deallocate the distributed mesh, we do not deallocate all of
- the memory. This suggests some object is leaking memory.
-
- (3) The memory used by the distributed mesh is much greater than
- that predicted by the memory model. MATT- Could this be related to
- each processor having lots of gaps in the range of cells and
- vertices it has?
-
- - Can Fusion be leaking memory?
-
- - How do we separate parallel stratification?
-
IntSections - Matt improved distribution to use allow IntSections
over vertices or cells rather than vertices + cells. This cuts
differences down to 75%.
@@ -131,7 +130,7 @@
* Paper
General paper - focus on fault implementation
- - BSSA, GGG
+ - JGR, GGG
geometry processing (adjusting topology)
discretization (cohesive cells)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/pylithapp.cfg 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/pylithapp.cfg 2012-02-24 21:37:42 UTC (rev 19678)
@@ -74,7 +74,6 @@
# PETSc
# ----------------------------------------------------------------------
# Set the solver options.
-
[pylithapp.petsc]
# Preconditioner settings.
@@ -89,7 +88,7 @@
# Linear solver monitoring options.
ksp_monitor = true
-ksp_view = true
+#ksp_view = true
ksp_converged_reason = true
# Nonlinear solver monitoring options.
@@ -98,7 +97,7 @@
snes_max_it = 100
snes_monitor = true
snes_ls_monitor = true
-snes_view = true
+#snes_view = true
snes_converged_reason = true
# PETSc summary -- useful for performance information.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step14.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step14.cfg 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/step14.cfg 2012-02-24 21:37:42 UTC (rev 19678)
@@ -8,10 +8,13 @@
#
# This problem demonstrates the use of rate-and-state friction for a
# quasi-static problem, using the aging law for evolution of the state
-# variable.
-# The problem is similar to example 13, except that a different friction
-# model is used. The model is run for 200 years. Slip begins to occur
-# at about 45 years, and continues in each step after that.
+# variable. The rate and state friction parameters result in
+# stick-slip behavior.
+#
+# The problem is similar to example 13, except that a different
+# friction model is used. The model is run for 300 years with a time
+# step of 2.0 years. A smaller time step would better resolve the slip
+# time histories but increases the runtime.
# ----------------------------------------------------------------------
# RUNNING THE SIMULATON
@@ -49,11 +52,11 @@
# solver.
solver = pylith.problems.SolverNonlinear
-# Change the total simulation time to 200 years, and use a constant time
-# step size of 5 years.
+# Change the total simulation time to 300 years, and use a constant time
+# step size of 2 years.
[pylithapp.timedependent.implicit.time_step]
-total_time = 200.0*year
-dt = 5.0*year
+total_time = 300.0*year
+dt = 2.0*year
# ----------------------------------------------------------------------
# boundary conditions
@@ -85,7 +88,7 @@
db_initial = spatialdata.spatialdb.UniformDB
db_initial.label = Dirichlet BC on +x
db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [-1.0*m,0.0*m]
+db_initial.data = [-2.0*m,0.0*m]
db_rate = spatialdata.spatialdb.UniformDB
db_rate.label = Dirichlet rate BC on +x
@@ -118,11 +121,12 @@
[pylithapp.timedependent.interfaces.fault]
# The label corresponds to the name of the nodeset in CUBIT.
label = fault
-zero_tolerance = 1.0e-12
+zero_tolerance = 1.0e-11
# Use the rate-and-state aging friction model.
friction = pylith.friction.RateStateAgeing
friction.label = Rate and state
+friction.min_slip_rate = 1.0e-9
# We must define the quadrature information for fault cells.
# The fault cells are 2D (surface).
@@ -131,22 +135,23 @@
# Set rate-and-state parameters using a uniform DB. Set the parameters as
# follows:
-# reference coefficient of friction: 0.6
-# reference slip rate: 1.0e-06 m/s
-# slip-weakening parameter: 0.037 m
-# a: 0.0125
-# b: 0.0172
+# reference coefficient of friction: 0.4
+# reference slip rate: 1.0e-11 m/s
+# characteristic slip distance: 0.05 m
+# a: 0.002
+# b: 0.08
# cohesion: 0 Pa
friction.db_properties = spatialdata.spatialdb.UniformDB
friction.db_properties.label = Rate Stete Ageing
friction.db_properties.values = [reference-friction-coefficient,reference-slip-rate,characteristic-slip-distance,constitutive-parameter-a,constitutive-parameter-b,cohesion]
-friction.db_properties.data = [0.6,1.0e-6*m/s,0.0370*m,0.0125,0.0172,0.0*Pa]
+friction.db_properties.data = [0.4,2.0e-11*m/s,0.05*m,0.002,0.08,0.0*Pa]
# Set spatial database for the initial value of the state variable.
friction.db_initial_state = spatialdata.spatialdb.UniformDB
friction.db_initial_state.label = Rate State Ageing State
friction.db_initial_state.values = [state-variable]
-friction.db_initial_state.data = [92.7*s]
+# theta_ss = characteristic_slip_dist / reference_slip_rate
+friction.db_initial_state.data = [2.5e+9*s]
# ----------------------------------------------------------------------
# PETSc settings
@@ -159,7 +164,7 @@
# fault constitutive model.
friction_pc_type = asm
friction_sub_pc_factor_shift_type = nonzero
-friction_ksp_max_it = 25
+friction_ksp_max_it = 50
friction_ksp_gmres_restart = 30
# Uncomment to view details of friction sensitivity solve.
#friction_ksp_monitor = true
@@ -167,13 +172,13 @@
friction_ksp_converged_reason = true
# Reduce convergence tolerances.
-ksp_rtol = 1.0e-13
-ksp_atol = 1.0e-15
+ksp_rtol = 1.0e-16
+ksp_atol = 1.0e-12
-snes_rtol = 1.0e-12
-snes_atol = 1.0e-14
+snes_rtol = 1.0e-14
+snes_atol = 1.0e-10
+snes_max_it = 200
-
# ----------------------------------------------------------------------
# output
# ----------------------------------------------------------------------
Deleted: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/test.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/test.cfg 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/hex8/test.cfg 2012-02-24 21:37:42 UTC (rev 19678)
@@ -1,215 +0,0 @@
-# -*- Python -*-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# PROBLEM DESCRIPTION
-# ----------------------------------------------------------------------
-
-#
-# This problem demonstrates the use of rate-and-state friction for a
-# quasi-static problem, using the aging law for evolution of the state
-# variable.
-#
-# The problem is similar to example 13, except that a different
-# friction model is used. The axial deformation and time step have
-# also been changed. The model is run for 200 years.
-
-# ----------------------------------------------------------------------
-# RUNNING THE SIMULATON
-# ----------------------------------------------------------------------
-
-# This is not a self-contained simulation configuration file. This
-# file only specifies parameters specific to tutorial step14.
-# The general parameters are specificed in the pylithapp.cfg
-# file which PyLith reads by default.
-#
-# To run the simulation:
-# pylith step14.cfg
-#
-# Output will be directed to the 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]
-
-# Set interfaces to an array of 1 fault: 'fault'.
-interfaces = [fault]
-
-[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 (boundary of the domain).
-output.subdomain = pylith.meshio.OutputSolnSubset
-
-# Fault friction is a nonlinear problem so we need to use the nonlinear
-# solver.
-solver = pylith.problems.SolverNonlinear
-
-# Change the total simulation time to 200 years, and use a constant time
-# step size of 5 years.
-[pylithapp.timedependent.implicit.time_step]
-total_time = 200.0*year
-dt = 0.5*year
-
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-# Set the parameters for boundary conditions applied on the
-# +x, -x, and -z faces of the box.
-#
-# On the -x and +x faces, we fix the x degrees of freedom and apply
-# velocities in the y-direction. We fix the z degree of freedom on the
-# bottom (-z) face.
-#
-# We use a UniformDB to apply the displacements and velocities, while
-# retaining the default ZeroDispDB for zero x-displacements on the -x
-# face and and zero z-displacements on -z.
-#
-# Note that since the fault cuts through the base of the model (z_neg),
-# we can only constrain the portion of the bottom boundary that does not
-# include the fault. A nodeset named 'face_zneg_nofault' has been defined
-# in Cubit for this purpose.
-#
-
-# The label corresponds to the name of the nodeset in CUBIT.
-
-# +x face -- Dirichlet
-[pylithapp.timedependent.bc.x_pos]
-bc_dof = [0,1]
-label = face_xpos
-
-db_initial = spatialdata.spatialdb.UniformDB
-db_initial.label = Dirichlet BC on +x
-db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [-2.0*m,0.0*m]
-
-db_rate = spatialdata.spatialdb.UniformDB
-db_rate.label = Dirichlet rate BC on +x
-db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
-db_rate.data = [0.0*cm/year,1.0*cm/year,0.0*year]
-
-# -x face
-[pylithapp.timedependent.bc.x_neg]
-bc_dof = [0, 1]
-label = face_xneg
-db_initial.label = Dirichlet BC on -x
-db_rate = spatialdata.spatialdb.UniformDB
-db_rate.label = Dirichlet rate BC on -x
-db_rate.values = [displacement-rate-x,displacement-rate-y,rate-start-time]
-db_rate.data = [0.0*cm/year,-1.0*cm/year,0.0*year]
-
-# -z face
-[pylithapp.timedependent.bc.z_neg]
-bc_dof = [2]
-label = face_zneg_nofault
-db_initial.label = Dirichlet BC on -z
-
-# ----------------------------------------------------------------------
-# faults
-# ----------------------------------------------------------------------
-[pylithapp.timedependent.interfaces]
-# Change fault to dynamic fault interface.
-fault = pylith.faults.FaultCohesiveDyn
-
-[pylithapp.timedependent.interfaces.fault]
-# The label corresponds to the name of the nodeset in CUBIT.
-label = fault
-zero_tolerance = 1.0e-15
-
-# Use the rate-and-state aging friction model.
-friction = pylith.friction.RateStateAgeing
-friction.label = Rate and state
-friction.min_slip_rate = 1.0e-10
-
-# We must define the quadrature information for fault cells.
-# The fault cells are 2D (surface).
-quadrature.cell = pylith.feassemble.FIATLagrange
-quadrature.cell.dimension = 2
-
-# Set rate-and-state parameters using a uniform DB. Set the parameters as
-# follows:
-# reference coefficient of friction: 0.4
-# reference slip rate: 1.0e-9 m/s
-# characteristic slip distance: 0.05 m
-# a: 0.01
-# b: 0.08
-# cohesion: 0 Pa
-friction.db_properties = spatialdata.spatialdb.UniformDB
-friction.db_properties.label = Rate Stete Ageing
-friction.db_properties.values = [reference-friction-coefficient,reference-slip-rate,characteristic-slip-distance,constitutive-parameter-a,constitutive-parameter-b,cohesion]
-friction.db_properties.data = [0.4, 1.0e-9*m/s, 0.05*m, 0.01, 0.08, 0.0*Pa]
-
-# Set spatial database for the initial value of the state variable.
-friction.db_initial_state = spatialdata.spatialdb.UniformDB
-friction.db_initial_state.label = Rate State Ageing State
-friction.db_initial_state.values = [state-variable]
-# theta_ss = characteristic_slip_dist / reference_slip_rate
-friction.db_initial_state.data = [5.0e+07*s]
-
-# ----------------------------------------------------------------------
-# PETSc settings
-# ----------------------------------------------------------------------
-# NOTE: There are additional settings specific to fault friction.
-[pylithapp.petsc]
-
-# Friction sensitivity solve used to compute the increment in slip
-# associated with changes in the Lagrange multiplier imposed by the
-# fault constitutive model.
-friction_pc_type = asm
-friction_sub_pc_factor_shift_type = nonzero
-friction_ksp_max_it = 25
-friction_ksp_gmres_restart = 30
-# Uncomment to view details of friction sensitivity solve.
-#friction_ksp_monitor = true
-#friction_ksp_view = true
-friction_ksp_converged_reason = true
-
-# Reduce convergence tolerances.
-ksp_rtol = 1.0e-18
-ksp_atol = 1.0e-18
-
-snes_rtol = 1.0e-16
-snes_atol = 1.0e-16
-
-snes_max_it = 200
-
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-[pylithapp.problem.formulation.output.domain]
-output_freq = time_step
-time_step = 10.0*year
-writer = pylith.meshio.DataWriterHDF5Mesh
-writer.filename = output/test.h5
-
-[pylithapp.problem.formulation.output.subdomain]
-label = face_zpos
-writer = pylith.meshio.DataWriterHDF5SubMesh
-writer.filename = output/test-groundsurf.h5
-
-[pylithapp.problem.interfaces.fault.output]
-writer = pylith.meshio.DataWriterHDF5SubSubMesh
-writer.filename = output/test-fault.h5
-vertex_data_fields = [slip, slip_rate, traction, state_variable]
-
-[pylithapp.timedependent.materials.upper_crust.output]
-cell_filter = pylith.meshio.CellFilterAvgMesh
-output_freq = time_step
-time_step = 20.0*year
-writer = pylith.meshio.DataWriterHDF5Mesh
-writer.filename = output/test-upper_crust.h5
-
-# Give basename for VTK output of lower_crust state variables.
-[pylithapp.timedependent.materials.lower_crust.output]
-# Average values over quadrature points.
-cell_filter = pylith.meshio.CellFilterAvgMesh
-output_freq = time_step
-time_step = 20.0*year
-writer = pylith.meshio.DataWriterHDF5Mesh
-writer.filename = output/test-lower_crust.h5
Modified: short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/pylithapp.cfg 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/examples/3d/tet4/pylithapp.cfg 2012-02-24 21:37:42 UTC (rev 19678)
@@ -18,6 +18,11 @@
meshimporter = 1
#quadrature3d = 1
+[pylithapp.journal.debug]
+pylithapp = 1
+problem = 1
+implicit = 1
+
# ----------------------------------------------------------------------
# mesh_generator
# ----------------------------------------------------------------------
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/CohesiveTopology.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/CohesiveTopology.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/CohesiveTopology.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -51,7 +51,7 @@
// Memory logging
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("FaultCreation");
+ logger.stagePush("SerialFaultCreation");
faultMesh->coordsys(mesh);
@@ -98,10 +98,10 @@
fault->setSieve(faultSieve);
logger.stagePop();
- logger.stagePush("FaultStratification");
+ logger.stagePush("SerialFaultStratification");
fault->stratify();
logger.stagePop();
- logger.stagePush("FaultCreation");
+ logger.stagePush("SerialFaultCreation");
if (debug)
fault->view("Fault mesh");
@@ -143,7 +143,7 @@
// Memory logging
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("FaultCreation");
+ logger.stagePush("SerialFaultCreation");
const ALE::Obj<SieveMesh>& sieveMesh = mesh->sieveMesh();
assert(!sieveMesh.isNull());
@@ -212,7 +212,7 @@
<< vertexRenumber[*v_iter] << std::endl;
logger.stagePop();
- logger.stagePush("FaultStratification");
+ logger.stagePush("SerialFaultStratification");
// Add shadow and constraint vertices (if they exist) to group
// associated with fault
groupField->addPoint(firstFaultVertex, 1);
@@ -232,7 +232,7 @@
++firstLagrangeVertex;
} // if
logger.stagePop();
- logger.stagePush("FaultCreation");
+ logger.stagePush("SerialFaultCreation");
// Add shadow vertices to other groups, don't add constraint
// vertices (if they exist) because we don't want BC, etc to act
@@ -247,12 +247,16 @@
group->addPoint(firstFaultVertex, 1);
} // for
} // for
+ logger.stagePop();
+ logger.stagePush("SerialFaultCreation");
const std::set<std::string>::const_iterator namesEnd = groupNames->end();
for(std::set<std::string>::const_iterator name = groupNames->begin();
name != namesEnd;
++name) {
sieveMesh->reallocate(sieveMesh->getIntSection(*name));
} // for
+ logger.stagePop();
+ logger.stagePush("SerialFault");
// Split the mesh along the fault sieve and create cohesive elements
const ALE::Obj<SieveSubMesh::label_sequence>& faces =
@@ -410,14 +414,14 @@
// TODO: Need to reform the material label when sieve is reallocated
sieveMesh->setValue(material, firstFaultCell, materialId);
logger.stagePop();
- logger.stagePush("FaultStratification");
+ logger.stagePush("SerialFaultStratification");
#if defined(FAST_STRATIFY)
// OPTIMIZATION
sieveMesh->setHeight(firstFaultCell, 0);
sieveMesh->setDepth(firstFaultCell, 1);
#endif
logger.stagePop();
- logger.stagePush("FaultCreation");
+ logger.stagePush("SerialFaultCreation");
sV2.clear();
cV2.clear();
} // for
@@ -606,10 +610,10 @@
delete [] indices;
#if !defined(FAST_STRATIFY)
logger.stagePop();
- logger.stagePush("FaultStratification");
+ logger.stagePush("SerialFaultStratification");
sieveMesh->stratify();
logger.stagePop();
- logger.stagePush("FaultCreation");
+ logger.stagePush("SerialFaultCreation");
#endif
const std::string labelName("censored depth");
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -54,4 +54,44 @@
return *_faultMesh;
} // faultMesh
+
+// ----------------------------------------------------------------------
+// Get dimension of mesh.
+int
+pylith::faults::Fault::dimension(void) const
+{ // dimension
+ return (_faultMesh) ? _faultMesh->dimension() : 0;
+} // dimension
+
+
+// ----------------------------------------------------------------------
+// Get representative cone size for mesh.
+int
+pylith::faults::Fault::coneSize(void) const
+{ // coneSize
+
+ return (_faultMesh && numCells() > 0) ?
+ _faultMesh->sieveMesh()->getSieve()->getConeSize(*_faultMesh->sieveMesh()->heightStratum(1)->begin()) : 0;
+} // coneSize
+
+
+// ----------------------------------------------------------------------
+// Get number of vertices in mesh.
+int
+pylith::faults::Fault::numVertices(void) const
+{ // numVertices
+ return (_faultMesh) ? _faultMesh->numVertices() : 0;
+} // numVertices
+
+
+// ----------------------------------------------------------------------
+// Get number of cells in mesh.
+int
+pylith::faults::Fault::numCells(void) const
+{ // numCells
+ return (_faultMesh && !_faultMesh->sieveMesh().isNull() && _faultMesh->sieveMesh()->height() > 0) ?
+ _faultMesh->sieveMesh()->heightStratum(1)->size() : 0;
+} // numCells
+
+
// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,13 +85,38 @@
*/
const char* label(void) const;
- /** Get the number of vertices on the fault.
+ /** Get dimension of mesh.
*
+ * @returns Dimension of mesh.
+ */
+ int dimension(void) const;
+
+ /** Get representative cone size for mesh.
+ *
+ * @returns Representative cone size for mesh.
+ */
+ int coneSize(void) const;
+
+ /** Get number of vertices in mesh.
+ *
+ * @returns Number of vertices in mesh.
+ */
+ int numVertices(void) const;
+
+ /** Get number of cells in mesh.
+ *
+ * @returns Number of cells in mesh.
+ */
+ int numCells(void) const;
+
+ /** Get the number of vertices associated with the fault (before
+ * fault mesh exists).
+ *
* @param mesh PETSc mesh
* @return Number of vertices on the fault.
*/
virtual
- int numVertices(const topology::Mesh& mesh) const = 0;
+ int numVerticesNoMesh(const topology::Mesh& mesh) const = 0;
/** Adjust mesh topology for fault implementation.
*
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.icc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.icc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/Fault.icc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -48,5 +48,4 @@
return _label.c_str();
}
-
// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -78,10 +78,11 @@
} // faultMeshFilename
// ----------------------------------------------------------------------
-// Get number of vertices in fault.
+// Get the number of vertices associated with the fault (before
+// fault mesh exists).
int
-pylith::faults::FaultCohesive::numVertices(const topology::Mesh& mesh) const
-{ // numVertices
+pylith::faults::FaultCohesive::numVerticesNoMesh(const topology::Mesh& mesh) const
+{ // numVerticesNoMesh
int nvertices = 0;
if (!_useFaultMesh) {
@@ -105,7 +106,7 @@
} // else
return nvertices;
-} // numVertices
+} // numVerticesNoMesh
// ----------------------------------------------------------------------
// Adjust mesh topology for fault implementation.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesive.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -74,12 +74,13 @@
*/
void faultMeshFilename(const char* filename);
- /** Get the number of vertices on the fault.
+ /** Get the number of vertices associated with the fault (before
+ * fault mesh exists).
*
* @param mesh PETSc mesh
* @return Number of vertices on the fault.
*/
- int numVertices(const topology::Mesh& mesh) const;
+ int numVerticesNoMesh(const topology::Mesh& mesh) const;
/** Adjust mesh topology for fault implementation.
*
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -151,6 +151,9 @@
const spatialdata::geocoords::CoordSys* cs = mesh.coordsys();
assert(0 != cs);
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.stagePush("FaultFields");
+
// Create field for relative velocity associated with Lagrange vertex k
_fields->add("relative velocity", "relative_velocity");
topology::Field<topology::SubMesh>& velRel =
@@ -160,7 +163,7 @@
velRel.vectorFieldType(topology::FieldBase::VECTOR);
velRel.scale(_normalizer->lengthScale() / _normalizer->timeScale());
- //logger.stagePop();
+ logger.stagePop();
} // initialize
// ----------------------------------------------------------------------
@@ -337,6 +340,13 @@
residualVertexN = areaVertex * (dispTpdtVertexL - initialTractionsVertex);
} else { // opening, normal traction should be zero
+ if (fabs(tractionNormal) > _zeroTolerance) {
+ std::cerr << "WARNING! Fault opening with nonzero traction."
+ << ", v_fault: " << v_fault
+ << ", opening: " << slipNormal
+ << ", normal traction: " << tractionNormal
+ << std::endl;
+ } // if
assert(fabs(tractionNormal) < _zeroTolerance);
} // if/else
residualVertexP = -residualVertexN;
@@ -355,12 +365,6 @@
residualSection->getFiberDimension(v_positive));
residualSection->updateAddPoint(v_positive, &residualVertexP[0]);
-#if 0 // TEST
- assert(residualVertexL.size() ==
- residualSection->getFiberDimension(v_lagrange));
- residualSection->updateAddPoint(v_lagrange, &residualVertexL[0]);
-#endif
-
#if defined(DETAILED_EVENT_LOGGING)
_logger->eventEnd(updateEvent);
#endif
@@ -514,10 +518,10 @@
const scalar_array&,
const bool);
- assert(0 != fields);
- assert(0 != _quadrature);
- assert(0 != _fields);
- assert(0 != _friction);
+ assert(fields);
+ assert(_quadrature);
+ assert(_fields);
+ assert(_friction);
_sensitivitySetup(jacobian);
@@ -731,21 +735,12 @@
std::cout << ", slipRateVertex: ";
for (int iDim=0; iDim < spaceDim; ++iDim)
std::cout << " " << slipRateVertex[iDim];
- std::cout << ", tractionVertex: ";
+ std::cout << ", tractionTpdtVertex: ";
for (int iDim=0; iDim < spaceDim; ++iDim)
std::cout << " " << tractionTpdtVertex[iDim];
- std::cout << ", lagrangeTVertex: ";
- for (int iDim=0; iDim < spaceDim; ++iDim)
- std::cout << " " << lagrangeTVertex[iDim];
- std::cout << ", lagrangeTIncrVertex: ";
- for (int iDim=0; iDim < spaceDim; ++iDim)
- std::cout << " " << lagrangeTIncrVertex[iDim];
std::cout << ", dTractionTpdtVertex: ";
for (int iDim=0; iDim < spaceDim; ++iDim)
std::cout << " " << dTractionTpdtVertex[iDim];
- std::cout << ", dLagrangeTpdtVertex: ";
- for (int iDim=0; iDim < spaceDim; ++iDim)
- std::cout << " " << dLagrangeTpdtVertex[iDim];
std::cout << std::endl;
#endif
@@ -783,30 +778,120 @@
// change in Lagrange multipliers imposed by friction criterion.
// Solve sensitivity problem for negative side of the fault.
- bool negativeSide = true;
- _sensitivityUpdateJacobian(negativeSide, jacobian, *fields);
- _sensitivityReformResidual(negativeSide);
+ bool negativeSideFlag = true;
+ _sensitivityUpdateJacobian(negativeSideFlag, jacobian, *fields);
+ _sensitivityReformResidual(negativeSideFlag);
_sensitivitySolve();
- _sensitivityUpdateSoln(negativeSide);
+ _sensitivityUpdateSoln(negativeSideFlag);
// Solve sensitivity problem for positive side of the fault.
- negativeSide = false;
- _sensitivityUpdateJacobian(negativeSide, jacobian, *fields);
- _sensitivityReformResidual(negativeSide);
+ negativeSideFlag = false;
+ _sensitivityUpdateJacobian(negativeSideFlag, jacobian, *fields);
+ _sensitivityReformResidual(negativeSideFlag);
_sensitivitySolve();
- _sensitivityUpdateSoln(negativeSide);
+ _sensitivityUpdateSoln(negativeSideFlag);
// Step 4: Update Lagrange multipliers and displacement fields based
// on changes imposed by friction criterion in Step 2 (change in
// Lagrange multipliers) and Step 3 (slip associated with change in
// Lagrange multipliers).
+ //
+ // Use line search to find best update. This improves convergence
+ // because it accounts for feedback between the fault constitutive
+ // model and the deformation. We also search in log space because
+ // some fault constitutive models depend on the log of slip rate.
+ const PylithScalar residualTol = _zeroTolerance; // L2 misfit in tractions
+ const int maxIter = 16;
+ PylithScalar logAlphaL = log10(_zeroTolerance); // minimum step
+ PylithScalar logAlphaR = log10(1.0); // maximum step
+ PylithScalar logAlphaM = 0.5*(logAlphaL + logAlphaR);
+ PylithScalar logAlphaML = 0.5*(logAlphaL + logAlphaM);
+ PylithScalar logAlphaMR = 0.5*(logAlphaM + logAlphaR);
+ PylithScalar residualL = _constrainSolnSpaceNorm(pow(10.0, logAlphaL), t, fields);
+ PylithScalar residualML = _constrainSolnSpaceNorm(pow(10.0, logAlphaML), t, fields);
+ PylithScalar residualM = _constrainSolnSpaceNorm(pow(10.0, logAlphaM), t, fields);
+ PylithScalar residualMR = _constrainSolnSpaceNorm(pow(10.0, logAlphaMR), t, fields);
+ PylithScalar residualR = _constrainSolnSpaceNorm(pow(10.0, logAlphaR), t, fields);
+ for (int iter=0; iter < maxIter; ++iter) {
+ if (residualM < residualTol || residualR < residualTol)
+ // if residual is very small, we prefer the full step
+ break;
+
+#if 0
+ std::cout << "alphaL: " << pow(10.0, logAlphaL)
+ << ", residuaL: " << residualL
+ << ", alphaM: " << pow(10.0, logAlphaM)
+ << ", residualM: " << residualM
+ << ", alphaR: " << pow(10.0, logAlphaR)
+ << ", residualR: " << residualR
+ << std::endl;
+#endif
+
+ if (residualL < residualML && residualL < residualM && residualL < residualMR && residualL < residualR) {
+ logAlphaL = logAlphaL;
+ logAlphaR = logAlphaM;
+ residualL = residualL;
+ residualR = residualM;
+ residualM = residualML;
+ } else if (residualML <= residualL && residualML < residualM && residualML < residualMR && residualML < residualR) {
+ logAlphaL = logAlphaL;
+ logAlphaR = logAlphaM;
+ residualL = residualL;
+ residualR = residualM;
+ residualM = residualML;
+ } else if (residualM <= residualL && residualM <= residualML && residualM < residualMR && residualM < residualR) {
+ logAlphaL = logAlphaML;
+ logAlphaR = logAlphaMR;
+ residualL = residualML;
+ residualR = residualMR;
+ residualM = residualM;
+ } else if (residualMR <= residualL && residualMR <= residualML && residualMR <= residualM && residualMR < residualR) {
+ logAlphaL = logAlphaM;
+ logAlphaR = logAlphaR;
+ residualL = residualM;
+ residualR = residualR;
+ residualM = residualMR;
+ } else if (residualR <= residualL && residualR <= residualML && residualR <= residualM && residualR <= residualMR) {
+ logAlphaL = logAlphaM;
+ logAlphaR = logAlphaR;
+ residualL = residualM;
+ residualR = residualR;
+ residualM = residualMR;
+ } else {
+ assert(0);
+ throw std::logic_error("Unknown case in constrain solution space "
+ "line search.");
+ } // if/else
+ logAlphaM = (logAlphaL + logAlphaR) / 2.0;
+ logAlphaML = (logAlphaL + logAlphaM) / 2.0;
+ logAlphaMR = (logAlphaM + logAlphaR) / 2.0;
+
+ residualML = _constrainSolnSpaceNorm(pow(10.0, logAlphaML), t, fields);
+ residualMR = _constrainSolnSpaceNorm(pow(10.0, logAlphaMR), t, fields);
+
+ } // for
+ // Account for possibility that end points have lowest residual
+ if (residualR <= residualM || residualR < residualTol) {
+ logAlphaM = logAlphaR;
+ residualM = residualR;
+ } else if (residualL < residualM) {
+ logAlphaM = logAlphaL;
+ residualM = residualL;
+ } // if/else
+ const PylithScalar alpha = pow(10.0, logAlphaM); // alphaM is our best guess
+#if 0 // DEBUGGING
+ std::cout << "ALPHA: " << alpha
+ << ", residual: " << residualM
+ << std::endl;
+#endif
+
scalar_array slipTVertex(spaceDim);
scalar_array dSlipTpdtVertex(spaceDim);
scalar_array dispRelVertex(spaceDim);
+ const ALE::Obj<RealSection>& sensDispRelSection = _fields->get("sensitivity relative disp").section();
+ assert(!sensDispRelSection.isNull());
- const ALE::Obj<RealSection>& sensDispRelSection =
- _fields->get("sensitivity relative disp").section();
for (int iVertex=0; iVertex < numVertices; ++iVertex) {
const int v_fault = _cohesiveVertices[iVertex].fault;
const int v_lagrange = _cohesiveVertices[iVertex].lagrange;
@@ -817,14 +902,6 @@
dLagrangeTpdtSection->restrictPoint(v_fault, &dLagrangeTpdtVertex[0],
dLagrangeTpdtVertex.size());
- // If no change in the Lagrange multiplier computed from friction
- // criterion, there are no updates, so continue.
- double dLagrangeTpdtMag = 0.0;
- for (int i=0; i < spaceDim; ++i)
- dLagrangeTpdtMag += dLagrangeTpdtVertex[i]*dLagrangeTpdtVertex[i];
- if (0.0 == dLagrangeTpdtMag)
- continue;
-
// Get change in relative displacement from sensitivity solve.
assert(spaceDim == sensDispRelSection->getFiberDimension(v_fault));
const PylithScalar* sensDispRelVertex =
@@ -872,11 +949,8 @@
dispIncrSection->restrictPoint(v_lagrange);
assert(lagrangeTIncrVertex);
- // Step 4a: Prevent nonphysical trial solutions. The product of the
- // normal traction and normal slip must be nonnegative (forbid
- // interpenetration with tension or opening with compression).
-
- // Compute slip, change in slip, and tractions in fault coordinates.
+ // Scale perturbation in relative displacements and change in
+ // Lagrange multipliers by alpha using only shear components.
slipTVertex = 0.0;
slipTpdtVertex = 0.0;
dSlipTpdtVertex = 0.0;
@@ -890,25 +964,25 @@
(dispTVertexP[jDim] - dispTVertexN[jDim] +
dispIncrVertexP[jDim] - dispIncrVertexN[jDim]);
dSlipTpdtVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
- sensDispRelVertex[jDim];
+ alpha*sensDispRelVertex[jDim];
tractionTpdtVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
(lagrangeTVertex[jDim] + lagrangeTIncrVertex[jDim]);
dTractionTpdtVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
- dLagrangeTpdtVertex[jDim];
+ alpha*dLagrangeTpdtVertex[jDim];
} // for
} // for
- if (fabs(slipTpdtVertex[indexN]) < _zeroTolerance) {
- slipTpdtVertex[indexN] = 0.0;
- } // if
- if (fabs(dSlipTpdtVertex[indexN]) < _zeroTolerance) {
- dSlipTpdtVertex[indexN] = 0.0;
- } // if
+ // FIRST, correct nonphysical trial solutions.
+ // Order of steps 5a-5c is important!
if ((slipTpdtVertex[indexN] + dSlipTpdtVertex[indexN]) *
(tractionTpdtVertex[indexN] + dTractionTpdtVertex[indexN])
< 0.0) {
+ // Step 5a: Prevent nonphysical trial solutions. The product of the
+ // normal traction and normal slip must be nonnegative (forbid
+ // interpenetration with tension or opening with compression).
+
#if 0 // DEBUGGING
- std::cout << "STEP 4a CORRECTING NONPHYSICAL SLIP/TRACTIONS"
+ std::cout << "STEP 5a CORRECTING NONPHYSICAL SLIP/TRACTIONS"
<< ", v_fault: " << v_fault
<< ", slipNormal: " << slipTpdtVertex[indexN] + dSlipTpdtVertex[indexN]
<< ", tractionNormal: " << tractionTpdtVertex[indexN] + dTractionTpdtVertex[indexN]
@@ -926,44 +1000,60 @@
dSlipTpdtVertex[indexN] = -slipTpdtVertex[indexN];
} // if/else
- } // if
- // Do not allow fault interpenetration.
- if (slipTpdtVertex[indexN] + dSlipTpdtVertex[indexN] < 0.0) {
+ } else if (slipTpdtVertex[indexN] + dSlipTpdtVertex[indexN] > _zeroTolerance) {
+ // Step 5b: Insure fault traction is zero when opening (if alpha=1
+ // this should be enforced already, but will not be properly
+ // enforced when alpha < 1).
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ dTractionTpdtVertex[iDim] = -tractionTpdtVertex[iDim];
+ } // for
+
+ } else if (slipTpdtVertex[indexN] + dSlipTpdtVertex[indexN] < 0.0) {
+ // Step 5c: Prevent interpenetration.
#if 0 // DEBUGGING
- std::cout << "STEP 4a CORRECTING INTERPENETATION"
+ std::cout << "STEP 5b CORRECTING INTERPENETATION"
<< ", v_fault: " << v_fault
<< ", slipNormal: " << slipTpdtVertex[indexN] + dSlipTpdtVertex[indexN]
<< std::endl;
#endif
dSlipTpdtVertex[indexN] = -slipTpdtVertex[indexN];
- } // if
+
+ } // if/else
- // Prevent over-correction in slip resulting in backslip.
- double slipDot = 0.0;
- double tractionSlipDot = 0.0;
-
- // :TODO:
- //
- // Need slipTVertex, slipTpdtVertex, dSlipTpdtVertex
- // slipDot = (slipTpdtVertex - slipTVertex) dot dSlipVertex
- //
- // if slipDot < 0, dSlipVertex = -0.5*(slipTpdtVertex - slipTVertex)
-
- for (int iDim=0; iDim < spaceDim-1; ++iDim) { // :TODO: Optimize this
- slipDot += (slipTpdtVertex[iDim] - slipTVertex[iDim]) * (slipTpdtVertex[iDim] + dSlipTpdtVertex[iDim] - slipTVertex[iDim]);
+#if 0 // UNNECESSARY????
+ // Step 5d: Prevent over-correction in shear slip resulting in backslip
+ PylithScalar slipDot = 0.0;
+ PylithScalar tractionSlipDot = 0.0;
+ for (int iDim=0; iDim < indexN; ++iDim) {
+ // Compute dot product between slip and increment in slip (want positive)
+ slipDot +=
+ (slipTpdtVertex[iDim] - slipTVertex[iDim]) *
+ (slipTpdtVertex[iDim] + dSlipTpdtVertex[iDim] - slipTVertex[iDim]);
+ // Compute dot product of traction and slip
tractionSlipDot += (tractionTpdtVertex[iDim] + dTractionTpdtVertex[iDim])
* (slipTpdtVertex[iDim] + dSlipTpdtVertex[iDim]);
} // for
- if (slipDot < 0.0 && tractionSlipDot < 0.0) {
- dTractionTpdtVertex *= 0.5; // Use bisection as guess for traction
- for (int iDim=0; iDim < spaceDim-1; ++iDim) {
- dSlipTpdtVertex[iDim] *= -0.5*(slipTpdtVertex[iDim] - slipTVertex[iDim]);
+ if (slipDot < 0.0 &&
+ sqrt(fabs(slipDot)) > _zeroTolerance &&
+ tractionSlipDot < 0.0) {
+#if 0 // DEBUGGING
+ std::cout << "STEP 5d CORRECTING BACKSLIP"
+ << ", v_fault: " << v_fault
+ << ", slipDot: " << slipDot
+ << ", tractionSlipDot: " << tractionSlipDot
+ << std::endl;
+#endif
+ // Correct backslip, use bisection as guess
+ for (int iDim=0; iDim < indexN; ++iDim) {
+ dTractionTpdtVertex[iDim] *= 0.5;
+ dSlipTpdtVertex[iDim] = 0.5*(slipTVertex[iDim] - slipTpdtVertex[iDim]);
} // for
- } // if
+ } // if/else
+#endif
// Update current estimate of slip from t to t+dt.
slipTpdtVertex += dSlipTpdtVertex;
-
+
// Compute relative displacement from slip.
dispRelVertex = 0.0;
dDispRelVertex = 0.0;
@@ -990,20 +1080,12 @@
std::cout << ", dTractionTpdtVertex: ";
for (int iDim=0; iDim < spaceDim; ++iDim)
std::cout << " " << dTractionTpdtVertex[iDim];
- //std::cout << ", dLagrangeTpdtVertex: ";
- //for (int iDim=0; iDim < spaceDim; ++iDim)
- // std::cout << " " << dLagrangeTpdtVertex[iDim];
std::cout << ", slipTpdtVertex: ";
for (int iDim=0; iDim < spaceDim; ++iDim)
- std::cout << " " << slipTpdtVertex[iDim];
+ std::cout << " " << slipTpdtVertex[iDim]-dSlipTpdtVertex[iDim];
std::cout << ", dSlipTpdtVertex: ";
for (int iDim=0; iDim < spaceDim; ++iDim)
std::cout << " " << dSlipTpdtVertex[iDim];
- //std::cout << ", dDispRelVertex: ";
- //for (int iDim=0; iDim < spaceDim; ++iDim)
- // std::cout << " " << dDispRelVertex[iDim];
- std::cout << ", slipDot: " << slipDot
- << ", tractionSlipDot: " << tractionSlipDot;
std::cout << std::endl;
#endif
@@ -1025,7 +1107,6 @@
#if 0 // DEBUGGING
//dLagrangeTpdtSection->view("AFTER dLagrange");
- dispRelSection->view("AFTER RELATIVE DISPLACEMENT");
dispIncrSection->view("AFTER DISP INCR (t->t+dt)");
#endif
} // constrainSolnSpace
@@ -1374,8 +1455,6 @@
#if 0 // DEBUGGING
//dLagrangeTpdtSection->view("AFTER dLagrange");
//dispIncrSection->view("AFTER DISP INCR (t->t+dt)");
- dispRelSection->view("AFTER RELATIVE DISPLACEMENT");
- //velRelSection->view("AFTER RELATIVE VELOCITY");
#endif
} // adjustSolnLumped
@@ -1657,13 +1736,13 @@
const ALE::Obj<RealSection>& tractionsSection = tractions->section();
if (tractionsSection.isNull()) {
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- //logger.stagePush("Fault");
+ logger.stagePush("FaultFields");
const topology::Field<topology::SubMesh>& dispRel =
_fields->get("relative disp");
tractions->cloneSection(dispRel);
- //logger.stagePop();
+ logger.stagePop();
} // if
const PylithScalar pressureScale = _normalizer->pressureScale();
tractions->label("traction");
@@ -2163,8 +2242,13 @@
scalar_array dispVertex(spaceDim);
const ALE::Obj<RealSection>& solutionSection =
_fields->get("sensitivity solution").section();
+ assert(!solutionSection.isNull());
const ALE::Obj<RealSection>& dispRelSection =
_fields->get("sensitivity relative disp").section();
+ assert(!dispRelSection.isNull());
+ const ALE::Obj<RealSection>& dLagrangeTpdtSection =
+ _fields->get("sensitivity dLagrange").section();
+ assert(!dLagrangeTpdtSection.isNull());
const PylithScalar sign = (negativeSide) ? -1.0 : 1.0;
@@ -2174,6 +2258,20 @@
solutionSection->restrictPoint(v_fault, &dispVertex[0], dispVertex.size());
+ // If no change in the Lagrange multiplier computed from friction
+ // criterion, there are no updates, so continue.
+ assert(spaceDim == dLagrangeTpdtSection->getFiberDimension(v_fault));
+ const PylithScalar* dLagrangeTpdtVertex = dLagrangeTpdtSection->restrictPoint(v_fault);
+ assert(dLagrangeTpdtVertex);
+ PylithScalar dLagrangeTpdtVertexMag = 0.0;
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ dLagrangeTpdtVertexMag += dLagrangeTpdtVertex[iDim]*dLagrangeTpdtVertex[iDim];
+ } // for
+ if (0.0 == dLagrangeTpdtVertexMag)
+ continue;
+
+ // Update relative displacements associated with sensitivity solve
+ // solution
dispVertex *= sign;
assert(dispVertex.size() == dispRelSection->getFiberDimension(v_fault));
@@ -2181,17 +2279,260 @@
} // for
} // _sensitivityUpdateSoln
+
// ----------------------------------------------------------------------
+// Compute norm of residual associated with matching fault
+// constitutive model using update from sensitivity solve. We use
+// this in a line search to find a good update (required because
+// fault constitutive model may have a complex nonlinear feedback
+// with deformation).
+PylithScalar
+pylith::faults::FaultCohesiveDyn::_constrainSolnSpaceNorm(const PylithScalar alpha,
+ const PylithScalar t,
+ topology::SolutionFields* const fields)
+{ // _constrainSolnSpaceNorm
+ /// Member prototype for _constrainSolnSpaceXD()
+ typedef void (pylith::faults::FaultCohesiveDyn::*constrainSolnSpace_fn_type)
+ (scalar_array*,
+ const PylithScalar,
+ const scalar_array&,
+ const scalar_array&,
+ const scalar_array&,
+ const bool);
+
+ // Update time step in friction (can vary).
+ _friction->timeStep(_dt);
+ const PylithScalar dt = _dt;
+
+ const int spaceDim = _quadrature->spaceDim();
+ const int indexN = spaceDim - 1;
+
+ constrainSolnSpace_fn_type constrainSolnSpaceFn;
+ switch (spaceDim) { // switch
+ case 1:
+ constrainSolnSpaceFn =
+ &pylith::faults::FaultCohesiveDyn::_constrainSolnSpace1D;
+ break;
+ case 2:
+ constrainSolnSpaceFn =
+ &pylith::faults::FaultCohesiveDyn::_constrainSolnSpace2D;
+ break;
+ case 3:
+ constrainSolnSpaceFn =
+ &pylith::faults::FaultCohesiveDyn::_constrainSolnSpace3D;
+ break;
+ default :
+ assert(0);
+ throw std::logic_error("Unknown spatial dimension in "
+ "FaultCohesiveDyn::constrainSolnSpace().");
+ } // switch
+
+ // Get sections
+ scalar_array slipTpdtVertex(spaceDim); // fault coordinates
+ scalar_array slipRateVertex(spaceDim); // fault coordinates
+ scalar_array tractionTpdtVertex(spaceDim); // fault coordinates
+ scalar_array tractionMisfitVertex(spaceDim); // fault coordinates
+
+ const ALE::Obj<RealSection>& orientationSection =
+ _fields->get("orientation").section();
+ assert(!orientationSection.isNull());
+
+ const ALE::Obj<RealSection>& dLagrangeTpdtSection =
+ _fields->get("sensitivity dLagrange").section();
+ assert(!dLagrangeTpdtSection.isNull());
+
+ const ALE::Obj<RealSection>& sensDispRelSection =
+ _fields->get("sensitivity relative disp").section();
+ assert(!sensDispRelSection.isNull());
+
+ const ALE::Obj<RealSection>& dispTSection = fields->get("disp(t)").section();
+ assert(!dispTSection.isNull());
+
+ const ALE::Obj<RealSection>& dispIncrSection =
+ fields->get("dispIncr(t->t+dt)").section();
+ assert(!dispIncrSection.isNull());
+
+ bool isOpening = false;
+ PylithScalar norm2 = 0.0;
+ const int numVertices = _cohesiveVertices.size();
+ for (int iVertex=0; iVertex < numVertices; ++iVertex) {
+ const int v_lagrange = _cohesiveVertices[iVertex].lagrange;
+ const int v_fault = _cohesiveVertices[iVertex].fault;
+ const int v_negative = _cohesiveVertices[iVertex].negative;
+ const int v_positive = _cohesiveVertices[iVertex].positive;
+
+ // Get displacement values
+ assert(spaceDim == dispTSection->getFiberDimension(v_negative));
+ const PylithScalar* dispTVertexN = dispTSection->restrictPoint(v_negative);
+ assert(dispTVertexN);
+
+ assert(spaceDim == dispTSection->getFiberDimension(v_positive));
+ const PylithScalar* dispTVertexP = dispTSection->restrictPoint(v_positive);
+ assert(dispTVertexP);
+
+ // Get displacement increment values.
+ assert(spaceDim == dispIncrSection->getFiberDimension(v_negative));
+ const PylithScalar* dispIncrVertexN =
+ dispIncrSection->restrictPoint(v_negative);
+ assert(dispIncrVertexN);
+
+ assert(spaceDim == dispIncrSection->getFiberDimension(v_positive));
+ const PylithScalar* dispIncrVertexP =
+ dispIncrSection->restrictPoint(v_positive);
+ assert(dispIncrVertexP);
+
+ // Get orientation
+ assert(spaceDim*spaceDim == orientationSection->getFiberDimension(v_fault));
+ const PylithScalar* orientationVertex =
+ orientationSection->restrictPoint(v_fault);
+
+ // Get change in relative displacement from sensitivity solve.
+ assert(spaceDim == sensDispRelSection->getFiberDimension(v_fault));
+ const PylithScalar* dDispRelVertex =
+ sensDispRelSection->restrictPoint(v_fault);
+ assert(dDispRelVertex);
+
+ // Get Lagrange multiplier values from disp(t), and dispIncr(t->t+dt)
+ assert(spaceDim == dispTSection->getFiberDimension(v_lagrange));
+ const PylithScalar* lagrangeTVertex = dispTSection->restrictPoint(v_lagrange);
+ assert(lagrangeTVertex);
+
+ assert(spaceDim == dispIncrSection->getFiberDimension(v_lagrange));
+ const PylithScalar* lagrangeTIncrVertex =
+ dispIncrSection->restrictPoint(v_lagrange);
+ assert(lagrangeTIncrVertex);
+
+ assert(spaceDim == dLagrangeTpdtSection->getFiberDimension(v_fault));
+ const PylithScalar* dLagrangeTpdtVertex =
+ dLagrangeTpdtSection->restrictPoint(v_fault);
+ assert(dLagrangeTpdtVertex);
+
+ // Compute slip, slip rate, and traction at time t+dt as part of
+ // line search.
+ slipTpdtVertex = 0.0;
+ slipRateVertex = 0.0;
+ tractionTpdtVertex = 0.0;
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ for (int jDim=0; jDim < spaceDim; ++jDim) {
+ slipTpdtVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
+ (dispTVertexP[jDim] + dispIncrVertexP[jDim]
+ - dispTVertexN[jDim] - dispIncrVertexN[jDim] +
+ alpha*dDispRelVertex[jDim]);
+ slipRateVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
+ (dispIncrVertexP[jDim] - dispIncrVertexN[jDim] +
+ alpha*dDispRelVertex[jDim]) / dt;
+ tractionTpdtVertex[iDim] += orientationVertex[iDim*spaceDim+jDim] *
+ (lagrangeTVertex[jDim] + lagrangeTIncrVertex[jDim] +
+ alpha*dLagrangeTpdtVertex[jDim]);
+ } // for
+ if (fabs(slipRateVertex[iDim]) < _zeroTolerance) {
+ slipRateVertex[iDim] = 0.0;
+ } // if
+ } // for
+ if (fabs(slipTpdtVertex[indexN]) < _zeroTolerance) {
+ slipTpdtVertex[indexN] = 0.0;
+ } // if
+
+ // FIRST, correct nonphysical trial solutions.
+ // Order of steps a-c is important!
+
+ if (slipTpdtVertex[indexN]*tractionTpdtVertex[indexN] < 0.0) {
+ // Step a: Prevent nonphysical trial solutions. The product of the
+ // normal traction and normal slip must be nonnegative (forbid
+ // interpenetration with tension or opening with compression).
+
+ // Don't know what behavior is appropriate so set smaller of
+ // traction and slip to zero (should be appropriate if problem
+ // is nondimensionalized correctly).
+ if (fabs(slipTpdtVertex[indexN]) > fabs(tractionTpdtVertex[indexN])) {
+ // fault opening is bigger, so force normal traction back to zero
+ tractionTpdtVertex[indexN] = 0.0;
+ } else {
+ // traction is bigger, so force fault opening back to zero
+ slipTpdtVertex[indexN] = 0.0;
+ } // if/else
+
+ } else if (slipTpdtVertex[indexN] > _zeroTolerance) {
+ // Step b: Insure fault traction is zero when opening (if
+ // alpha=1 this should be enforced already, but will not be
+ // properly enforced when alpha < 1).
+
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ tractionTpdtVertex[iDim] = 0.0;
+ } // for
+ } else if (slipTpdtVertex[indexN] < 0.0) {
+ // Step c: Prevent interpenetration.
+
+ slipTpdtVertex[indexN] = 0.0;
+ } // if
+
+ if (slipTpdtVertex[indexN] > _zeroTolerance) {
+ isOpening = true;
+ } // if
+
+ // Apply friction criterion to trial solution to get change in
+ // Lagrange multiplier (dLagrangeTpdtVertex) in fault coordinate
+ // system.
+
+ // Get friction properties and state variables.
+ _friction->retrievePropsStateVars(v_fault);
+
+ // Use fault constitutive model to compute traction associated with
+ // friction.
+ tractionMisfitVertex = 0.0;
+ const bool iterating = true; // Iterating to get friction
+ CALL_MEMBER_FN(*this,
+ constrainSolnSpaceFn)(&tractionMisfitVertex, t,
+ slipTpdtVertex, slipRateVertex,
+ tractionTpdtVertex,
+ iterating);
+
+#if 0 // DEBUGGING
+ std::cout << "alpha: " << alpha
+ << ", v_fault: " << v_fault;
+ std::cout << ", misfit:";
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ std::cout << " " << tractionMisfitVertex[iDim];
+ } // for
+ std::cout << ", slip:";
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ std::cout << " " << slipTpdtVertex[iDim];
+ } // for
+ std::cout << ", traction:";
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ std::cout << " " << tractionTpdtVertex[iDim];
+ } // for
+ std::cout << ", dDispRel:";
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ std::cout << " " << dDispRelVertex[iDim];
+ } // for
+ std::cout << std::endl;
+#endif
+
+ for (int iDim=0; iDim < spaceDim; ++iDim) {
+ norm2 += tractionMisfitVertex[iDim]*tractionMisfitVertex[iDim];
+ } // for
+ } // for
+
+ if (isOpening && alpha < 1.0) {
+ norm2 = PYLITH_MAXFLOAT;
+ } // if
+
+ return sqrt(norm2) / numVertices;
+} // _constrainSolnSpaceNorm
+
+
+// ----------------------------------------------------------------------
// Constrain solution space in 1-D.
void
-pylith::faults::FaultCohesiveDyn::_constrainSolnSpace1D(scalar_array* dLagrangeTpdt,
+pylith::faults::FaultCohesiveDyn::_constrainSolnSpace1D(scalar_array* dTractionTpdt,
const PylithScalar t,
const scalar_array& slip,
const scalar_array& sliprate,
const scalar_array& tractionTpdt,
const bool iterating)
{ // _constrainSolnSpace1D
- assert(0 != dLagrangeTpdt);
+ assert(0 != dTractionTpdt);
if (fabs(slip[0]) < _zeroTolerance) {
// if compression, then no changes to solution
@@ -2199,7 +2540,7 @@
// if tension, then traction is zero.
const PylithScalar dlp = -tractionTpdt[0];
- (*dLagrangeTpdt)[0] = dlp;
+ (*dTractionTpdt)[0] = dlp;
} // else
PetscLogFlops(2);
@@ -2208,14 +2549,14 @@
// ----------------------------------------------------------------------
// Constrain solution space in 2-D.
void
-pylith::faults::FaultCohesiveDyn::_constrainSolnSpace2D(scalar_array* dLagrangeTpdt,
+pylith::faults::FaultCohesiveDyn::_constrainSolnSpace2D(scalar_array* dTractionTpdt,
const PylithScalar t,
const scalar_array& slip,
const scalar_array& slipRate,
const scalar_array& tractionTpdt,
const bool iterating)
{ // _constrainSolnSpace2D
- assert(0 != dLagrangeTpdt);
+ assert(dTractionTpdt);
const PylithScalar slipMag = fabs(slip[0]);
const PylithScalar slipRateMag = fabs(slipRate[0]);
@@ -2238,11 +2579,9 @@
// versus friction
const PylithScalar dlp = -(tractionShearMag - frictionStress) *
tractionTpdt[0] / tractionShearMag;
- (*dLagrangeTpdt)[0] = dlp;
- (*dLagrangeTpdt)[1] = 0.0;
+ (*dTractionTpdt)[0] = dlp;
} else {
- (*dLagrangeTpdt)[0] = -(*dLagrangeTpdt)[0];
- (*dLagrangeTpdt)[1] = 0.0;
+ // No shear stress and no friction.
} // if/else
} else {
// friction exceeds value necessary to stick
@@ -2254,8 +2593,8 @@
#if !defined(NO_FAULT_OPENING)
} else {
// if in tension, then traction is zero.
- (*dLagrangeTpdt)[0] = -tractionTpdt[0];
- (*dLagrangeTpdt)[1] = -tractionTpdt[1];
+ (*dTractionTpdt)[0] = -tractionTpdt[0];
+ (*dTractionTpdt)[1] = -tractionTpdt[1];
} // else
#endif
@@ -2265,14 +2604,14 @@
// ----------------------------------------------------------------------
// Constrain solution space in 3-D.
void
-pylith::faults::FaultCohesiveDyn::_constrainSolnSpace3D(scalar_array* dLagrangeTpdt,
+pylith::faults::FaultCohesiveDyn::_constrainSolnSpace3D(scalar_array* dTractionTpdt,
const PylithScalar t,
const scalar_array& slip,
const scalar_array& slipRate,
const scalar_array& tractionTpdt,
const bool iterating)
{ // _constrainSolnSpace3D
- assert(0 != dLagrangeTpdt);
+ assert(dTractionTpdt);
const PylithScalar slipShearMag = sqrt(slip[0] * slip[0] +
slip[1] * slip[1]);
@@ -2303,13 +2642,10 @@
const PylithScalar dlq = -(tractionShearMag - frictionStress) *
tractionTpdt[1] / tractionShearMag;
- (*dLagrangeTpdt)[0] = dlp;
- (*dLagrangeTpdt)[1] = dlq;
- (*dLagrangeTpdt)[2] = 0.0;
+ (*dTractionTpdt)[0] = dlp;
+ (*dTractionTpdt)[1] = dlq;
} else {
- (*dLagrangeTpdt)[0] = -(*dLagrangeTpdt)[0];
- (*dLagrangeTpdt)[0] = -(*dLagrangeTpdt)[0];
- (*dLagrangeTpdt)[2] = 0.0;
+ // No shear stress and no friction.
} // if/else
} else {
@@ -2322,9 +2658,9 @@
#if !defined (NO_FAULT_OPENING)
} else {
// if in tension, then traction is zero.
- (*dLagrangeTpdt)[0] = -tractionTpdt[0];
- (*dLagrangeTpdt)[1] = -tractionTpdt[1];
- (*dLagrangeTpdt)[2] = -tractionTpdt[2];
+ (*dTractionTpdt)[0] = -tractionTpdt[0];
+ (*dTractionTpdt)[1] = -tractionTpdt[1];
+ (*dTractionTpdt)[2] = -tractionTpdt[2];
} // else
#endif
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveDyn.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -201,8 +201,24 @@
*/
void _sensitivityUpdateSoln(const bool negativeSide);
- /** Constrain solution space with lumped Jacobian in 1-D.
+ /** Compute norm of residual associated with matching fault
+ * constitutive model using update from sensitivity solve. We use
+ * this in a line search to find a good update (required because
+ * fault constitutive model may have a complex nonlinear feedback
+ * with deformation).
*
+ * @param alpha Current step in line search.
+ * @param t Current time.
+ * @param fields Solution fields.
+ *
+ * @returns L2 norm of residual.
+ */
+ PylithScalar _constrainSolnSpaceNorm(const PylithScalar alpha,
+ const PylithScalar t,
+ topology::SolutionFields* const fields);
+
+ /** Constrain solution space in 1-D.
+ *
* @param dLagrangeTpdt Adjustment to Lagrange multiplier.
* @param t Current time.
* @param slip Slip assoc. w/Lagrange multiplier vertex.
@@ -216,7 +232,7 @@
const scalar_array& tractionTpdt,
const bool iterating =true);
- /** Constrain solution space with lumped Jacobian in 2-D.
+ /** Constrain solution space in 2-D.
*
* @param dLagrangeTpdt Adjustment to Lagrange multiplier.
* @param t Current time.
@@ -231,7 +247,7 @@
const scalar_array& tractionTpdt,
const bool iterating =true);
- /** Constrain solution space with lumped Jacobian in 3-D.
+ /** Constrain solution space in 3-D.
*
* @param dLagrangeTpdt Adjustment to Lagrange multiplier.
* @param t Current time.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveLagrange.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveLagrange.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/faults/FaultCohesiveLagrange.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -105,7 +105,7 @@
*_faultMesh);
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- //logger.stagePush("Fault");
+ logger.stagePush("FaultFields");
// Allocate dispRel field
const ALE::Obj<SieveSubMesh>& faultSieveMesh = _faultMesh->sieveMesh();
@@ -120,6 +120,8 @@
dispRel.vectorFieldType(topology::FieldBase::VECTOR);
dispRel.scale(_normalizer->lengthScale());
+ logger.stagePop();
+
const ALE::Obj<SieveSubMesh::label_sequence>& cells =
faultSieveMesh->heightStratum(0);
assert(!cells.isNull());
@@ -130,26 +132,12 @@
_quadrature->computeGeometry(*_faultMesh, cells);
#endif
- _fields->add("distribution", "distribution", pylith::topology::FieldBase::CELLS_FIELD, 1);
- topology::Field<topology::SubMesh>& dist = _fields->get("distribution");
- dist.allocate();
- const ALE::Obj<RealSection>& distSection = dist.section();
- assert(!distSection.isNull());
- const PylithScalar rank = (PylithScalar) distSection->commRank();
-
- // Loop over cells in fault mesh, set distribution
- for (SieveSubMesh::label_sequence::iterator c_iter = cellsBegin; c_iter
- != cellsEnd; ++c_iter) {
- distSection->updatePoint(*c_iter, &rank);
- } // for
-
// Compute orientation at vertices in fault mesh.
_calcOrientation(upDir);
// Compute tributary area for each vertex in fault mesh.
_calcArea();
- //logger.stagePop();
} // initialize
// ----------------------------------------------------------------------
@@ -1209,6 +1197,9 @@
PylithScalar jacobianDet = 0;
scalar_array refCoordsVertex(cohesiveDim);
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.stagePush("FaultFields");
+
// Allocate orientation field.
scalar_array orientationVertex(orientationSize);
_fields->add("orientation", "orientation");
@@ -1226,6 +1217,8 @@
orientation.allocate();
orientation.zero();
+ logger.stagePop();
+
// Get fault cells.
const ALE::Obj<SieveSubMesh::label_sequence>& cells =
faultSieveMesh->heightStratum(0);
@@ -1455,6 +1448,9 @@
vertices->begin();
const SieveSubMesh::label_sequence::iterator verticesEnd = vertices->end();
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.stagePush("FaultFields");
+
// Allocate area field.
_fields->add("area", "area");
topology::Field<topology::SubMesh>& area = _fields->get("area");
@@ -1468,6 +1464,8 @@
assert(!areaSection.isNull());
UpdateAddVisitor areaVisitor(*areaSection, &areaCell[0]);
+ logger.stagePop();
+
scalar_array coordinatesCell(numBasis * spaceDim);
const ALE::Obj<RealSection>& coordinates = faultSieveMesh->getRealSection(
"coordinates");
@@ -1554,13 +1552,13 @@
const ALE::Obj<RealSection>& tractionsSection = tractions->section();
if (tractionsSection.isNull()) {
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- //logger.stagePush("Fault");
+ logger.stagePush("FaultFields");
const topology::Field<topology::SubMesh>& dispRel =
_fields->get("relative disp");
tractions->cloneSection(dispRel);
- //logger.stagePop();
+ logger.stagePop();
} // if
assert(!tractionsSection.isNull());
tractions->zero();
@@ -1716,7 +1714,7 @@
return;
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Output");
+ logger.stagePush("OutputFields");
// Create vector field; use same shape/chart as relative
// displacement field.
@@ -1742,7 +1740,7 @@
return;
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Output");
+ logger.stagePush("OutputFields");
// Create vector field; use same shape/chart as area field.
assert(0 != _faultMesh);
@@ -1857,10 +1855,41 @@
pylith::faults::FaultCohesiveLagrange::cellField(const char* name,
const topology::SolutionFields* fields)
{ // cellField
- if (0 == strcasecmp("distribution", name)) {
- const topology::Field<topology::SubMesh>& dist = _fields->get("distribution");
- return dist;
- }
+ if (0 == strcasecmp("partition", name)) {
+
+ const ALE::Obj<SieveSubMesh>& faultSieveMesh = _faultMesh->sieveMesh();
+ assert(!faultSieveMesh.isNull());
+ const ALE::Obj<SieveSubMesh::label_sequence>& cells =
+ faultSieveMesh->heightStratum(0);
+ assert(!cells.isNull());
+ const SieveSubMesh::label_sequence::iterator cellsBegin = cells->begin();
+ const SieveSubMesh::label_sequence::iterator cellsEnd = cells->end();
+
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ logger.stagePush("OutputFields");
+
+ const int fiberDim = 1;
+ _fields->add("partition", "partition",
+ pylith::topology::FieldBase::CELLS_FIELD, fiberDim);
+ topology::Field<topology::SubMesh>& partition = _fields->get("partition");
+ partition.allocate();
+ const ALE::Obj<RealSection>& partitionSection = partition.section();
+ assert(!partitionSection.isNull());
+
+ const PylithScalar rank = (double) partitionSection->commRank();
+ // Loop over cells in fault mesh, set partition
+ for (SieveSubMesh::label_sequence::iterator c_iter = cellsBegin;
+ c_iter != cellsEnd;
+ ++c_iter) {
+ partitionSection->updatePoint(*c_iter, &rank);
+ } // for
+
+ logger.stagePop();
+
+ return partition;
+
+ } // if
+
// Should not reach this point if requested field was found
std::ostringstream msg;
msg << "Request for unknown cell field '" << name << "' for fault '"
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/Integrator.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/Integrator.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/Integrator.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -20,7 +20,7 @@
#include "Quadrature.hh" // USES Quadrature
#include "pylith/utils/EventLogger.hh" // USES EventLogger
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
#include "spatialdata/spatialdb/GravityField.hh" // USES GravityField
@@ -113,7 +113,7 @@
pylith::feassemble::Integrator<quadrature_type>::stableTimeStep(const topology::Mesh& mesh)
{ // stableTimeStep
// Assume any time step will work.
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
} // stableTimeStep
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/IntegratorElasticity.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/IntegratorElasticity.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/feassemble/IntegratorElasticity.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -464,7 +464,7 @@
if (!_outputFields->hasField("buffer (tensor)")) {
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Output");
+ logger.stagePush("OutputFields");
_outputFields->add("buffer (tensor)", "buffer");
topology::Field<topology::Mesh>& buffer =
_outputFields->get("buffer (tensor)");
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/FrictionModel.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/FrictionModel.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/FrictionModel.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -254,6 +254,8 @@
* @param numProperties Number of properties.
* @param stateVars State variables at location.
* @param numStateVars Number of state variables.
+ *
+ * @returns Friction (magnitude of shear traction) at vertex.
*/
virtual
PylithScalar _calcFriction(const PylithScalar t,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/RateStateAgeing.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/RateStateAgeing.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/RateStateAgeing.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "pylith/materials/Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -310,64 +310,33 @@
if (normalTraction <= 0.0) {
// if fault is in compression
-#if 0
- // regularized rate and state equation
- const PylithScalar f0 = properties[p_coef];
+ const PylithScalar slipRateLinear = _minSlipRate;
- // Since regulatized friction -> 0 as slipRate -> 0, limit slip
- // rate to some minimum value
- const PylithScalar slipRateEff = std::max(_minSlipRate, slipRate);
-
- const PylithScalar slipRate0 = properties[p_slipRate0];
+ const PylithScalar f0 = properties[p_coef];
const PylithScalar a = properties[p_a];
-
+ const PylithScalar b = properties[p_b];
+ const PylithScalar L = properties[p_L];
+ const PylithScalar slipRate0 = properties[p_slipRate0];
const PylithScalar theta = stateVars[s_state];
- const PylithScalar L = properties[p_L];
- const PylithScalar b = properties[p_b];
- const PylithScalar bLnTerm = b * log(slipRate0 * theta / L);
-
- const PylithScalar expTerm = exp((f0 + bLnTerm)/a);
- const PylithScalar sinhArg = 0.5 * slipRateEff / slipRate0 * expTerm;
-
- mu_f = a * asinh(sinhArg);
- friction = -mu_f * normalTraction + properties[p_cohesion];
-
-#else
-
- const double slipRateLinear = _minSlipRate;
- const double slipRateFactor = 1.0e-3;
-
- const double f0 = properties[p_coef];
- const double a = properties[p_a];
- const double b = properties[p_b];
- const double L = properties[p_L];
- const double slipRate0 = properties[p_slipRate0];
- const double theta = stateVars[s_state];
-
- if (slipRate > slipRateLinear) {
+ if (slipRate >= slipRateLinear) {
mu_f = f0 + a*log(slipRate / slipRate0) + b*log(slipRate0*theta/L);
- } else if (slipRate > slipRateFactor*slipRateLinear) {
- mu_f = f0 + a*log(slipRateLinear / slipRate0) + b*log(slipRate0*theta/L) -
- a*(1.0-slipRateFactor) *
- (1.0 - slipRate/slipRateLinear) / (1.0 - slipRateFactor);
} else {
mu_f = f0 + a*log(slipRateLinear / slipRate0) + b*log(slipRate0*theta/L) -
- a*(1.0-slipRateFactor);
+ a*(1.0 - slipRate/slipRateLinear);
} // else
-
friction = -mu_f * normalTraction + properties[p_cohesion];
-
-#endif
- } else { // if/else
+
+ } else {
friction = properties[p_cohesion];
} // if/else
- PetscLogFlops(11);
+ PetscLogFlops(12);
return friction;
} // _calcFriction
+
// ----------------------------------------------------------------------
// Update state variables (for next time step).
void
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakening.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakening.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakening.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "pylith/materials/Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -283,8 +283,8 @@
PylithScalar mu_f = 0.0;
if (normalTraction <= 0.0) {
// if fault is in compression
- const double slipPrev = stateVars[s_slipPrev];
- const double slipCum = stateVars[s_slipCum] + fabs(slip - slipPrev);
+ const PylithScalar slipPrev = stateVars[s_slipPrev];
+ const PylithScalar slipCum = stateVars[s_slipCum] + fabs(slip - slipPrev);
if (slipCum < properties[p_d0]) {
// if/else linear slip-weakening form of mu_f
@@ -294,12 +294,12 @@
} else {
mu_f = properties[p_coefD];
} // if/else
- friction = - mu_f * normalTraction + properties[p_cohesion];
+ friction = -mu_f * normalTraction + properties[p_cohesion];
} else { // else
friction = properties[p_cohesion];
} // if/else
- PetscLogFlops(6);
+ PetscLogFlops(10);
return friction;
} // _calcFriction
@@ -326,6 +326,8 @@
const double slipPrev = stateVars[s_slipPrev];
stateVars[s_slipPrev] = slip;
stateVars[s_slipCum] += fabs(slip - slipPrev);
+
+ PetscLogFlops(3);
} // _updateStateVars
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakeningTime.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakeningTime.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/SlipWeakeningTime.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "pylith/materials/Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/StaticFriction.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/StaticFriction.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/StaticFriction.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "pylith/materials/Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/TimeWeakening.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/TimeWeakening.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/friction/TimeWeakening.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "pylith/materials/Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPrager3D.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -54,7 +54,7 @@
const int numProperties = 6;
/// Physical properties.
- const Metadata::ParamDescription properties[] = {
+ const Metadata::ParamDescription properties[numProperties] = {
{ "density", 1, pylith::topology::FieldBase::SCALAR },
{ "mu", 1, pylith::topology::FieldBase::SCALAR },
{ "lambda", 1, pylith::topology::FieldBase::SCALAR },
@@ -78,7 +78,7 @@
const int numStateVars = 1;
/// State variables.
- const Metadata::ParamDescription stateVars[] = {
+ const Metadata::ParamDescription stateVars[numStateVars] = {
{ "plastic_strain", tensorSize, pylith::topology::FieldBase::TENSOR }
};
@@ -415,7 +415,7 @@
// It's unclear what to do for an elasto-plastic material, which has no
// inherent time scale. For now, just set dtStable to a large value.
- const PylithScalar dtStable = pylith::PYLITH_MAXDOUBLE;
+ const PylithScalar dtStable = pylith::PYLITH_MAXSCALAR;
return dtStable;
} // _stableTimeStepImplicit
@@ -543,8 +543,8 @@
// Initial stress values
const PylithScalar meanStressInitial = (initialStress[0] +
- initialStress[1] +
- initialStress[2])/3.0;
+ initialStress[1] +
+ initialStress[2])/3.0;
PylithScalar devStressInitial[tensorSize];
calcDeviatoric3D(devStressInitial, initialStress, meanStressInitial);
@@ -564,9 +564,12 @@
meanStrainInitial;
const PylithScalar strainPPTpdt[tensorSize] = {
- totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] - devStrainInitial[0],
- totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] - devStrainInitial[1],
- totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] - devStrainInitial[2],
+ totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
+ devStrainInitial[0],
+ totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
+ devStrainInitial[1],
+ totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] -
+ devStrainInitial[2],
totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5],
@@ -582,7 +585,8 @@
strainPPTpdt[4]/ae + devStressInitial[4],
strainPPTpdt[5]/ae + devStressInitial[5],
};
- const PylithScalar trialMeanStress = meanStrainPPTpdt/am + meanStressInitial;
+ const PylithScalar trialMeanStress = meanStrainPPTpdt/am +
+ meanStressInitial;
const PylithScalar stressInvar2 =
sqrt(0.5 * scalarProduct3D(trialDevStress, trialDevStress));
const PylithScalar yieldFunction = 3.0 * alphaYield * trialMeanStress +
@@ -648,12 +652,18 @@
stateVars[s_plasticStrain+5],
};
- const PylithScalar e11 = totalStrain[0] - plasticStrainTpdt[0] - initialStrain[0];
- const PylithScalar e22 = totalStrain[1] - plasticStrainTpdt[1] - initialStrain[1];
- const PylithScalar e33 = totalStrain[2] - plasticStrainTpdt[2] - initialStrain[2];
- const PylithScalar e12 = totalStrain[3] - plasticStrainTpdt[3] - initialStrain[3];
- const PylithScalar e23 = totalStrain[4] - plasticStrainTpdt[4] - initialStrain[4];
- const PylithScalar e13 = totalStrain[5] - plasticStrainTpdt[5] - initialStrain[5];
+ const PylithScalar e11 = totalStrain[0] - plasticStrainTpdt[0] -
+ initialStrain[0];
+ const PylithScalar e22 = totalStrain[1] - plasticStrainTpdt[1] -
+ initialStrain[1];
+ const PylithScalar e33 = totalStrain[2] - plasticStrainTpdt[2] -
+ initialStrain[2];
+ const PylithScalar e12 = totalStrain[3] - plasticStrainTpdt[3] -
+ initialStrain[3];
+ const PylithScalar e23 = totalStrain[4] - plasticStrainTpdt[4] -
+ initialStrain[4];
+ const PylithScalar e13 = totalStrain[5] - plasticStrainTpdt[5] -
+ initialStrain[5];
const PylithScalar traceStrainTpdt = e11 + e22 + e33;
const PylithScalar s123 = lambda * traceStrainTpdt;
@@ -673,12 +683,14 @@
const PylithScalar beta = properties[p_beta];
const PylithScalar alphaFlow = properties[p_alphaFlow];
const PylithScalar meanStressTest = (stress[0] + stress[1] + stress[2])/3.0;
- const PylithScalar devStressTest[] = { stress[0] - meanStressTest,
- stress[1] - meanStressTest,
- stress[2] - meanStressTest,
- stress[3],
- stress[4],
- stress[5]};
+ const PylithScalar devStressTest[tensorSize] = {
+ stress[0] - meanStressTest,
+ stress[1] - meanStressTest,
+ stress[2] - meanStressTest,
+ stress[3],
+ stress[4],
+ stress[5]
+ };
const PylithScalar stressInvar2Test =
sqrt(0.5 * scalarProduct3D(devStressTest, devStressTest));
@@ -829,7 +841,7 @@
PylithScalar devPlasticStrainT[tensorSize];
calcDeviatoric3D(devPlasticStrainT, plasticStrainT, meanPlasticStrainT);
- const PylithScalar diag[] = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };
+ const PylithScalar diag[tensorSize] = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };
// Initial stress values
const PylithScalar meanStressInitial = (initialStress[0] +
@@ -852,7 +864,7 @@
const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT -
meanStrainInitial;
- const PylithScalar strainPPTpdt[] =
+ const PylithScalar strainPPTpdt[tensorSize] =
{ totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
devStrainInitial[0],
totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
@@ -861,16 +873,19 @@
devStrainInitial[2],
totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
- totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5] };
+ totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5]
+ };
// Compute trial elastic stresses and yield function to see if yield should
// occur.
- const PylithScalar trialDevStress[] = { strainPPTpdt[0]/ae + devStressInitial[0],
- strainPPTpdt[1]/ae + devStressInitial[1],
- strainPPTpdt[2]/ae + devStressInitial[2],
- strainPPTpdt[3]/ae + devStressInitial[3],
- strainPPTpdt[4]/ae + devStressInitial[4],
- strainPPTpdt[5]/ae + devStressInitial[5]};
+ const PylithScalar trialDevStress[tensorSize] = {
+ strainPPTpdt[0]/ae + devStressInitial[0],
+ strainPPTpdt[1]/ae + devStressInitial[1],
+ strainPPTpdt[2]/ae + devStressInitial[2],
+ strainPPTpdt[3]/ae + devStressInitial[3],
+ strainPPTpdt[4]/ae + devStressInitial[4],
+ strainPPTpdt[5]/ae + devStressInitial[5]
+ };
const PylithScalar trialMeanStress = meanStrainPPTpdt/am + meanStressInitial;
const PylithScalar stressInvar2 =
sqrt(0.5 * scalarProduct3D(trialDevStress, trialDevStress));
@@ -912,25 +927,28 @@
{ 0.0, 0.0, 0.0, 1.0, 0.0, 0.0},
{ 0.0, 0.0, 0.0, 0.0, 1.0, 0.0},
{ 0.0, 0.0, 0.0, 0.0, 0.0, 1.0}};
- const PylithScalar vec1[] = {strainPPTpdt[0] + ae * devStressInitial[0],
- strainPPTpdt[1] + ae * devStressInitial[1],
- strainPPTpdt[2] + ae * devStressInitial[2],
- strainPPTpdt[3] + ae * devStressInitial[3],
- strainPPTpdt[4] + ae * devStressInitial[4],
- strainPPTpdt[5] + ae * devStressInitial[5]};
- const PylithScalar dDdEpsilon[] = {vec1[0]/d,
- vec1[1]/d,
- vec1[2]/d,
- 2.0 * vec1[3]/d,
- 2.0 * vec1[4]/d,
- 2.0 * vec1[5]/d};
- const PylithScalar dLambdadEpsilon[] = {
+ const PylithScalar vec1[tensorSize] = {
+ strainPPTpdt[0] + ae * devStressInitial[0],
+ strainPPTpdt[1] + ae * devStressInitial[1],
+ strainPPTpdt[2] + ae * devStressInitial[2],
+ strainPPTpdt[3] + ae * devStressInitial[3],
+ strainPPTpdt[4] + ae * devStressInitial[4],
+ strainPPTpdt[5] + ae * devStressInitial[5]
+ };
+ const PylithScalar dDdEpsilon[tensorSize] = {vec1[0]/d,
+ vec1[1]/d,
+ vec1[2]/d,
+ 2.0 * vec1[3]/d,
+ 2.0 * vec1[4]/d,
+ 2.0 * vec1[5]/d};
+ const PylithScalar dLambdadEpsilon[tensorSize] = {
plasticFac * (alphaYield/am + dFac * dDdEpsilon[0]),
plasticFac * (alphaYield/am + dFac * dDdEpsilon[1]),
plasticFac * (alphaYield/am + dFac * dDdEpsilon[2]),
plasticFac * ( dFac * dDdEpsilon[3]),
plasticFac * ( dFac * dDdEpsilon[4]),
- plasticFac * ( dFac * dDdEpsilon[5])};
+ plasticFac * ( dFac * dDdEpsilon[5])
+ };
const PylithScalar dFac2 = 1.0/(sqrt(2.0) * d);
PylithScalar dDeltaEdEpsilon = 0.0;
@@ -1061,7 +1079,7 @@
// For now, we are duplicating the functionality of _calcStressElastoplastic,
// since otherwise we would have to redo a lot of calculations.
- const int tensorSize = _tensorSize;
+ const int tensorSize = 6;
const PylithScalar mu = properties[p_mu];
const PylithScalar lambda = properties[p_lambda];
const PylithScalar alphaYield = properties[p_alphaYield];
@@ -1072,19 +1090,21 @@
const PylithScalar ae = 1.0/mu2;
const PylithScalar am = 1.0/(3.0 * bulkModulus);
- const PylithScalar plasticStrainT[] = {stateVars[s_plasticStrain],
- stateVars[s_plasticStrain + 1],
- stateVars[s_plasticStrain + 2],
- stateVars[s_plasticStrain + 3],
- stateVars[s_plasticStrain + 4],
- stateVars[s_plasticStrain + 5]};
+ const PylithScalar plasticStrainT[tensorSize] = {
+ stateVars[s_plasticStrain],
+ stateVars[s_plasticStrain + 1],
+ stateVars[s_plasticStrain + 2],
+ stateVars[s_plasticStrain + 3],
+ stateVars[s_plasticStrain + 4],
+ stateVars[s_plasticStrain + 5]
+ };
const PylithScalar meanPlasticStrainT = (plasticStrainT[0] +
plasticStrainT[1] +
plasticStrainT[2])/3.0;
PylithScalar devPlasticStrainT[tensorSize];
calcDeviatoric3D(devPlasticStrainT, plasticStrainT, meanPlasticStrainT);
- const PylithScalar diag[] = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };
+ const PylithScalar diag[tensorSize] = { 1.0, 1.0, 1.0, 0.0, 0.0, 0.0 };
// Initial stress values
const PylithScalar meanStressInitial = (initialStress[0] +
@@ -1108,25 +1128,28 @@
const PylithScalar meanStrainPPTpdt = meanStrainTpdt - meanPlasticStrainT -
meanStrainInitial;
- const PylithScalar strainPPTpdt[] =
- { totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
- devStrainInitial[0],
- totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
- devStrainInitial[1],
- totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] -
- devStrainInitial[2],
- totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
- totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
- totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5] };
+ const PylithScalar strainPPTpdt[tensorSize] = {
+ totalStrain[0] - meanStrainTpdt - devPlasticStrainT[0] -
+ devStrainInitial[0],
+ totalStrain[1] - meanStrainTpdt - devPlasticStrainT[1] -
+ devStrainInitial[1],
+ totalStrain[2] - meanStrainTpdt - devPlasticStrainT[2] -
+ devStrainInitial[2],
+ totalStrain[3] - devPlasticStrainT[3] - devStrainInitial[3],
+ totalStrain[4] - devPlasticStrainT[4] - devStrainInitial[4],
+ totalStrain[5] - devPlasticStrainT[5] - devStrainInitial[5]
+ };
// Compute trial elastic stresses and yield function to see if yield should
// occur.
- const PylithScalar trialDevStress[] = { strainPPTpdt[0]/ae + devStressInitial[0],
- strainPPTpdt[1]/ae + devStressInitial[1],
- strainPPTpdt[2]/ae + devStressInitial[2],
- strainPPTpdt[3]/ae + devStressInitial[3],
- strainPPTpdt[4]/ae + devStressInitial[4],
- strainPPTpdt[5]/ae + devStressInitial[5]};
+ const PylithScalar trialDevStress[tensorSize] = {
+ strainPPTpdt[0]/ae + devStressInitial[0],
+ strainPPTpdt[1]/ae + devStressInitial[1],
+ strainPPTpdt[2]/ae + devStressInitial[2],
+ strainPPTpdt[3]/ae + devStressInitial[3],
+ strainPPTpdt[4]/ae + devStressInitial[4],
+ strainPPTpdt[5]/ae + devStressInitial[5]
+ };
const PylithScalar trialMeanStress = meanStrainPPTpdt/am + meanStressInitial;
const PylithScalar stressInvar2 =
sqrt(0.5 * scalarProduct3D(trialDevStress, trialDevStress));
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/DruckerPragerPlaneStrain.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -54,7 +54,7 @@
const int numProperties = 6;
/// Physical properties.
- const Metadata::ParamDescription properties[] = {
+ const Metadata::ParamDescription properties[numProperties] = {
{ "density", 1, pylith::topology::FieldBase::SCALAR },
{ "mu", 1, pylith::topology::FieldBase::SCALAR },
{ "lambda", 1, pylith::topology::FieldBase::SCALAR },
@@ -78,7 +78,7 @@
const int numStateVars = 2;
/// State variables.
- const Metadata::ParamDescription stateVars[] = {
+ const Metadata::ParamDescription stateVars[numStateVars] = {
{ "stress_zz_initial", 1, pylith::topology::FieldBase::SCALAR },
{ "plastic_strain", 4, pylith::topology::FieldBase::OTHER }
};
@@ -435,7 +435,7 @@
assert(_numVarsQuadPt == numStateVars);
// It's unclear what to do for an elasto-plastic material, which has no
// inherent time scale. For now, just set dtStable to a large value.
- const PylithScalar dtStable = pylith::PYLITH_MAXDOUBLE;
+ const PylithScalar dtStable = pylith::PYLITH_MAXSCALAR;
return dtStable;
} // _stableTimeStepImplicit
@@ -657,9 +657,10 @@
// time step has already been computed.
} else {
const PylithScalar mu2 = 2.0 * mu;
- const PylithScalar plasticStrainTpdt[tensorSize] = {
+ const PylithScalar plasticStrainTpdt[tensorSizePS] = {
stateVars[s_plasticStrain],
stateVars[s_plasticStrain + 1],
+ stateVars[s_plasticStrain + 2],
stateVars[s_plasticStrain + 3]
};
@@ -667,10 +668,11 @@
initialStrain[0];
const PylithScalar e22 = totalStrain[1] - plasticStrainTpdt[1] -
initialStrain[1];
- const PylithScalar e12 = totalStrain[2] - plasticStrainTpdt[2] -
+ const PylithScalar e33 = -plasticStrainTpdt[2];
+ const PylithScalar e12 = totalStrain[2] - plasticStrainTpdt[3] -
initialStrain[2];
- const PylithScalar traceStrainTpdt = e11 + e22;
+ const PylithScalar traceStrainTpdt = e11 + e22 + e33;
const PylithScalar s12 = lambda * traceStrainTpdt;
stress[0] = s12 + mu2 * e11 + initialStress[0];
@@ -1038,7 +1040,7 @@
PylithScalar devPlasticStrainT[tensorSizePS];
calcDeviatoric2DPS(devPlasticStrainT, plasticStrainT, meanPlasticStrainT);
- const PylithScalar diag[] = { 1.0, 1.0, 1.0, 0.0 };
+ const PylithScalar diag[tensorSizePS] = { 1.0, 1.0, 1.0, 0.0 };
// Initial stress values
const PylithScalar meanStressInitial = (initialStress[0] +
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticIsotropic3D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticIsotropic3D.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticIsotropic3D.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -327,7 +327,7 @@
PylithScalar
pylith::materials::ElasticIsotropic3D::stableTimeStepImplicit(
const topology::Mesh& mesh) {
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
}
// ----------------------------------------------------------------------
@@ -339,7 +339,7 @@
const PylithScalar* stateVars,
const int numStateVars) const
{ // _stableTimeStepImplicit
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticMaterial.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticMaterial.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticMaterial.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "pylith/topology/Mesh.hh" // USES Mesh
#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
#include "pylith/utils/array.hh" // USES scalar_array, std::vector
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/spatialdb/SpatialDB.hh" // USES SpatialDB
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -243,7 +243,7 @@
assert(_initialStressCell.size() == numQuadPts*_tensorSize);
assert(_initialStrainCell.size() == numQuadPts*_tensorSize);
- PylithScalar dtStable = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar dtStable = pylith::PYLITH_MAXSCALAR;
// Get cells associated with material
const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
@@ -304,7 +304,7 @@
return;
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Materials");
+ logger.stagePush("MaterialsFields");
assert(0 != _initialFields);
_initialFields->add("initial stress", "initial_stress");
@@ -450,7 +450,7 @@
return;
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Materials");
+ logger.stagePush("MaterialsFields");
assert(0 != _initialFields);
_initialFields->add("initial strain", "initial_strain");
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStrain.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStrain.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStrain.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -313,7 +313,7 @@
PylithScalar
pylith::materials::ElasticPlaneStrain::stableTimeStepImplicit(
const topology::Mesh& mesh) {
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
}
// ----------------------------------------------------------------------
@@ -325,7 +325,7 @@
const PylithScalar* stateVars,
const int numStateVars) const
{ // _stableTimeStepImplicit
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStress.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStress.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticPlaneStress.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -316,7 +316,7 @@
PylithScalar
pylith::materials::ElasticPlaneStress::stableTimeStepImplicit(
const topology::Mesh& mesh) {
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
}
// ----------------------------------------------------------------------
@@ -328,7 +328,7 @@
const PylithScalar* stateVars,
const int numStateVars) const
{ // _stableTimeStepImplicit
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStrain1D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStrain1D.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStrain1D.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -293,7 +293,7 @@
PylithScalar
pylith::materials::ElasticStrain1D::stableTimeStepImplicit(
const topology::Mesh& mesh) {
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
}
// ----------------------------------------------------------------------
@@ -305,7 +305,7 @@
const PylithScalar* stateVars,
const int numStateVars) const
{ // _stableTimeStepImplicit
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStress1D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStress1D.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/ElasticStress1D.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,7 +23,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -293,7 +293,7 @@
PylithScalar
pylith::materials::ElasticStress1D::stableTimeStepImplicit(
const topology::Mesh& mesh) {
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
}
// ----------------------------------------------------------------------
@@ -305,7 +305,7 @@
const PylithScalar* stateVars,
const int numStateVars) const
{ // _stableTimeStepImplicit
- return pylith::PYLITH_MAXDOUBLE;
+ return pylith::PYLITH_MAXSCALAR;
} // _stableTimeStepImplicit
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellIsotropic3D.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -24,7 +24,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -294,7 +294,7 @@
PylithScalar muRatio = dbValues[db_shearRatio + imodel];
PylithScalar viscosity = dbValues[db_viscosity + imodel];
PylithScalar muFac = muRatio*mu;
- PylithScalar maxwellTime = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar maxwellTime = pylith::PYLITH_MAXSCALAR;
if (muFac > 0.0)
maxwellTime = viscosity / muFac;
if (muRatio < 0.0 || viscosity < 0.0 || muFac < 0.0 || maxwellTime < 0.0) {
@@ -697,7 +697,7 @@
PylithScalar shearRatio = 0.0;
for (int imodel = 0; imodel < numMaxwellModels; ++imodel) {
shearRatio = properties[p_shearRatio + imodel];
- PylithScalar maxwellTime = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar maxwellTime = pylith::PYLITH_MAXSCALAR;
visFrac += shearRatio;
if (shearRatio != 0.0) {
maxwellTime = properties[p_maxwellTime + imodel];
@@ -882,7 +882,7 @@
assert(0 != stateVars);
assert(_numVarsQuadPt == numStateVars);
- PylithScalar dtStable = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar dtStable = pylith::PYLITH_MAXSCALAR;
const int numMaxwellModels = _GenMaxwellIsotropic3D::numMaxwellModels;
for (int i=0; i < numMaxwellModels; ++i) {
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellPlaneStrain.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -24,7 +24,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -289,7 +289,7 @@
PylithScalar muRatio = dbValues[db_shearRatio + imodel];
PylithScalar viscosity = dbValues[db_viscosity + imodel];
PylithScalar muFac = muRatio * mu;
- PylithScalar maxwellTime = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar maxwellTime = pylith::PYLITH_MAXSCALAR;
if (muFac > 0.0)
maxwellTime = viscosity / muFac;
if (muRatio < 0.0 || viscosity < 0.0 || muFac < 0.0 || maxwellTime < 0.0) {
@@ -685,7 +685,7 @@
PylithScalar shearRatio = 0.0;
for (int imodel = 0; imodel < numMaxwellModels; ++imodel) {
shearRatio = properties[p_shearRatio + imodel];
- PylithScalar maxwellTime = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar maxwellTime = pylith::PYLITH_MAXSCALAR;
visFrac += shearRatio;
if (shearRatio != 0.0) {
maxwellTime = properties[p_maxwellTime + imodel];
@@ -830,7 +830,7 @@
assert(0 != stateVars);
assert(_numVarsQuadPt == numStateVars);
- PylithScalar dtStable = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar dtStable = pylith::PYLITH_MAXSCALAR;
const int numMaxwellModels = _GenMaxwellPlaneStrain::numMaxwellModels;
for (int i=0; i < numMaxwellModels; ++i) {
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellQpQsIsotropic3D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellQpQsIsotropic3D.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/GenMaxwellQpQsIsotropic3D.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -24,7 +24,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -350,8 +350,8 @@
PylithScalar bulkRatio = dbValues[db_bulkRatio + imodel];
PylithScalar shearViscosity = dbValues[db_shearViscosity + imodel];
PylithScalar bulkViscosity = dbValues[db_bulkViscosity + imodel];
- PylithScalar maxwellTimeShear = pylith::PYLITH_MAXDOUBLE;
- PylithScalar maxwellTimeBulk = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar maxwellTimeShear = pylith::PYLITH_MAXSCALAR;
+ PylithScalar maxwellTimeBulk = pylith::PYLITH_MAXSCALAR;
maxwellTimeShear = shearViscosity / mu;
maxwellTimeBulk = bulkViscosity / k;
if (shearRatio < 0.0 || shearViscosity < 0.0 || maxwellTimeShear < 0.0 ||
@@ -954,7 +954,7 @@
const int numMaxwellModels = _GenMaxwellQpQsIsotropic3D::numMaxwellModels;
- PylithScalar dtStable = pylith::PYLITH_MAXDOUBLE;
+ PylithScalar dtStable = pylith::PYLITH_MAXSCALAR;
for (int i=0; i < numMaxwellModels; ++i) {
const PylithScalar maxwellTime = properties[p_maxwellTimeShear+i];
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/Material.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/Material.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/Material.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -117,7 +117,7 @@
assert(0 != quadrature);
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Materials");
+ logger.stagePush("MaterialsFields");
// Get quadrature information
const int numQuadPts = quadrature->numQuadPts();
@@ -384,7 +384,7 @@
} // if
if (!useCurrentField) {
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Output");
+ logger.stagePush("OutputFields");
field->newSection(cells, totalFiberDim);
field->allocate();
logger.stagePop();
@@ -454,7 +454,7 @@
} // if
if (!useCurrentField) {
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Output");
+ logger.stagePush("OutputFields");
field->newSection(cells, totalFiberDim);
field->allocate();
logger.stagePop();
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/MaxwellPlaneStrain.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/MaxwellPlaneStrain.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/MaxwellPlaneStrain.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -24,7 +24,7 @@
#include "Metadata.hh" // USES Metadata
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/PowerLaw3D.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/PowerLaw3D.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/materials/PowerLaw3D.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -24,7 +24,7 @@
#include "EffectiveStress.hh" // USES EffectiveStress
#include "pylith/utils/array.hh" // USES scalar_array
-#include "pylith/utils/constdefs.h" // USES PYLITH_MAXDOUBLE
+#include "pylith/utils/constdefs.h" // USES PYLITH_MAXSCALAR
#include "spatialdata/units/Nondimensional.hh" // USES Nondimensional
@@ -420,7 +420,7 @@
const PylithScalar effStress = sqrt(0.5 * devStressProd);
PylithScalar dtTest = 0.0;
if (effStress <= 0.0) {
- dtTest = pylith::PYLITH_MAXDOUBLE;
+ dtTest = pylith::PYLITH_MAXSCALAR;
} else {
dtTest = 0.05 *
pow((referenceStress/effStress), (powerLawExp - 1.0)) *
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/CellFilterAvg.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/CellFilterAvg.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/CellFilterAvg.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -121,7 +121,7 @@
// Allocate field if necessary
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Output");
+ logger.stagePush("OutputFields");
if (0 == _fieldAvg) {
_fieldAvg = new field_type(fieldIn.mesh());
assert(0 != _fieldAvg);
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -146,8 +146,9 @@
CHECK_PETSC_ERROR(err);
// Account for censored cells
- int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
- err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
+ int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+ int cellDepth = 0;
+ err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
const std::string labelName = (0 == label) ?
@@ -379,8 +380,9 @@
const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
field.mesh().sieveMesh();
assert(!sieveMesh.isNull());
- int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
- err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
+ int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+ int cellDepth = 0;
+ err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
const std::string labelName = (0 == label) ?
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5Ext.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterHDF5Ext.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -162,8 +162,9 @@
// Write cells
// Account for censored cells
- int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
- err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
+ int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+ int cellDepth = 0;
+ err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
const std::string labelName = (0 == label) ?
@@ -446,8 +447,9 @@
const ALE::Obj<typename mesh_type::SieveMesh>& sieveMesh =
field.mesh().sieveMesh();
assert(!sieveMesh.isNull());
- int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
- err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
+ int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+ int cellDepth = 0;
+ err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (0 == label) ? cellDepth : labelId;
const std::string labelName = (0 == label) ?
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -255,8 +255,9 @@
// Cannot just use mesh->depth() because boundaries report the wrong thing
const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
assert(!sieveMesh.isNull());
- int cellDepth = (sieveMesh->depth() == -1) ? -1 : 1;
- err = MPI_Allreduce(&cellDepth, &cellDepth, 1, MPI_INT, MPI_MAX,
+ int cellDepthLocal = (sieveMesh->depth() == -1) ? -1 : 1;
+ int cellDepth = 0;
+ err = MPI_Allreduce(&cellDepthLocal, &cellDepth, 1, MPI_INT, MPI_MAX,
sieveMesh->comm());CHECK_PETSC_ERROR(err);
const int depth = (!label) ? cellDepth : labelId;
const std::string labelName = (!label) ?
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/DataWriterVTK.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -37,6 +37,7 @@
friend class TestDataWriterVTKSubMesh; // unit testing
friend class TestDataWriterVTKBCMesh; // unit testing
friend class TestDataWriterVTKFaultMesh; // unit testing
+ friend class TestDataWriterVTKPoints; // unit testing
// PUBLIC METHODS ///////////////////////////////////////////////////////
public :
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/MeshBuilder.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/MeshBuilder.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/MeshBuilder.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -222,7 +222,7 @@
// Memory logging
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
//logger.setDebug(fault->debug()/2);
- logger.stagePush("FaultCreation");
+ logger.stagePush("Creation");
if (0 == rank) {
assert(coordinates.size() == numVertices*spaceDim);
@@ -256,7 +256,7 @@
faultBd = ALE::Selection<SieveFlexMesh>::boundary(tmpMesh);
logger.stagePop();
- logger.stagePush("FaultStratification");
+ logger.stagePush("Stratification");
fault->stratify();
logger.stagePop();
} else {
@@ -265,7 +265,7 @@
faultBd = ALE::Selection<SieveFlexMesh>::boundary(tmpMesh);
logger.stagePop();
- logger.stagePush("FaultStratification");
+ logger.stagePush("Stratification");
fault->getSieve()->setChart(SieveMesh::sieve_type::chart_type());
fault->getSieve()->allocate();
fault->stratify();
@@ -275,20 +275,20 @@
#if defined(ALE_MEM_LOGGING)
std::cout
<< std::endl
- << "FaultCreation " << logger.getNumAllocations("FaultCreation")
- << " allocations " << logger.getAllocationTotal("FaultCreation")
+ << "FaultCreation " << logger.getNumAllocations("Creation")
+ << " allocations " << logger.getAllocationTotal("Creation")
<< " bytes" << std::endl
- << "FaultCreation " << logger.getNumDeallocations("FaultCreation")
- << " deallocations " << logger.getDeallocationTotal("FaultCreation")
+ << "FaultCreation " << logger.getNumDeallocations("Creation")
+ << " deallocations " << logger.getDeallocationTotal("Creation")
<< " bytes" << std::endl
- << "FaultStratification " << logger.getNumAllocations("FaultStratification")
- << " allocations " << logger.getAllocationTotal("FaultStratification")
+ << "FaultStratification " << logger.getNumAllocations("Stratification")
+ << " allocations " << logger.getAllocationTotal("Stratification")
<< " bytes" << std::endl
- << "FaultStratification " << logger.getNumDeallocations("FaultStratification")
- << " deallocations " << logger.getDeallocationTotal("FaultStratification")
+ << "FaultStratification " << logger.getNumDeallocations("Stratification")
+ << " deallocations " << logger.getDeallocationTotal("Stratification")
<< " bytes" << std::endl << std::endl;
#endif
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,7 +85,7 @@
const PylithScalar* points,
const int numPoints,
const int spaceDim)
-{ // createPointsMesh
+{ // setupInterpolator
assert(mesh);
assert(points);
@@ -97,6 +97,10 @@
_pointsMesh->createSieveMesh(meshDim);
assert(_pointsMesh);
+ const spatialdata::geocoords::CoordSys* csMesh = mesh->coordsys();
+ assert(csMesh);
+ assert(csMesh->spaceDim() == spaceDim);
+
scalar_array pointsArray(points, numPoints*spaceDim);
int_array cells(numPoints);
for (int i=0; i < numPoints; ++i)
@@ -123,16 +127,53 @@
assert(cs);
assert(cs->spaceDim() == spaceDim);
- err = DMMeshInterpolationSetDim(dm, spaceDim, _interpolator);CHECK_PETSC_ERROR(err);
- err = DMMeshInterpolationAddPoints(dm, numPoints, (PetscReal*) points, _interpolator);CHECK_PETSC_ERROR(err);
+ err = DMMeshInterpolationSetDim(dm, spaceDim,
+ _interpolator);CHECK_PETSC_ERROR(err);
+ err = DMMeshInterpolationAddPoints(dm, numPoints, (PetscReal*)points,
+ _interpolator);CHECK_PETSC_ERROR(err);
err = DMMeshInterpolationSetUp(dm, _interpolator);CHECK_PETSC_ERROR(err);
err = DMDestroy(&dm);CHECK_PETSC_ERROR(err);
CHECK_PETSC_ERROR(err);
-} // createPointsMesh
+ if (!_fields) {
+ _fields = new topology::Fields<topology::Field<topology::Mesh> >(*_pointsMesh);
+ } // if
+} // setupInterpolator
// ----------------------------------------------------------------------
+// Prepare for output.
+void
+pylith::meshio::OutputSolnPoints::open(const topology::Mesh& mesh,
+ const int numTimeSteps,
+ const char* label,
+ const int labelId)
+{ // open
+ assert(!label);
+ assert(!labelId);
+
+ assert(_pointsMesh);
+ OutputManager<topology::Mesh, topology::Field<topology::Mesh> >::open(*_pointsMesh, numTimeSteps, label, labelId);
+} // open
+
+
+// ----------------------------------------------------------------------
+// Setup file for writing fields at time step.
+void
+pylith::meshio::OutputSolnPoints::openTimeStep(const PylithScalar t,
+ const topology::Mesh& mesh,
+ const char* label,
+ const int labelId)
+{ // openTimeStep
+ assert(!label);
+ assert(!labelId);
+
+ assert(_pointsMesh);
+ OutputManager<topology::Mesh, topology::Field<topology::Mesh> >::openTimeStep(t, *_pointsMesh, label, labelId);
+} // openTimeStep
+
+
+// ----------------------------------------------------------------------
// Append finite-element vertex field to file.
void
pylith::meshio::OutputSolnPoints::appendVertexField(const PylithScalar t,
@@ -148,8 +189,19 @@
pointsSieveMesh->depthStratum(0);
assert(!vertices.isNull());
- const int fiberDim = (vertices->begin() != vertices->end()) ?
- field.section()->getFiberDimension(*vertices->begin()) : 0;
+ const ALE::Obj<SieveMesh>& sieveMesh = _mesh->sieveMesh();
+ assert(!sieveMesh.isNull());
+ const std::string labelName =
+ (sieveMesh->hasLabel("censored depth")) ? "censored depth" : "depth";
+ assert(!sieveMesh->getLabelStratum(labelName, 0).isNull());
+ assert(!field.section().isNull());
+ int fiberDimLocal =
+ (sieveMesh->getLabelStratum(labelName, 0)->size() > 0) ?
+ field.section()->getFiberDimension(*sieveMesh->getLabelStratum(labelName, 0)->begin()) : 0;
+ int fiberDim = 0;
+ MPI_Allreduce(&fiberDimLocal, &fiberDim, 1, MPI_INT, MPI_MAX,
+ field.mesh().comm());
+ assert(fiberDim > 0);
// Create field if necessary for interpolated values or recreate
// field if mismatch in size between buffer and field.
@@ -163,6 +215,7 @@
_fields->get("buffer (interpolated)");
if (vertices->size()*fiberDim != fieldInterp.sectionSize()) {
fieldInterp.newSection(vertices, fiberDim);
+ fieldInterp.label(field.label());
fieldInterp.allocate();
} // if
logger.stagePop();
@@ -170,30 +223,33 @@
fieldInterp.zero();
fieldInterp.vectorFieldType(field.vectorFieldType());
fieldInterp.scale(field.scale());
-
- PetscVec fieldInterpVec = fieldInterp.vector();
+
+ const char* context = field.label();
+ fieldInterp.createScatter(*_pointsMesh, context);
+ PetscVec fieldInterpVec = fieldInterp.vector(context);
assert(fieldInterpVec);
- const ALE::Obj<SieveMesh>& sieveMesh = _mesh->sieveMesh();
- assert(!sieveMesh.isNull());
-
DM dm;
SectionReal section;
PetscErrorCode err = 0;
err = DMMeshCreate(sieveMesh->comm(), &dm);CHECK_PETSC_ERROR(err);
err = DMMeshSetMesh(dm, sieveMesh);CHECK_PETSC_ERROR(err);
- err = DMMeshInterpolationSetDof(dm, fiberDim, _interpolator);CHECK_PETSC_ERROR(err);
+ err = DMMeshInterpolationSetDof(dm, fiberDim,
+ _interpolator);CHECK_PETSC_ERROR(err);
err = SectionRealCreate(sieveMesh->comm(), §ion);CHECK_PETSC_ERROR(err);
err = SectionRealSetSection(section, field.section());CHECK_PETSC_ERROR(err);
err = SectionRealSetBundle(section, sieveMesh);CHECK_PETSC_ERROR(err);
- err = DMMeshInterpolationEvaluate(dm, section, fieldInterpVec, _interpolator);CHECK_PETSC_ERROR(err);
+ err = DMMeshInterpolationEvaluate(dm, section, fieldInterpVec,
+ _interpolator);CHECK_PETSC_ERROR(err);
err = SectionRealDestroy(§ion);CHECK_PETSC_ERROR(err);
err = DMDestroy(&dm);CHECK_PETSC_ERROR(err);
- OutputManager<topology::Mesh, topology::Field<topology::Mesh> >::appendVertexField(t, fieldInterp, mesh);
+ fieldInterp.scatterVectorToSection(context);
+
+ OutputManager<topology::Mesh, topology::Field<topology::Mesh> >::appendVertexField(t, fieldInterp, *_pointsMesh);
} // appendVertexField
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/OutputSolnPoints.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -73,6 +73,32 @@
const int numPoints,
const int spaceDim);
+ /** Prepare for output.
+ *
+ * @param mesh Finite-element mesh object.
+ * @param numTimeSteps Expected number of time steps.
+ * @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 open(const topology::Mesh& mesh,
+ const int numTimeSteps,
+ const char* label =0,
+ const int labelId =0);
+
+ /** Setup file for writing fields at time step.
+ *
+ * @param t Time of time step.
+ * @param mesh Finite-element mesh object.
+ * @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 PylithScalar t,
+ const topology::Mesh& mesh,
+ const char* label =0,
+ const int labelId =0);
+
/** Append finite-element vertex field to file.
*
* @param t Time associated with field.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/VertexFilterVecNorm.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/VertexFilterVecNorm.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/meshio/VertexFilterVecNorm.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -91,7 +91,7 @@
// Allocation field if necessary
ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- logger.stagePush("Output");
+ logger.stagePush("OutputFields");
if (0 == _fieldVecNorm) {
_fieldVecNorm = new field_type(fieldIn.mesh());
_fieldVecNorm->label("vector norm");
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/problems/SolverNonlinear.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/problems/SolverNonlinear.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/problems/SolverNonlinear.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,6 +23,7 @@
#include "Formulation.hh" // USES Formulation
#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
#include "pylith/topology/Jacobian.hh" // USES Jacobian
+#include "pylith/utils/constdefs.h" // USES PYLITH_MAXSCALAR
#include "pylith/utils/EventLogger.hh" // USES EventLogger
#include <petscsnes.h> // USES PetscSNES
@@ -243,7 +244,10 @@
*ynorm = snes->maxstep;
}
ierr = VecMaxPointwiseDivide(y,x,&rellength);CHKERRQ(ierr);
- minlambda = snes->steptol/rellength;
+
+ // Place reasonable absolute limit on minimum lambda
+ minlambda = std::max(snes->steptol/rellength, 1.0/PYLITH_MAXSCALAR);
+
ierr = MatMult(snes->jacobian,y,w);CHKERRQ(ierr);
#if defined(PETSC_USE_COMPLEX)
ierr = VecDot(f,w,&cinitslope);CHKERRQ(ierr);
@@ -325,10 +329,12 @@
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);
}
+#if 0 // DEBUGGING
assert(lsctx);
Formulation* formulation = (Formulation*) lsctx;
assert(formulation);
formulation->printState(&w, &g, &x, &y);
+#endif
#if 0 // Original PETSc code
*flag = PETSC_FALSE; // DIVERGED_LINE_SEARCH
#else
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/Field.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/Field.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/Field.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -169,7 +169,10 @@
*/
int sectionSize(void) const;
- /// Create sieve section.
+ /** Create sieve section.
+ *
+ * @note Don't forget to call label().
+ */
void newSection(void);
/** Create sieve section and set chart and fiber dimesion for
@@ -177,6 +180,8 @@
*
* @param points Points over which to define section.
* @param dim Fiber dimension for section.
+ *
+ * @note Don't forget to call label(), especially if reusing a field.
*/
void newSection(const ALE::Obj<label_sequence>& points,
const int fiberDim);
@@ -186,6 +191,8 @@
*
* @param points Points over which to define section.
* @param dim Fiber dimension for section.
+ *
+ * @note Don't forget to call label(), especially if reusing a field.
*/
void newSection(const int_array& points,
const int fiberDim);
@@ -195,6 +202,8 @@
* @param domain Type of points over which to define section.
* @param dim Fiber dimension for section.
* @param stratum Stratum depth (for vertices) and height (for cells).
+ *
+ * @note Don't forget to call label(), especially if reusing a field.
*/
void newSection(const DomainEnum domain,
const int fiberDim,
@@ -204,6 +213,8 @@
*
* @param sec Field defining layout.
* @param fiberDim Fiber dimension.
+ *
+ * @note Don't forget to call label(), especially if reusing a field.
*/
void newSection(const Field& src,
const int fiberDim);
@@ -214,6 +225,8 @@
* usage.
*
* @param sec Field defining layout.
+ *
+ * @note Don't forget to call label(), especially if reusing a field.
*/
void cloneSection(const Field& src);
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/MeshOrder.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/MeshOrder.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/MeshOrder.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -74,12 +74,11 @@
} else {
const int numCells = cells->size();
const int numVertices = vertices->size();
- const int numEntities = numCells + numVertices;
_cellsNormal = ALE::Interval<point_type>(0, numCells);
_verticesNormal = ALE::Interval<point_type>(numCells, numCells+numVertices);
- _cellsCensored = ALE::Interval<point_type>(numEntities, numEntities);
- _verticesCensored = ALE::Interval<point_type>(numEntities, numEntities);
+ _verticesCensored = ALE::Interval<point_type>(numCells+numVertices, numCells+numVertices);
+ _cellsCensored = ALE::Interval<point_type>(numCells+numVertices, numCells+numVertices);
} // if/else
} // initialize
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -126,6 +126,24 @@
*/
int dimension(void) const;
+ /** Get representative cone size for mesh.
+ *
+ * @returns Representative cone size for mesh.
+ */
+ int coneSize(void) const;
+
+ /** Get number of vertices in mesh.
+ *
+ * @returns Number of vertices in mesh.
+ */
+ int numVertices(void) const;
+
+ /** Get number of cells in mesh.
+ *
+ * @returns Number of cells in mesh.
+ */
+ int numCells(void) const;
+
/** Get MPI communicator associated with mesh.
*
* @returns MPI communicator.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.icc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.icc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/topology/SubMesh.icc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -64,6 +64,29 @@
return (!_mesh.isNull()) ? _mesh->getDimension() : 0;
}
+// Get representative cone size for mesh.
+inline
+int
+pylith::topology::SubMesh::coneSize(void) const {
+
+ return (!_mesh.isNull() && numCells() > 0) ?
+ _mesh->getSieve()->getConeSize(*_mesh->heightStratum(1)->begin()) : 0;
+}
+
+// Get number of vertices in mesh.
+inline
+int
+pylith::topology::SubMesh::numVertices(void) const {
+ return (!_mesh.isNull() && _mesh->depth() > 0) ? _mesh->depthStratum(0)->size() : 0;
+}
+
+// Get number of cells in mesh.
+inline
+int
+pylith::topology::SubMesh::numCells(void) const {
+ return (!_mesh.isNull() && _mesh->height() > 0) ? _mesh->heightStratum(1)->size() : 0;
+}
+
// Get MPI communicator associated with mesh.
inline
const MPI_Comm
Modified: short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/utils/constdefs.h
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/utils/constdefs.h 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/libsrc/pylith/utils/constdefs.h 2012-02-24 21:37:42 UTC (rev 19678)
@@ -28,9 +28,9 @@
#include "types.hh" // HASA PylithScalar
namespace pylith {
- static const double PYLITH_MAXDOUBLE = 1.0e+30;
+ static const double PYLITH_MAXDOUBLE = 1.0e+99;
static const float PYLITH_MAXFLOAT = 1.0e+30;
- static const PylithScalar PYLITH_MAXSCALAR = 1.0e+30;
+ static const PylithScalar PYLITH_MAXSCALAR = (sizeof(PylithScalar) == sizeof(double)) ? PYLITH_MAXDOUBLE : PYLITH_MAXSCALAR;
}
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/Fault.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/Fault.i 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/Fault.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -65,13 +65,38 @@
*/
const char* label(void) const;
- /** Get the number of vertices on the fault.
+ /** Get dimension of mesh.
*
+ * @returns Dimension of mesh.
+ */
+ int dimension(void) const;
+
+ /** Get representative cone size for mesh.
+ *
+ * @returns Representative cone size for mesh.
+ */
+ int coneSize(void) const;
+
+ /** Get number of vertices in mesh.
+ *
+ * @returns Number of vertices in mesh.
+ */
+ int numVertices(void) const;
+
+ /** Get number of cells in mesh.
+ *
+ * @returns Number of cells in mesh.
+ */
+ int numCells(void) const;
+
+ /** Get the number of vertices associated with the fault (before
+ * fault mesh exists).
+ *
* @param mesh PETSc mesh
* @return Number of vertices on the fault.
*/
virtual
- int numVertices(const topology::Mesh& mesh) const = 0;
+ int numVerticesNoMesh(const topology::Mesh& mesh) const = 0;
/** Adjust mesh topology for fault implementation.
*
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/FaultCohesive.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/FaultCohesive.i 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/faults/FaultCohesive.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -63,12 +63,13 @@
*/
void faultMeshFilename(const char* filename);
- /** Get the number of vertices on the fault.
+ /** Get the number of vertices associated with the fault (before
+ * fault mesh exists).
*
* @param mesh PETSc mesh
* @return Number of vertices on the fault.
*/
- int numVertices(const topology::Mesh& mesh) const;
+ int numVerticesNoMesh(const topology::Mesh& mesh) const;
/** Adjust mesh topology for fault implementation.
*
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/RateStateAgeing.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/RateStateAgeing.i 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/RateStateAgeing.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -90,6 +90,24 @@
const PylithScalar* stateVars,
const int numStateVars);
+ /** Update state variables (for next time step).
+ *
+ * @param slip Current slip at location.
+ * @param slipRate Current slip rate at location.
+ * @param normalTraction Normal traction at location.
+ * @param stateVars State variables at location.
+ * @param numStateVars Number of state variables.
+ * @param properties Properties at location.
+ * @param numProperties Number of properties.
+ */
+ void _updateStateVars(const PylithScalar slip,
+ const PylithScalar slipRate,
+ const PylithScalar normalTraction,
+ PylithScalar* const stateVars,
+ const int numStateVars,
+ const PylithScalar* properties,
+ const int numProperties);
+
}; // class RateStateAgeing
} // friction
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/SlipWeakening.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/SlipWeakening.i 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/SlipWeakening.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -89,6 +89,24 @@
const PylithScalar* stateVars,
const int numStateVars);
+ /** Update state variables (for next time step).
+ *
+ * @param slip Current slip at location.
+ * @param slipRate Current slip rate at location.
+ * @param normalTraction Normal traction at location.
+ * @param stateVars State variables at location.
+ * @param numStateVars Number of state variables.
+ * @param properties Properties at location.
+ * @param numProperties Number of properties.
+ */
+ void _updateStateVars(const PylithScalar slip,
+ const PylithScalar slipRate,
+ const PylithScalar normalTraction,
+ PylithScalar* const stateVars,
+ const int numStateVars,
+ const PylithScalar* properties,
+ const int numProperties);
+
}; // class SlipWeakening
} // friction
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/friction/TimeWeakening.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -83,6 +83,24 @@
const PylithScalar* stateVars,
const int numStateVars);
+ /** Update state variables (for next time step).
+ *
+ * @param slip Current slip at location.
+ * @param slipRate Current slip rate at location.
+ * @param normalTraction Normal traction at location.
+ * @param stateVars State variables at location.
+ * @param numStateVars Number of state variables.
+ * @param properties Properties at location.
+ * @param numProperties Number of properties.
+ */
+ void _updateStateVars(const PylithScalar slip,
+ const PylithScalar slipRate,
+ const PylithScalar normalTraction,
+ PylithScalar* const stateVars,
+ const int numStateVars,
+ const PylithScalar* properties,
+ const int numProperties);
+
}; // class TimeWeakening
} // friction
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/topology/SubMesh.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/topology/SubMesh.i 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/topology/SubMesh.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -81,6 +81,24 @@
*/
int dimension(void) const;
+ /** Get representative cone size for mesh.
+ *
+ * @returns Representative cone size for mesh.
+ */
+ int coneSize(void) const;
+
+ /** Get number of vertices in mesh.
+ *
+ * @returns Number of vertices in mesh.
+ */
+ int numVertices(void) const;
+
+ /** Get number of cells in mesh.
+ *
+ * @returns Number of cells in mesh.
+ */
+ int numCells(void) const;
+
/** Get MPI communicator associated with mesh.
*
* @returns MPI communicator.
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/Makefile.am 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/Makefile.am 2012-02-24 21:37:42 UTC (rev 19678)
@@ -41,7 +41,8 @@
utils.i \
pylith_general.i \
EventLogger.i \
- TestArray.i
+ TestArray.i \
+ constdefs.i
utils_swig_generated = \
utils_wrap.cxx \
Copied: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/constdefs.i (from rev 19669, short/3D/PyLith/trunk/modulesrc/utils/constdefs.i)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/constdefs.i (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/constdefs.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,58 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+/**
+ * @file modulesrc/utils/constdefs.i
+ *
+ * @brief PyLith constants.
+ */
+
+// ----------------------------------------------------------------------
+// PYLITH_MAXDOUBLE
+%inline %{
+ double
+ maxdouble(void)
+ { // maxdouble
+ return pylith::PYLITH_MAXDOUBLE;
+ } // maxdouble
+%} // inline
+
+
+// ----------------------------------------------------------------------
+// PYLITH_MAXFLOAT
+%inline %{
+ float
+ maxfloat(void)
+ { // maxfloat
+ return pylith::PYLITH_MAXFLOAT;
+ } // maxfloat
+%} // inline
+
+
+// ----------------------------------------------------------------------
+// PYLITH_MAXSCALAR
+%inline %{
+ double
+ maxscalar(void)
+ { // maxscalar
+ return pylith::PYLITH_MAXSCALAR;
+ } // maxscalar
+%} // inline
+
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/utils.i
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/utils.i 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/modulesrc/utils/utils.i 2012-02-24 21:37:42 UTC (rev 19678)
@@ -23,6 +23,7 @@
%{
#include "pylith/utils/EventLogger.hh"
#include "pylith/utils/TestArray.hh"
+#include "pylith/utils/constdefs.h"
#include <petsclog.h> // USES PetscLogEventBegin/End() in inline methods
#include "pylith/utils/arrayfwd.hh" // USES scalar_array
@@ -56,6 +57,7 @@
%include "pylith_general.i"
%include "EventLogger.i"
%include "TestArray.i"
+%include "constdefs.i"
// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/AbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/AbsorbingDampers.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/AbsorbingDampers.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -119,6 +119,12 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing absorbing boundary '%s'." % self.label())
+
Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
BoundaryCondition.initialize(self, totalTime, numTimeSteps, normalizer)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBC.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBC.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBC.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -92,6 +92,12 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing Dirichlet boundary '%s'." % self.label())
+
self.normalizer(normalizer)
BoundaryCondition.initialize(self, totalTime, numTimeSteps, normalizer)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBoundary.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBoundary.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/DirichletBoundary.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -112,8 +112,13 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing Dirichlet boundary '%s'." % self.label())
+
DirichletBC.initialize(self, totalTime, numTimeSteps, normalizer)
-
self.output.initialize(normalizer)
self.output.writeInfo()
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/Neumann.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/Neumann.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/Neumann.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -121,6 +121,12 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing Neumann boundary '%s'." % self.label())
+
Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
BoundaryCondition.initialize(self, totalTime, numTimeSteps, normalizer)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/PointForce.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/PointForce.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/bc/PointForce.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -80,6 +80,12 @@
logEvent = "%sinit" % self._loggingPrefix
self._eventLogger.eventBegin(logEvent)
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+
+ if 0 == comm.rank:
+ self._info.log("Initializing point forces '%s'." % self.label())
+
Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
BoundaryCondition.initialize(self, totalTime, numTimeSteps, normalizer)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveDyn.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -91,7 +91,7 @@
"slip_rate",
"traction"]},
'cell': \
- {'info': ["distribution"],
+ {'info': ["partition"],
'data': []}}
return
@@ -154,8 +154,7 @@
if 0 == comm.rank:
self._info.log("Initializing fault '%s'." % self.label())
- Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
-
+ Integrator.initialize(self, totalTime, numTimeSteps, normalizer)
FaultCohesive.initialize(self, totalTime, numTimeSteps, normalizer)
self._eventLogger.eventEnd(logEvent)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/faults/FaultCohesiveKin.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -92,7 +92,7 @@
'data': ["slip",
"traction_change"]},
'cell': \
- {'info': ["distribution"],
+ {'info': ["partition"],
'data': []}}
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultDyn.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -59,8 +59,7 @@
"traction"])
vertexDataFields.meta['tip'] = "Names of vertex data fields to output."
- cellInfoFields = pyre.inventory.list("cell_info_fields",
- default=["distribution"])
+ cellInfoFields = pyre.inventory.list("cell_info_fields", default=[])
cellInfoFields.meta['tip'] = "Names of cell info fields to output."
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/OutputFaultKin.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -61,8 +61,7 @@
"traction_change"])
vertexDataFields.meta['tip'] = "Names of vertex data fields to output."
- cellInfoFields = pyre.inventory.list("cell_info_fields",
- default=["distribution"])
+ cellInfoFields = pyre.inventory.list("cell_info_fields", default=[])
cellInfoFields.meta['tip'] = "Names of cell info fields to output."
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/PointsList.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/PointsList.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/meshio/PointsList.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -57,7 +57,8 @@
import pyre.inventory
- filename = pyre.inventory.str("filename", default="", validator=validateFilename)
+ filename = pyre.inventory.str("filename", default="",
+ validator=validateFilename)
filename.meta['tip'] = "Filename for list of points."
commentDelimiter = pyre.inventory.str("comment_delimiter", default="#")
@@ -86,7 +87,8 @@
points = numpy.loadtxt(self.filename, comments=self.commentDelimiter)
else:
points = numpy.loadtxt(self.filename,
- comments=self.commentDelimiter, delimiter=self.valueDelimiter)
+ comments=self.commentDelimiter,
+ delimiter=self.valueDelimiter)
return points
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Fault.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Fault.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Fault.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -26,19 +26,45 @@
"""
Fault object for holding mesh memory and performance information.
"""
- def __init__(self):
+ def __init__(self, dimension=0, maxConeSize=0, numVertices=0, numCells=0):
"""
Constructor.
"""
+ self.dimension = dimension
+ self.coneSize = maxConeSize
+ self.nvertices = numVertices
+ self.ncells = numCells
+ self.cellType = None
+ self.initialize()
return
+ def initialize(self):
+ """
+ Initialize application.
+ """
+ from Mesh import cellTypes
+ try:
+ if self.coneSize > 0:
+ self.cellType = cellTypes[(self.dimension,self.coneSize)]
+ except:
+ raise ValueError("Unknown cell type '%s' for dim %d and cone size %d." %\
+ (self.cellType,self.dimension,self.coneSize))
+ return
+
+
def tabulate(self, memDict):
"""
Tabulate memory use.
"""
- memDict['Creation'] = 0
- memDict['Stratification'] = 0
- memDict['Coordinates'] = 0
+ dim = self.dimension
+ ncells = self.ncells
+ nvertices = self.nvertices
+ coneSize = self.coneSize
+
+ memDict['Creation'] = self.sizeInt * (2 * (coneSize*ncells + nvertices + ncells) + coneSize*ncells)
+ memDict['Stratification'] = 2 * self.sizeArrow * (nvertices + ncells)
+ memDict['Coordinates'] = (self.sizeDouble * dim * nvertices) + (2 * self.sizeInt * nvertices) + (2 * self.sizeInt * nvertices)
+
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/MemoryLogger.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/MemoryLogger.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/MemoryLogger.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -145,10 +145,12 @@
import pylith.perf.Field
if not stage in self.memory: self.memory[stage] = {}
+ if not 'Fields' in self.memory[stage]:
+ self.memory[stage]['Fields'] = {}
if not field is None:
fieldModel = pylith.perf.Field.Field(field.label(), field.sectionSize(),
field.chartSize())
- fieldModel.tabulate(self.memory[stage])
+ fieldModel.tabulate(self.memory[stage]['Fields'])
return
@@ -183,7 +185,8 @@
import pylith.perf.Fault
if not stage in self.memory: self.memory[stage] = {}
- faultModel = pylith.perf.Fault.Fault()
+ faultModel = pylith.perf.Fault.Fault(mesh.dimension(), mesh.coneSize(),
+ mesh.numVertices(), mesh.numCells())
faultModel.tabulate(self.memory[stage])
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Mesh.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Mesh.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/perf/Mesh.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -22,59 +22,65 @@
from Memory import Memory
+cellTypes = {(1,2): 'line2',
+ (1,3): 'line3',
+ (2,3): 'tri3',
+ (2,6): 'tri6',
+ (2,4): 'quad4',
+ (2,9): 'quad9',
+ (3,4): 'tet4',
+ (3,8): 'hex8',
+ (3,10): 'tet10',
+ (3,27): 'hex27'
+ }
+
+
class Mesh(Memory):
- cellTypes = {(1,2): 'line2',
- (1,3): 'line3',
- (2,3): 'tri3',
- (2,6): 'tri6',
- (2,4): 'quad4',
- (2,9): 'quad9',
- (3,4): 'tet4',
- (3,8): 'hex8',
- (3,10): 'tet10',
- (3,27): 'hex27'
- }
-
"""
Mesh object for holding mesh memory and performance information.
"""
- def __init__(self, dimension = 0, maxConeSize = 0, numVertices = 0, numCells = 0):
+
+ def __init__(self, dimension=0, maxConeSize=0, numVertices=0, numCells=0):
"""
Constructor.
"""
self.dimension = dimension
- self.coneSize = maxConeSize
+ self.coneSize = maxConeSize
self.nvertices = numVertices
- self.ncells = numCells
- self.cellType = None
+ self.ncells = numCells
+ self.cellType = None
self.initialize()
return
+
def cellTypeInfo(cls, cellType):
for k,cT in cls.cellTypes.iteritems():
if cT == cellType:
return k
raise ValueError("Unknown cell type '%s'." % cellType)
+
def initialize(self):
"""
Initialize application.
"""
try:
if self.coneSize > 0:
- self.cellType = self.cellTypes[(self.dimension,self.coneSize)]
+ self.cellType = cellTypes[(self.dimension,self.coneSize)]
except:
- raise ValueError("Unknown cell type '%s' for dim %d and cone size %d." % (self.cellType,self.dimension,self.coneSize))
+ raise ValueError("Unknown cell type '%s' for dim %d and cone size %d." %\
+ (self.cellType,self.dimension,self.coneSize))
return
+
def tabulate(self, memDict):
"""
Tabulate memory use.
"""
- memDict['Creation'] = self.sizeInt * (2 * (self.coneSize*self.ncells + self.nvertices + self.ncells) + self.coneSize*self.ncells)
+ memDict['Creation'] = self.sizeInt * (2 * (self.coneSize*self.ncells + self.nvertices + self.ncells) + self.coneSize*self.ncells)
memDict['Stratification'] = 2 * self.sizeArrow * (self.nvertices + self.ncells)
# Here we have data + atlas (could use uniform) + bc (could use Section)
- memDict['Coordinates'] = (self.sizeDouble * self.dimension * self.nvertices) + (2 * self.sizeInt * self.nvertices) + (2 * self.sizeInt * self.nvertices)
+ memDict['Coordinates'] = (self.sizeDouble * self.dimension * self.nvertices) + (2 * self.sizeInt * self.nvertices) + (2 * self.sizeInt * self.nvertices)
memDict['Overlap'] = 0 # Don't know overlap
memDict['RealSections'] = 0 # Real sections should be elsewhere
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/Mesh.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/Mesh.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/Mesh.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -74,33 +74,6 @@
return
- def dimension(self):
- """
- Return the topological mesh dimension
- """
- return ModuleMesh.dimension(self)
-
-
- def coneSize(self):
- """
- Return the representative cone size, or number of vertices on a cell
- """
- return ModuleMesh.coneSize(self)
-
-
- def numVertices(self):
- """
- Return the number of vertices.
- """
- return ModuleMesh.numVertices(self)
-
-
- def numCells(self):
- """
- Return the number of cells.
- """
- return ModuleMesh.numCells(self)
-
def groupSizes(self):
"""
Return the name and number of vertices for each group
@@ -111,4 +84,5 @@
groups.append((name,ModuleMesh.groupSize(self, name)))
return groups
+
# End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/MeshGenerator.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/MeshGenerator.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/topology/MeshGenerator.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -113,13 +113,13 @@
for interface in interfaces:
if 0 == comm.rank:
self._info.log("Counting vertices for fault '%s'." % interface.label())
- nvertices = interface.numVertices(mesh)
+ nvertices = interface.numVerticesNoMesh(mesh)
firstLagrangeVertex += nvertices
firstFaultCell += nvertices
if interface.useLagrangeConstraints():
firstFaultCell += nvertices
for interface in interfaces:
- nvertices = interface.numVertices(mesh)
+ nvertices = interface.numVerticesNoMesh(mesh)
if 0 == comm.rank:
self._info.log("Adjusting topology for fault '%s' with %d vertices." % \
(interface.label(), nvertices))
Modified: short/3D/PyLith/branches/pylith-scecdynrup/pylith/utils/profiling.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/pylith/utils/profiling.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/pylith/utils/profiling.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -16,7 +16,7 @@
# ----------------------------------------------------------------------
#
-## @file pylith/utils/profile.py
+## @file pylith/utils/profiling.py
# ----------------------------------------------------------------------
def resourceUsage():
@@ -42,7 +42,11 @@
"""
Get CPU time and memory usage as a string.
"""
- return "CPU time: %s, Memory usage: %.2f MB" % resourceUsage()
+ from pylith.mpi.Communicator import mpi_comm_world
+ comm = mpi_comm_world()
+ (cputime, memory) = resourceUsage()
+ return "[%d] CPU time: %s, Memory usage: %.2f MB" % \
+ (comm.rank, cputime, memory)
# End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/plot_friction.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/plot_friction.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/plot_friction.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-sim = "ratestate_weak"
+sim = "ratestate_stable"
# ======================================================================
import tables
Modified: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/pylithapp.cfg 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/frictionslide/pylithapp.cfg 2012-02-24 21:37:42 UTC (rev 19678)
@@ -78,7 +78,7 @@
[pylithapp.timedependent.interfaces]
fault = pylith.faults.FaultCohesiveDyn
-fault.zero_tolerance = 1.0e-12
+fault.zero_tolerance = 1.0e-13
[pylithapp.timedependent.interfaces.fault]
id = 100
Copied: short/3D/PyLith/branches/pylith-scecdynrup/tests/2d/plasticity (from rev 19669, short/3D/PyLith/trunk/tests/2d/plasticity)
Modified: short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/cyclicfriction/pylithapp.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/cyclicfriction/pylithapp.cfg 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/3d/cyclicfriction/pylithapp.cfg 2012-02-24 21:37:42 UTC (rev 19678)
@@ -33,7 +33,7 @@
# problem
# ----------------------------------------------------------------------
[pylithapp.timedependent.formulation.time_step]
-total_time = 60.0*hour ; total time of simulation
+total_time = 90.0*hour ; total time of simulation
dt = 1.0*hour
[pylithapp.timedependent.normalizer]
@@ -74,7 +74,7 @@
db_change = spatialdata.spatialdb.UniformDB
db_change.label = Amplitude of Dirichlet BC on +x
db_change.values = [displacement-x,displacement-y,displacement-z,change-start-time]
-db_change.data = [-0.5*m,-0.2*m,0.0*m,0.0*hour]
+db_change.data = [-0.5*m,-0.3*m,0.0*m,0.0*hour]
th_change = spatialdata.spatialdb.TimeHistory
th_change.label = Time history of tidal load
@@ -89,7 +89,7 @@
db_change = spatialdata.spatialdb.UniformDB
db_change.label = Amplitude of Dirichlet BC on -x
db_change.values = [displacement-x,displacement-y,displacement-z,change-start-time]
-db_change.data = [+0.5*m,+0.2*m,0.0*m,0.0*hour]
+db_change.data = [+0.5*m,+0.3*m,0.0*m,0.0*hour]
th_change = spatialdata.spatialdb.TimeHistory
th_change.label = Time history of tidal load
@@ -114,7 +114,7 @@
[pylithapp.timedependent.interfaces.fault]
label = fault
-zero_tolerance = 1.0e-10
+zero_tolerance = 1.0e-12
friction = pylith.friction.SlipWeakening
friction.label = Slip weakening
@@ -171,7 +171,7 @@
sub_pc_factor_shift_type = nonzero
# Convergence parameters.
-ksp_rtol = 1.0e-10
+ksp_rtol = 1.0e-12
ksp_atol = 1.0e-12
ksp_max_it = 100
ksp_gmres_restart = 50
@@ -182,11 +182,12 @@
ksp_converged_reason = true
# Nonlinear solver monitoring options.
-snes_rtol = 1.0e-10
-snes_atol = 1.0e-9
+snes_rtol = 1.0e-12
+snes_atol = 1.0e-10
snes_max_it = 100
snes_monitor = true
snes_ls_monitor = true
+#snes_steptol = 1.0e-20
#snes_view = true
snes_converged_reason = true
snes_monitor_solution_update = true
Modified: short/3D/PyLith/branches/pylith-scecdynrup/tests/topology/test_meshmem.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/tests/topology/test_meshmem.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/tests/topology/test_meshmem.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -60,8 +60,9 @@
Run test.
"""
- filenameIn = "data/tet4.exo"
+ #filenameIn = "data/tet4.exo"
#filenameIn = "tri3_200m_gradient.exo"
+ filenameIn = "tet4_150m.exo"
from pylith.perf.MemoryLogger import MemoryLogger
self.logger = MemoryLogger()
@@ -135,22 +136,22 @@
mesh = dmesh
- # Refine mesh (if necessary)
- from pylith.topology.RefineUniform import RefineUniform
- refiner = RefineUniform()
- rmesh = refiner.refine(mesh)
- rmesh.memLoggingStage = "RefinedMesh"
+ if False: # Refine mesh (if necessary)
+ from pylith.topology.RefineUniform import RefineUniform
+ refiner = RefineUniform()
+ rmesh = refiner.refine(mesh)
+ rmesh.memLoggingStage = "RefinedMesh"
- print "Unrefined mesh logging stage",mesh.memLoggingStage
- self.logger.logMesh(mesh.memLoggingStage, mesh)
- material.ncells = MeshOps_numMaterialCells(mesh, material.id())
- self.logger.logMaterial(mesh.memLoggingStage, material)
+ print "Unrefined mesh logging stage",mesh.memLoggingStage
+ self.logger.logMesh(mesh.memLoggingStage, mesh)
+ material.ncells = MeshOps_numMaterialCells(mesh, material.id())
+ self.logger.logMaterial(mesh.memLoggingStage, material)
- self.logger.logMesh(rmesh.memLoggingStage, rmesh)
- material.ncells = MeshOps_numMaterialCells(rmesh, material.id())
- self.logger.logMaterial(rmesh.memLoggingStage, material)
+ self.logger.logMesh(rmesh.memLoggingStage, rmesh)
+ material.ncells = MeshOps_numMaterialCells(rmesh, material.id())
+ self.logger.logMaterial(rmesh.memLoggingStage, material)
- self._showStatus("After refining mesh")
+ self._showStatus("After refining mesh")
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/faults/data/CohesiveDynDataHex8.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/faults/data/CohesiveDynDataHex8.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -1086,6 +1086,246 @@
4.1, 5.2, 5.3,
5.4, 5.5, 5.6,
7.7, 5.8, 5.9,
+ 0.0, 0.0, 0.0, // 18x
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 18y
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 18z
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 19x
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 19y
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 19z
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 20x
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 20y
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 20z
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 21x
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 21y
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0, // 21z
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
};
const PylithScalar pylith::faults::CohesiveDynDataHex8::_orientation[] = {
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/StaticFrictionData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/StaticFrictionData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/friction/data/StaticFrictionData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,7 +85,7 @@
const PylithScalar pylith::friction::StaticFrictionData::_friction[] = {
1000001.32,
- 0.0,
+ 1.0e+6,
};
const PylithScalar pylith::friction::StaticFrictionData::_slip[] = {
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDep.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDep.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDep.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -189,7 +189,7 @@
plasStrainB,
initialStressB, initialStrainB)
- self.dtStableImplicit = 1.0e30
+ self.dtStableImplicit = 1.0e+99
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDepData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDepData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPrager3DTimeDepData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -45,7 +45,7 @@
const PylithScalar pylith::materials::DruckerPrager3DTimeDepData::_densityScale = 1.00000000e+03;
-const PylithScalar pylith::materials::DruckerPrager3DTimeDepData::_dtStableImplicit = 1.00000000e+30;
+const PylithScalar pylith::materials::DruckerPrager3DTimeDepData::_dtStableImplicit = 1.00000000e+99;
const int pylith::materials::DruckerPrager3DTimeDepData::_numPropertyValues[] = {
1,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPragerPlaneStrainTimeDepData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPragerPlaneStrainTimeDepData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/DruckerPragerPlaneStrainTimeDepData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -45,7 +45,7 @@
const PylithScalar pylith::materials::DruckerPragerPlaneStrainTimeDepData::_densityScale = 1.00000000e+03;
-const PylithScalar pylith::materials::DruckerPragerPlaneStrainTimeDepData::_dtStableImplicit = 1.00000000e+30;
+const PylithScalar pylith::materials::DruckerPragerPlaneStrainTimeDepData::_dtStableImplicit = 1.00000000e+99;
const int pylith::materials::DruckerPragerPlaneStrainTimeDepData::_numPropertyValues[] = {
1,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticIsotropic3DData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticIsotropic3DData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticIsotropic3DData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -45,7 +45,7 @@
const PylithScalar pylith::materials::ElasticIsotropic3DData::_densityScale = 1.00000000e+03;
-const PylithScalar pylith::materials::ElasticIsotropic3DData::_dtStableImplicit = 1.00000000e+30;
+const PylithScalar pylith::materials::ElasticIsotropic3DData::_dtStableImplicit = 1.00000000e+99;
const int pylith::materials::ElasticIsotropic3DData::_numPropertyValues[] = {
1,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticMaterialApp.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticMaterialApp.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticMaterialApp.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -88,7 +88,7 @@
self.densityScale = 0
# Elastic material information
- self.dtStableImplicit = 1.0e+30
+ self.dtStableImplicit = 1.0e+99
self.density = None
self.strain = None
self.stress = None
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStrainData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStrainData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStrainData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -45,7 +45,7 @@
const PylithScalar pylith::materials::ElasticPlaneStrainData::_densityScale = 1.00000000e+03;
-const PylithScalar pylith::materials::ElasticPlaneStrainData::_dtStableImplicit = 1.00000000e+30;
+const PylithScalar pylith::materials::ElasticPlaneStrainData::_dtStableImplicit = 1.00000000e+99;
const int pylith::materials::ElasticPlaneStrainData::_numPropertyValues[] = {
1,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStressData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStressData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticPlaneStressData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -45,7 +45,7 @@
const PylithScalar pylith::materials::ElasticPlaneStressData::_densityScale = 1.00000000e+03;
-const PylithScalar pylith::materials::ElasticPlaneStressData::_dtStableImplicit = 1.00000000e+30;
+const PylithScalar pylith::materials::ElasticPlaneStressData::_dtStableImplicit = 1.00000000e+99;
const int pylith::materials::ElasticPlaneStressData::_numPropertyValues[] = {
1,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStrain1DData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStrain1DData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStrain1DData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -45,7 +45,7 @@
const PylithScalar pylith::materials::ElasticStrain1DData::_densityScale = 1.00000000e+03;
-const PylithScalar pylith::materials::ElasticStrain1DData::_dtStableImplicit = 1.00000000e+30;
+const PylithScalar pylith::materials::ElasticStrain1DData::_dtStableImplicit = 1.00000000e+99;
const int pylith::materials::ElasticStrain1DData::_numPropertyValues[] = {
1,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStress1DData.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStress1DData.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/materials/data/ElasticStress1DData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -45,7 +45,7 @@
const PylithScalar pylith::materials::ElasticStress1DData::_densityScale = 1.00000000e+03;
-const PylithScalar pylith::materials::ElasticStress1DData::_dtStableImplicit = 1.00000000e+30;
+const PylithScalar pylith::materials::ElasticStress1DData::_dtStableImplicit = 1.00000000e+99;
const int pylith::materials::ElasticStress1DData::_numPropertyValues[] = {
1,
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/Makefile.am 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/Makefile.am 2012-02-24 21:37:42 UTC (rev 19678)
@@ -49,10 +49,20 @@
TestOutputSolnPoints.cc \
TestDataWriterVTKFaultMesh.cc \
TestDataWriterVTKFaultMeshCases.cc \
+ TestDataWriterPoints.cc \
+ TestDataWriterVTKPoints.cc \
+ TestDataWriterVTKPointsCases.cc \
test_meshio.cc
noinst_HEADERS = \
+ TestMeshIO.hh \
+ TestMeshIOAscii.hh \
+ TestMeshIOLagrit.hh \
+ TestOutputManager.hh \
+ TestOutputSolnSubset.hh \
+ TestOutputSolnPoints.hh \
+ TestVertexFilterVecNorm.hh \
TestCellFilterAvg.hh \
TestDataWriterMesh.hh \
TestDataWriterVTK.hh \
@@ -68,13 +78,9 @@
TestDataWriterVTKFaultMeshCases.hh \
TestDataWriterVTKBCMesh.hh \
TestDataWriterVTKBCMeshCases.hh \
- TestMeshIO.hh \
- TestMeshIOAscii.hh \
- TestMeshIOLagrit.hh \
- TestOutputManager.hh \
- TestOutputSolnSubset.hh \
- TestOutputSolnPoints.hh \
- TestVertexFilterVecNorm.hh
+ TestDataWriterPoints.hh \
+ TestDataWriterVTKPoints.hh \
+ TestDataWriterVTKPointsCases.hh
# Source files associated with testing data
@@ -126,6 +132,16 @@
data/DataWriterHDF5DataFaultMeshQuad4.cc \
data/DataWriterHDF5DataFaultMeshTet4.cc \
data/DataWriterHDF5DataFaultMeshHex8.cc \
+ data/OutputSolnPointsData.cc \
+ data/OutputSolnPointsDataTri3.cc \
+ data/OutputSolnPointsDataQuad4.cc \
+ data/OutputSolnPointsDataTet4.cc \
+ data/OutputSolnPointsDataHex8.cc \
+ data/DataWriterDataPoints.cc \
+ data/DataWriterVTKDataPointsTri3.cc \
+ data/DataWriterVTKDataPointsQuad4.cc \
+ data/DataWriterVTKDataPointsTet4.cc \
+ data/DataWriterVTKDataPointsHex8.cc \
data/MeshData.cc \
data/MeshData1D.cc \
data/MeshData1Din3D.cc \
@@ -189,6 +205,16 @@
data/DataWriterHDF5DataFaultMeshQuad4.hh \
data/DataWriterHDF5DataFaultMeshTet4.hh \
data/DataWriterHDF5DataFaultMeshHex8.hh \
+ data/OutputSolnPointsData.hh \
+ data/OutputSolnPointsDataTri3.hh \
+ data/OutputSolnPointsDataQuad4.hh \
+ data/OutputSolnPointsDataTet4.hh \
+ data/OutputSolnPointsDataHex8.hh \
+ data/DataWriterDataPoints.hh \
+ data/DataWriterVTKDataPointsTri3.hh \
+ data/DataWriterVTKDataPointsQuad4.hh \
+ data/DataWriterVTKDataPointsTet4.hh \
+ data/DataWriterVTKDataPointsHex8.hh \
data/MeshData.hh \
data/MeshData1D.hh \
data/MeshData1Din2D.hh \
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterPoints.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,138 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDataWriterPoints.hh" // Implementation of class methods
+
+#include "data/DataWriterDataPoints.hh" // USES DataWriterData
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/topology/Field.hh" // USES Field
+#include "pylith/topology/Fields.hh" // USES Fields
+#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
+#include "pylith/meshio/DataWriter.hh" // USES DataWriter
+#include "pylith/faults/FaultCohesiveKin.hh" // USES FaultCohesiveKin
+
+#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
+
+// ----------------------------------------------------------------------
+typedef pylith::topology::Field<pylith::topology::Mesh> MeshField;
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterPoints::setUp(void)
+{ // setUp
+ _data = 0;
+ _mesh = 0;
+ _flipFault = false;
+} // setUp
+
+// ----------------------------------------------------------------------
+// Tear down testing data.
+void
+pylith::meshio::TestDataWriterPoints::tearDown(void)
+{ // tearDown
+ delete _data; _data = 0;
+ delete _mesh; _mesh = 0;
+} // tearDown
+
+// ----------------------------------------------------------------------
+// Initialize mesh.
+void
+pylith::meshio::TestDataWriterPoints::_initialize(void)
+{ // _initialize
+ CPPUNIT_ASSERT(_data);
+
+ delete _mesh; _mesh = new topology::Mesh;
+ MeshIOAscii iohandler;
+ iohandler.filename(_data->meshFilename);
+ iohandler.read(_mesh);
+
+ spatialdata::geocoords::CSCart cs;
+ cs.setSpaceDim(_mesh->dimension());
+ _mesh->coordsys(&cs);
+
+ if (_data->faultLabel) {
+ faults::FaultCohesiveKin fault;
+ int firstFaultVertex = 0;
+ int firstLagrangeVertex = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+ int firstFaultCell = _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+ if (fault.useLagrangeConstraints()) {
+ firstFaultCell += _mesh->sieveMesh()->getIntSection(_data->faultLabel)->size();
+ } // if
+ fault.label(_data->faultLabel);
+ fault.id(_data->faultId);
+ fault.adjustTopology(_mesh, &firstFaultVertex, &firstLagrangeVertex, &firstFaultCell, _flipFault);
+ } // if
+} // _initialize
+
+// ----------------------------------------------------------------------
+// Create vertex fields.
+void
+pylith::meshio::TestDataWriterPoints::_createVertexFields(
+ topology::Fields<MeshField>* fields) const
+{ // _createVertexFields
+ CPPUNIT_ASSERT(fields);
+ CPPUNIT_ASSERT(_mesh);
+ CPPUNIT_ASSERT(_data);
+
+ try {
+ const int nfields = _data->numVertexFields;
+
+ const ALE::Obj<topology::Mesh::SieveMesh>& sieveMesh = _mesh->sieveMesh();
+ CPPUNIT_ASSERT(!sieveMesh.isNull());
+ const ALE::Obj<topology::Mesh::SieveMesh::label_sequence>& vertices =
+ sieveMesh->depthStratum(0);
+ CPPUNIT_ASSERT(!vertices.isNull());
+ const topology::Mesh::SieveMesh::label_sequence::iterator verticesEnd =
+ vertices->end();
+
+ // Set vertex fields
+ for (int i=0; i < nfields; ++i) {
+ const char* name = _data->vertexFieldsInfo[i].name;
+ const int fiberDim = _data->vertexFieldsInfo[i].fiber_dim;
+ fields->add(name, name);
+ MeshField& field = fields->get(name);
+ field.newSection(topology::FieldBase::VERTICES_FIELD, fiberDim);
+ field.allocate();
+ field.vectorFieldType(_data->vertexFieldsInfo[i].field_type);
+
+ const ALE::Obj<topology::Mesh::RealSection>& section = field.section();
+ CPPUNIT_ASSERT(!section.isNull());
+ int ipt = 0;
+ for (topology::Mesh::SieveMesh::label_sequence::iterator v_iter=vertices->begin();
+ v_iter != verticesEnd;
+ ++v_iter, ++ipt) {
+ const PylithScalar* values = &_data->vertexFields[i][ipt*fiberDim];
+ section->updatePoint(*v_iter, values);
+ } // for
+ CPPUNIT_ASSERT_EQUAL(_data->numVertices, ipt);
+ } // for
+ } catch (const ALE::Exception& err) {
+ throw std::runtime_error(err.msg());
+ } catch (...) {
+ throw;
+ } // catch
+} // _createVertexFields
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterPoints.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterPoints.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,76 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/meshio/TestDataWriterPoints.hh
+ *
+ * @brief C++ TestDataWriterPoints object
+ *
+ * C++ unit testing for DataWriter<Mesh>.
+ */
+
+#if !defined(pylith_meshio_testdatawriterpoints_hh)
+#define pylith_meshio_testdatawriterpoints_hh
+
+#include "pylith/topology/topologyfwd.hh" // USES Mesh, Field
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace meshio {
+ class TestDataWriterPoints;
+
+ class DataWriterDataPoints;
+ } // meshio
+} // pylith
+
+/// C++ unit testing for iDataWriter<Mesh> with interpolated solution.
+class pylith::meshio::TestDataWriterPoints
+{ // class TestDataWriterPoints
+
+ // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+ /// Setup testing data.
+ void setUp(void);
+
+ /// Tear down testing data.
+ void tearDown(void);
+
+ /// Initialize mesh.
+ void _initialize(void);
+
+ /** Create vertex fields.
+ *
+ * @param fields Vertex fields.
+ */
+ void
+ _createVertexFields(topology::Fields<topology::Field<topology::Mesh> >* fields) const;
+
+ // PROTECTED MEMBERS //////////////////////////////////////////////////
+protected :
+
+ DataWriterDataPoints* _data; ///< Data for testing
+ topology::Mesh* _mesh; ///< Mesh for data
+ bool _flipFault; ///< If true, flip fault orientation.
+
+}; // class TestDataWriterPoints
+
+#endif // pylith_meshio_testdatawriterpoints_hh
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKPoints.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,151 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDataWriterVTKPoints.hh" // Implementation of class methods
+
+#include "data/DataWriterDataPoints.hh" // USES DataWriterDataPoints
+
+#include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/topology/Field.hh" // USES Field
+#include "pylith/topology/Fields.hh" // USES Fields
+#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
+#include "pylith/meshio/OutputSolnPoints.hh" // USES OutputSolnPoints
+#include "pylith/meshio/DataWriterVTK.hh" // USES DataWriterVTK
+#include "pylith/faults/FaultCohesiveKin.hh" // USES FaultCohesiveKin
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKPoints );
+
+// ----------------------------------------------------------------------
+typedef pylith::topology::Field<pylith::topology::Mesh> MeshField;
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterVTKPoints::setUp(void)
+{ // setUp
+ TestDataWriterPoints::setUp();
+} // setUp
+
+// ----------------------------------------------------------------------
+// Tear down testing data.
+void
+pylith::meshio::TestDataWriterVTKPoints::tearDown(void)
+{ // tearDown
+ TestDataWriterPoints::tearDown();
+} // tearDown
+
+// ----------------------------------------------------------------------
+// Test constructor
+void
+pylith::meshio::TestDataWriterVTKPoints::testConstructor(void)
+{ // testConstructor
+ DataWriterVTK<topology::Mesh, MeshField> writer;
+
+ CPPUNIT_ASSERT(!writer._viewer);
+ CPPUNIT_ASSERT(false == writer._wroteVertexHeader);
+ CPPUNIT_ASSERT(false == writer._wroteCellHeader);
+} // testConstructor
+
+// ----------------------------------------------------------------------
+// Test openTimeStep() and closeTimeStep()
+void
+pylith::meshio::TestDataWriterVTKPoints::testTimeStep(void)
+{ // testTimeStep
+ CPPUNIT_ASSERT(_mesh);
+ CPPUNIT_ASSERT(_data);
+
+ OutputSolnPoints output;
+ DataWriterVTK<topology::Mesh, MeshField> writer;
+
+ writer.filename(_data->timestepFilename);
+ writer.timeFormat(_data->timeFormat);
+ output.writer(&writer);
+ output.setupInterpolator(_mesh, _data->points,
+ _data->numPoints, _data->spaceDim);
+
+ const PylithScalar t = _data->time;
+ const int numTimeSteps = 1;
+ if (!_data->cellsLabel) {
+ output.open(*_mesh, numTimeSteps);
+ output.openTimeStep(t, *_mesh);
+ } else {
+ const char* label = _data->cellsLabel;
+ const int id = _data->labelId;
+ output.open(*_mesh, numTimeSteps, label, id);
+ output.openTimeStep(t, *_mesh, label, id);
+ } // else
+
+ output.closeTimeStep();
+ output.close();
+
+ checkFile(_data->timestepFilename, t, _data->timeFormat);
+} // testTimeStep
+
+// ----------------------------------------------------------------------
+// Test writeVertexField.
+void
+pylith::meshio::TestDataWriterVTKPoints::testWriteVertexField(void)
+{ // testWriteVertexField
+ CPPUNIT_ASSERT(_mesh);
+ CPPUNIT_ASSERT(_data);
+
+ OutputSolnPoints output;
+ DataWriterVTK<topology::Mesh, MeshField> writer;
+
+ topology::Fields<MeshField> vertexFields(*_mesh);
+ _createVertexFields(&vertexFields);
+
+ writer.filename(_data->vertexFilename);
+ writer.timeFormat(_data->timeFormat);
+ output.writer(&writer);
+ output.setupInterpolator(_mesh, _data->points,
+ _data->numPoints, _data->spaceDim);
+
+ const int nfields = _data->numVertexFields;
+
+ const PylithScalar t = _data->time;
+ const int numTimeSteps = 1;
+ if (!_data->cellsLabel) {
+ output.open(*_mesh, numTimeSteps);
+ output.openTimeStep(t, *_mesh);
+ } else {
+ const char* label = _data->cellsLabel;
+ const int id = _data->labelId;
+ output.open(*_mesh, numTimeSteps, label, id);
+ output.openTimeStep(t, *_mesh, label, id);
+ } // else
+ for (int i=0; i < nfields; ++i) {
+ MeshField& field = vertexFields.get(_data->vertexFieldsInfo[i].name);
+ field.view("FIELD");
+ output.appendVertexField(t, field, *_mesh);
+ CPPUNIT_ASSERT(writer._wroteVertexHeader);
+ CPPUNIT_ASSERT(false == writer._wroteCellHeader);
+ } // for
+ output.closeTimeStep();
+ output.close();
+ CPPUNIT_ASSERT(false == writer._wroteVertexHeader);
+ CPPUNIT_ASSERT(false == writer._wroteCellHeader);
+
+ checkFile(_data->vertexFilename, t, _data->timeFormat);
+} // testWriteVertexField
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKPoints.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPoints.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,80 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/meshio/TestDataWriterVTKPoints.hh
+ *
+ * @brief C++ TestDataWriterVTKPoints object
+ *
+ * C++ unit testing for DataWriterVTKPoints.
+ */
+
+#if !defined(pylith_meshio_testdatawritervtkpoints_hh)
+#define pylith_meshio_testdatawritervtkpoints_hh
+
+#include "TestDataWriterVTK.hh" // ISA TestDataWriterVTK
+#include "TestDataWriterPoints.hh" // ISA TestDataWriterPoints
+
+#include "pylith/topology/topologyfwd.hh" // USES Mesh, Field
+
+#include <cppunit/extensions/HelperMacros.h>
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace meshio {
+ class TestDataWriterVTKPoints;
+ } // meshio
+} // pylith
+
+/// C++ unit testing for DataWriterVTK
+class pylith::meshio::TestDataWriterVTKPoints : public TestDataWriterVTK,
+ public TestDataWriterPoints,
+ public CppUnit::TestFixture
+{ // class TestDataWriterVTKPoints
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestDataWriterVTKPoints );
+
+ CPPUNIT_TEST( testConstructor );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+ /// Tear down testing data.
+ void tearDown(void);
+
+ /// Test constructor
+ void testConstructor(void);
+
+ /// Test openTimeStep() and closeTimeStep()
+ void testTimeStep(void);
+
+ /// Test writeVertexField.
+ void testWriteVertexField(void);
+
+}; // class TestDataWriterVTKPoints
+
+#endif // pylith_meshio_testdatawritervtkpoints_hh
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKPointsCases.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,84 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDataWriterVTKPointsCases.hh" // Implementation of class methods
+
+#include "data/DataWriterVTKDataPointsTri3.hh" // USES DataWriterVTKDataPointsTri3
+#include "data/DataWriterVTKDataPointsQuad4.hh" // USES DataWriterVTKDataPointsQuad4
+#include "data/DataWriterVTKDataPointsTet4.hh" // USES DataWriterVTKDataPointsTet4
+#include "data/DataWriterVTKDataPointsHex8.hh" // USES DataWriterVTKDataPointsHex8
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKPointsTri3 );
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKPointsQuad4 );
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKPointsTet4 );
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKPointsHex8 );
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterVTKPointsTri3::setUp(void)
+{ // setUp
+ TestDataWriterVTKPoints::setUp();
+ _data = new DataWriterVTKDataPointsTri3;
+ _flipFault = true;
+ _initialize();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterVTKPointsQuad4::setUp(void)
+{ // setUp
+ TestDataWriterVTKPoints::setUp();
+ _data = new DataWriterVTKDataPointsQuad4;
+ _flipFault = false;
+ _initialize();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterVTKPointsTet4::setUp(void)
+{ // setUp
+ TestDataWriterVTKPoints::setUp();
+ _data = new DataWriterVTKDataPointsTet4;
+ _flipFault = false;
+ _initialize();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterVTKPointsHex8::setUp(void)
+{ // setUp
+ TestDataWriterVTKPoints::setUp();
+ _data = new DataWriterVTKDataPointsHex8;
+ _flipFault = true;
+ _initialize();
+} // setUp
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKPointsCases.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestDataWriterVTKPointsCases.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,133 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/meshio/TestDataWriterVTKPointsCases.hh
+ *
+ * @brief C++ unit testing for DataWriterVTK output interpolated to
+ * points with various mesh cell types.
+ */
+
+#if !defined(pylith_meshio_testdatawritervtkpointscases_hh)
+#define pylith_meshio_testdatawritervtkpointscases_hh
+
+#include "TestDataWriterVTKPoints.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace meshio {
+ class TestDataWriterVTKPointsTri3;
+ class TestDataWriterVTKPointsQuad4;
+ class TestDataWriterVTKPointsTet4;
+ class TestDataWriterVTKPointsHex8;
+ } // meshio
+} // pylith
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DataWriterVTK
+class pylith::meshio::TestDataWriterVTKPointsTri3 : public TestDataWriterVTKPoints
+{ // class TestDataWriterVTKPointsTri3
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestDataWriterVTKPointsTri3 );
+
+ CPPUNIT_TEST( testTimeStep );
+ CPPUNIT_TEST( testWriteVertexField );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDataWriterVTKPointsTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DataWriterVTK
+class pylith::meshio::TestDataWriterVTKPointsQuad4 : public TestDataWriterVTKPoints
+{ // class TestDataWriterVTKPointsQuad4
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestDataWriterVTKPointsQuad4 );
+
+ CPPUNIT_TEST( testTimeStep );
+ CPPUNIT_TEST( testWriteVertexField );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDataWriterVTKPointsQuad4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DataWriterVTK
+class pylith::meshio::TestDataWriterVTKPointsTet4 : public TestDataWriterVTKPoints
+{ // class TestDataWriterVTKPointsTet4
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestDataWriterVTKPointsTet4 );
+
+ CPPUNIT_TEST( testTimeStep );
+ CPPUNIT_TEST( testWriteVertexField );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDataWriterVTKPointsTet4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DataWriterVTK
+class pylith::meshio::TestDataWriterVTKPointsHex8 : public TestDataWriterVTKPoints
+{ // class TestDataWriterVTKPointsHex8
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestDataWriterVTKPointsHex8 );
+
+ CPPUNIT_TEST( testTimeStep );
+ CPPUNIT_TEST( testWriteVertexField );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDataWriterVTKPointsHex8
+
+
+#endif // pylith_meshio_testdatawritervtkpointscases_hh
+
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -28,6 +28,11 @@
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
+#include "data/OutputSolnPointsDataTri3.hh"
+#include "data/OutputSolnPointsDataQuad4.hh"
+#include "data/OutputSolnPointsDataTet4.hh"
+#include "data/OutputSolnPointsDataHex8.hh"
+
#include <string.h> // USES strcmp()
// ----------------------------------------------------------------------
@@ -47,125 +52,96 @@
// ----------------------------------------------------------------------
-// Test setupInterpolator() for 2D points.
+// Test setupInterpolator for tri3 mesh.
void
-pylith::meshio::TestOutputSolnPoints::testSetupInterpolator2D(void)
-{ // testSetupInterpolator2D
- const char* filename = "data/quad4.mesh";
- const int numPoints = 5;
- const PylithScalar points[10] = {
- 0.0, 0.1,
- 0.3, 0.4,
- -0.6, -0.7,
- -1.0, 0.9,
- -0.3, 0.8,
- };
- const int nvertices = numPoints;
- const int verticesE[5] = { 5, 6, 7, 8, 9 };
- const int ncells = numPoints;
- const int ncorners = 1;
- const int cellsE[5] = { 5, 6, 7, 8, 9 };
- const int spaceDim = 2;
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorTri3(void)
+{ // testSetupInterpolatorTri3
+ OutputSolnPoints output;
+ OutputSolnPointsDataTri3 data;
- topology::Mesh mesh;
- spatialdata::geocoords::CSCart cs;
- cs.setSpaceDim(spaceDim);
- cs.initialize();
- mesh.coordsys(&cs);
- MeshIOAscii iohandler;
- iohandler.filename("data/quad4.mesh");
- iohandler.read(&mesh);
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorTri3
+
+// ----------------------------------------------------------------------
+// Test setupInterpolator for quad4 mesh.
+void
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorQuad4(void)
+{ // testSetupInterpolatorQuad4
OutputSolnPoints output;
- output.setupInterpolator(&mesh, points, numPoints, spaceDim);
+ OutputSolnPointsDataQuad4 data;
- const topology::Mesh& pointsMesh = output.pointsMesh();
- const ALE::Obj<SieveMesh>& sievePointsMesh = pointsMesh.sieveMesh();
- CPPUNIT_ASSERT(!sievePointsMesh.isNull());
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorQuad4
- pointsMesh.view("POINTS MESH");
- // Check vertices
- const ALE::Obj<SieveMesh::label_sequence>& vertices =
- sievePointsMesh->depthStratum(0);
- const SieveMesh::label_sequence::iterator verticesEnd = vertices->end();
- CPPUNIT_ASSERT_EQUAL(nvertices, int(vertices->size()));
- int ipt = 0;
- for (SieveMesh::label_sequence::iterator v_iter=vertices->begin();
- v_iter != verticesEnd;
- ++v_iter, ++ipt)
- CPPUNIT_ASSERT_EQUAL(verticesE[ipt], *v_iter);
+// ----------------------------------------------------------------------
+// Test setupInterpolator for tet4 mesh.
+void
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorTet4(void)
+{ // testSetupInterpolatorTet4
+ OutputSolnPoints output;
+ OutputSolnPointsDataTet4 data;
- // Check cells
- const ALE::Obj<SieveMesh::label_sequence>& cells =
- sievePointsMesh->heightStratum(0);
- const SieveMesh::label_sequence::iterator cellsEnd = cells->end();
- const ALE::Obj<SieveMesh::sieve_type>& sieve = sievePointsMesh->getSieve();
- assert(!sieve.isNull());
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorTet4
- CPPUNIT_ASSERT_EQUAL(ncells, int(cells->size()));
- ALE::ISieveVisitor::PointRetriever<SieveMesh::sieve_type> pV(sieve->getMaxConeSize());
- int i = 0;
- for (SieveMesh::label_sequence::iterator c_iter=cells->begin(); c_iter != cellsEnd; ++c_iter) {
- sieve->cone(*c_iter, pV);
- const SieveMesh::point_type* cone = pV.getPoints();
- CPPUNIT_ASSERT_EQUAL(ncorners, (int) pV.getSize());
- for(int p = 0; p < pV.getSize(); ++p, ++i) {
- CPPUNIT_ASSERT_EQUAL(cellsE[i], cone[p]);
- }
- pV.clear();
- } // for
-} // testSetupInterpolator2D
+// ----------------------------------------------------------------------
+// Test setupInterpolator for hex8 mesh.
+void
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorHex8(void)
+{ // testSetupInterpolatorHex8
+ OutputSolnPoints output;
+ OutputSolnPointsDataHex8 data;
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorHex8
+
// ----------------------------------------------------------------------
-// Test setupInterpolator() for 3D points.
+// Test setupInterpolator().
void
-pylith::meshio::TestOutputSolnPoints::testSetupInterpolator3D(void)
-{ // testSetupInterpolator3D
- const char* filename = "data/quad4.mesh";
- const int numPoints = 5;
- const PylithScalar points[15] = {
- 0.0, 0.1, 0.2,
- 0.3, -0.4, 0.5,
- 0.6, 0.7, -0.8,
- -1.0, 0.1, -0.3,
- 0.3, 0.8, 0.5,
- };
- const int nvertices = numPoints;
- const int verticesE[5] = { 5, 6, 7, 8, 9 };
- const int ncells = numPoints;
- const int ncorners = 1;
- const int cellsE[5] = { 5, 6, 7, 8, 9 };
- const int spaceDim = 3;
+pylith::meshio::TestOutputSolnPoints::_testSetupInterpolator(const OutputSolnPointsData& data)
+{ // _testSetupInterpolator
+ const int numPoints = data.numPoints;
+ const int spaceDim = data.spaceDim;
+ const int numVerticesE = numPoints;
+ const int numCellsE = numPoints;
+ const int numCornersE = 1;
+
topology::Mesh mesh;
spatialdata::geocoords::CSCart cs;
cs.setSpaceDim(spaceDim);
cs.initialize();
mesh.coordsys(&cs);
MeshIOAscii iohandler;
- iohandler.filename("data/hex8.mesh");
+ iohandler.filename(data.meshFilename);
iohandler.read(&mesh);
OutputSolnPoints output;
- output.setupInterpolator(&mesh, points, numPoints, spaceDim);
+ CPPUNIT_ASSERT(data.points);
+ output.setupInterpolator(&mesh, data.points, numPoints, spaceDim);
const topology::Mesh& pointsMesh = output.pointsMesh();
const ALE::Obj<SieveMesh>& sievePointsMesh = pointsMesh.sieveMesh();
CPPUNIT_ASSERT(!sievePointsMesh.isNull());
+ //pointsMesh.view("POINTS MESH"); // DEBUGGING
+
// Check vertices
const ALE::Obj<SieveMesh::label_sequence>& vertices =
sievePointsMesh->depthStratum(0);
const SieveMesh::label_sequence::iterator verticesEnd = vertices->end();
- CPPUNIT_ASSERT_EQUAL(nvertices, int(vertices->size()));
+ CPPUNIT_ASSERT_EQUAL(numVerticesE, int(vertices->size()));
int ipt = 0;
for (SieveMesh::label_sequence::iterator v_iter=vertices->begin();
v_iter != verticesEnd;
- ++v_iter, ++ipt)
- CPPUNIT_ASSERT_EQUAL(verticesE[ipt], *v_iter);
+ ++v_iter, ++ipt) {
+ const int vertexE = numCellsE + ipt;
+ CPPUNIT_ASSERT_EQUAL(vertexE, *v_iter);
+ } // for
// Check cells
const ALE::Obj<SieveMesh::label_sequence>& cells =
@@ -174,20 +150,21 @@
const ALE::Obj<SieveMesh::sieve_type>& sieve = sievePointsMesh->getSieve();
assert(!sieve.isNull());
- CPPUNIT_ASSERT_EQUAL(ncells, int(cells->size()));
+ CPPUNIT_ASSERT_EQUAL(numCellsE, int(cells->size()));
ALE::ISieveVisitor::PointRetriever<SieveMesh::sieve_type> pV(sieve->getMaxConeSize());
int i = 0;
for (SieveMesh::label_sequence::iterator c_iter=cells->begin(); c_iter != cellsEnd; ++c_iter) {
sieve->cone(*c_iter, pV);
- const SieveMesh::point_type *cone = pV.getPoints();
- CPPUNIT_ASSERT_EQUAL(ncorners, (int) pV.getSize());
+ const SieveMesh::point_type* cone = pV.getPoints();
+ CPPUNIT_ASSERT_EQUAL(numCornersE, (int) pV.getSize());
for(int p = 0; p < pV.getSize(); ++p, ++i) {
- CPPUNIT_ASSERT_EQUAL(cellsE[i], cone[p]);
- }
+ const int coneE = numCellsE+i;
+ CPPUNIT_ASSERT_EQUAL(coneE, cone[p]);
+ } // for
pV.clear();
} // for
-} // testSetupInterpolator3D
+} // _testSetupInterpolator
// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.hh
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.hh 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/TestOutputSolnPoints.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -33,6 +33,8 @@
namespace pylith {
namespace meshio {
class TestOutputSolnPoints;
+
+ class OutputSolnPointsData;
} // meshio
} // pylith
@@ -44,9 +46,12 @@
CPPUNIT_TEST_SUITE( TestOutputSolnPoints );
CPPUNIT_TEST( testConstructor );
- CPPUNIT_TEST( testSetupInterpolator2D );
- CPPUNIT_TEST( testSetupInterpolator3D );
+ CPPUNIT_TEST( testSetupInterpolatorTri3 );
+ CPPUNIT_TEST( testSetupInterpolatorQuad4 );
+ CPPUNIT_TEST( testSetupInterpolatorTet4 );
+ CPPUNIT_TEST( testSetupInterpolatorHex8 );
+
CPPUNIT_TEST_SUITE_END();
// PUBLIC METHODS /////////////////////////////////////////////////////
@@ -55,12 +60,27 @@
/// Test constructor
void testConstructor(void);
- /// Test setupInterpolator for 2D mesh()
- void testSetupInterpolator2D(void);
+ /// Test setupInterpolator for tri3 mesh.
+ void testSetupInterpolatorTri3(void);
- /// Test setupInterpolator for 3D mesh()
- void testSetupInterpolator3D(void);
+ /// Test setupInterpolator for quad4 mesh.
+ void testSetupInterpolatorQuad4(void);
+ /// Test setupInterpolator for tet4 mesh.
+ void testSetupInterpolatorTet4(void);
+
+ /// Test setupInterpolator for hex8 mesh.
+ void testSetupInterpolatorHex8(void);
+
+ // PRIVATE METHODS ////////////////////////////////////////////////////
+private :
+
+ /** Test setupInterpolator.
+ *
+ * @param data Test data.
+ */
+ void _testSetupInterpolator(const OutputSolnPointsData& data);
+
}; // class TestOutputSolnPoints
#endif // pylith_meshio_testoutputsolnpoints_hh
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterDataPoints.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,37 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "DataWriterDataPoints.hh"
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::meshio::DataWriterDataPoints::DataWriterDataPoints(void) :
+ numPoints(0),
+ spaceDim(0),
+ points(0)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::meshio::DataWriterDataPoints::~DataWriterDataPoints(void)
+{ // destructor
+} // destructor
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterDataPoints.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterDataPoints.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,57 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawriterdatapoints_hh)
+#define pylith_meshio_datawriterdatapoints_hh
+
+// Data for testing writing interpolation of solution to points.
+
+#include "DataWriterData.hh" // ISA DataWriterData
+
+namespace pylith {
+ namespace meshio {
+ class DataWriterDataPoints;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterDataPoints : public DataWriterData
+{ // DataWriterData
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public :
+
+ /// Constructor
+ DataWriterDataPoints(void);
+
+ /// Destructor
+ virtual
+ ~DataWriterDataPoints(void);
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public:
+
+ int numPoints; ///< Number of points for interpolation.
+ int spaceDim; ///< Spatial dimension.
+ PylithScalar* points; /// Points for interpolation.
+
+}; // DataWriterData
+
+#endif // pylith_meshio_datawriterdatapoints_hh
+
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataMeshTri3.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataMeshTri3.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataMeshTri3.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -57,7 +57,8 @@
7.7, 8.8,
9.9, 10.0,
11.1, 12.2,
- 13.3, 14.4
+ 13.3, 14.4,
+ 15.5, 16.6,
};
const PylithScalar pylith::meshio::DataWriterVTKDataMeshTri3::_vertexField1[] = {
2.1, 3.2, 4.3, 5.4, 6.5, 7.6, 8.7, 9.8
@@ -69,7 +70,8 @@
7.8, 8.9,
9.0, 10.1,
11.2, 12.3,
- 13.4, 14.5
+ 13.4, 14.5,
+ 15.6, 16.7,
};
const int pylith::meshio::DataWriterVTKDataMeshTri3::_numCellFields = 3;
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,157 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataPointsHex8.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataPointsHex8::_meshFilename =
+ "data/hex8.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataPointsHex8::_faultLabel =
+ "fault";
+const int pylith::meshio::DataWriterVTKDataPointsHex8::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataPointsHex8::_timestepFilename =
+ "hex8_points.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataPointsHex8::_vertexFilename =
+ "hex8_points_vertex.vtk";
+
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsHex8::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataPointsHex8::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataPointsHex8::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataPointsHex8::_numVertices = 20;
+
+const pylith::meshio::DataWriterData::FieldStruct
+pylith::meshio::DataWriterVTKDataPointsHex8::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 3 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsHex8::_vertexField0[] = {
+ 1.1, 2.2, 3.3, // 0
+ 4.4, 5.5, 6.6, // 1
+ 7.7, 8.8, 9.9, // 2
+ 10.1, 11.2, 12.3, // 3
+ 1.2, 2.3, 3.4, // 4
+ 4.5, 5.6, 6.7, // 5
+ 7.8, 8.9, 9.0, // 6
+ 10.2, 11.3, 12.4, // 7
+ 1.3, 2.4, 3.5, // 8
+ 4.6, 5.7, 6.8, // 9
+ 7.9, 8.0, 9.1, // 10
+ 10.2, 11.3, 12.4, // 11
+ 13.5, 14.6, 15.7, // 12
+ 16.8, 17.9, 18.1, // 13
+ 19.2, 20.3, 21.4, // 14
+ 22.5, 23.6, 24.7, // 15
+ 25.8, 26.9, 27.1, // 16
+ 28.8, 29.9, 30.1, // 17
+ 31.8, 32.9, 33.1, // 18
+ 34.8, 35.9, 36.1, // 19
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsHex8::_vertexField1[] = {
+ 2.1, // 0
+ 3.2, // 1
+ 4.3, // 2
+ 5.4, // 3
+ 6.5, // 4
+ 7.6, // 5
+ 8.7, // 6
+ 9.8, // 7
+ 10.0, // 8
+ 12.1, // 9
+ 11.1, // 10
+ 13.1, // 11
+ 14.1, // 12
+ 15.1, // 13
+ 16.1, // 14
+ 17.1, // 15
+ 18.1, // 16
+ 19.1, // 17
+ 20.1, // 18
+ 21.2, // 19
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsHex8::_vertexField2[] = {
+ 1.2, 2.3, // 0
+ 3.4, 4.5, // 1
+ 5.6, 6.7, // 2
+ 7.8, 8.9, // 3
+ 1.3, 2.4, // 4
+ 3.5, 4.6, // 5
+ 5.7, 6.8, // 6
+ 7.9, 8.0, // 7
+ 1.3, 2.4, // 8
+ 3.5, 4.6, // 9
+ 5.7, 6.8, // 10
+ 8.0, 1.4, // 11
+ 2.5, 3.6, // 12
+ 4.8, 1.5, // 13
+ 2.6, 3.7, // 14
+ 4.8, 5.9, // 15
+ 6.1, 7.2, // 16
+ 7.1, 8.2, // 17
+ 8.1, 9.2, // 18
+ 9.1, 10.1, // 19
+};
+
+const int pylith::meshio::DataWriterVTKDataPointsHex8::_numPoints = 4;
+const int pylith::meshio::DataWriterVTKDataPointsHex8::_spaceDim = 3;
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsHex8::_points[] = {
+ -0.5, 0.0, 0.5,
+ -0.00000001, 0.0, 0.0,
+ -0.00000001, 0.0, 0.99999999,
+ 0.99999999, 0.99999999, -0.99999999,
+};
+
+
+pylith::meshio::DataWriterVTKDataPointsHex8::DataWriterVTKDataPointsHex8(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ faultLabel = const_cast<char*>(_faultLabel);
+ faultId = _faultId;
+
+ timestepFilename = const_cast<char*>(_timestepFilename);
+ vertexFilename = const_cast<char*>(_vertexFilename);
+
+ time = _time;
+ timeFormat = const_cast<char*>(_timeFormat);
+
+ numVertexFields = _numVertexFields;
+ numVertices = _numVertices;
+ assert(3 == numVertexFields);
+ vertexFieldsInfo = const_cast<DataWriterData::FieldStruct*>(_vertexFields);
+ vertexFields[0] = const_cast<PylithScalar*>(_vertexField0);
+ vertexFields[1] = const_cast<PylithScalar*>(_vertexField1);
+ vertexFields[2] = const_cast<PylithScalar*>(_vertexField2);
+
+ numPoints = _numPoints;
+ spaceDim = _spaceDim;
+ points = const_cast<PylithScalar*>(_points);
+} // constructor
+
+
+pylith::meshio::DataWriterVTKDataPointsHex8::~DataWriterVTKDataPointsHex8(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsHex8.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,75 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatapointshex8_hh)
+#define pylith_meshio_datawritervtkdatapointshex8_hh
+
+#include "DataWriterDataPoints.hh" // ISA DataWriterData
+
+namespace pylith {
+ namespace meshio {
+ class DataWriterVTKDataPointsHex8;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataPointsHex8 : public DataWriterDataPoints
+{ // DataWriterVTKDataPointsHex8
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataPointsHex8(void);
+
+ /// Destructor
+ ~DataWriterVTKDataPointsHex8(void);
+
+private:
+
+ static const char* _meshFilename; ///< Name of mesh file.
+ static const char* _faultLabel; ///< Name of group of vertices for fault.
+ static const int _faultId; ///< Material identifier for fault.
+
+ static const char* _timestepFilename; ///< Name of VTK file without fields.
+ static const char* _vertexFilename; ///< Name of VTK file for vertex fields.
+
+ static const PylithScalar _time; ///< Time for fields.
+ static const char* _timeFormat; ///< Format for time stamp.
+
+ /// @name Vertex field information.
+ //@{
+ static const int _numVertexFields; ///< Number of vertex fields.
+ static const int _numVertices; ///< Number of vertices.
+ static const FieldStruct _vertexFields[]; ///< Array of vertex fields.
+
+ static const PylithScalar _vertexField0[]; ///< Values for vertex field 0.
+ static const PylithScalar _vertexField1[]; ///< Values for vertex field 1.
+ static const PylithScalar _vertexField2[]; ///< Values for vertex field 2.
+ //@}
+
+ /// @name Point information.
+ //@{
+ static const int _numPoints; ///< Number of points.
+ static const int _spaceDim; ///< Spatial dimension.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+ //@}
+
+}; // DataWriterVTKDataPointsHex8
+
+#endif // pylith_meshio_datawritervtkdatapointshex8_hh
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,108 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataPointsQuad4.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataPointsQuad4::_meshFilename =
+ "data/quad4.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataPointsQuad4::_timestepFilename =
+ "quad4_points.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataPointsQuad4::_vertexFilename =
+ "quad4_points_vertex.vtk";
+
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsQuad4::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataPointsQuad4::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataPointsQuad4::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataPointsQuad4::_numVertices = 6;
+
+const pylith::meshio::DataWriterData::FieldStruct
+pylith::meshio::DataWriterVTKDataPointsQuad4::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 2 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsQuad4::_vertexField0[] = {
+ 1.1, 2.2, // 0
+ 3.3, 4.4, // 1
+ 5.5, 6.6, // 2
+ 7.7, 8.8, // 3
+ 9.9, 10.1, // 4
+ 11.2, 12.3, // 5
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsQuad4::_vertexField1[] = {
+ 2.1, // 0
+ 3.2, // 1
+ 4.3, // 2
+ 5.4, // 3
+ 6.5, // 4
+ 7.6, // 5
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsQuad4::_vertexField2[] = {
+ 1.2, 2.3, // 0
+ 3.4, 4.5, // 1
+ 5.6, 6.7, // 2
+ 7.8, 8.9, // 3
+ 9.8, 7.6, // 4
+ 6.5, 5.4, // 5
+};
+
+const int pylith::meshio::DataWriterVTKDataPointsQuad4::_numPoints = 3;
+const int pylith::meshio::DataWriterVTKDataPointsQuad4::_spaceDim = 2;
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsQuad4::_points[] = {
+ -0.5, 0.0,
+ 0.00000001, 0.0,
+ 0.99999999, -0.99999999,
+};
+
+
+pylith::meshio::DataWriterVTKDataPointsQuad4::DataWriterVTKDataPointsQuad4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+
+ timestepFilename = const_cast<char*>(_timestepFilename);
+ vertexFilename = const_cast<char*>(_vertexFilename);
+
+ time = _time;
+ timeFormat = const_cast<char*>(_timeFormat);
+
+ numVertexFields = _numVertexFields;
+ numVertices = _numVertices;
+ assert(3 == numVertexFields);
+ vertexFieldsInfo = const_cast<DataWriterData::FieldStruct*>(_vertexFields);
+ vertexFields[0] = const_cast<PylithScalar*>(_vertexField0);
+ vertexFields[1] = const_cast<PylithScalar*>(_vertexField1);
+ vertexFields[2] = const_cast<PylithScalar*>(_vertexField2);
+
+ numPoints = _numPoints;
+ spaceDim = _spaceDim;
+ points = const_cast<PylithScalar*>(_points);
+} // constructor
+
+
+pylith::meshio::DataWriterVTKDataPointsQuad4::~DataWriterVTKDataPointsQuad4(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsQuad4.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,73 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatapointsquad4_hh)
+#define pylith_meshio_datawritervtkdatapointsquad4_hh
+
+#include "DataWriterDataPoints.hh" // ISA DataWriterData
+
+namespace pylith {
+ namespace meshio {
+ class DataWriterVTKDataPointsQuad4;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataPointsQuad4 : public DataWriterDataPoints
+{ // DataWriterVTKDataPointsQuad4
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataPointsQuad4(void);
+
+ /// Destructor
+ ~DataWriterVTKDataPointsQuad4(void);
+
+private:
+
+ static const char* _meshFilename; ///< Name of mesh file.
+
+ static const char* _timestepFilename; ///< Name of VTK file without fields.
+ static const char* _vertexFilename; ///< Name of VTK file for vertex fields.
+
+ static const PylithScalar _time; ///< Time for fields.
+ static const char* _timeFormat; ///< Format for time stamp.
+
+ /// @name Vertex field information.
+ //@{
+ static const int _numVertexFields; ///< Number of vertex fields.
+ static const int _numVertices; ///< Number of vertices.
+ static const FieldStruct _vertexFields[]; ///< Array of vertex fields.
+
+ static const PylithScalar _vertexField0[]; ///< Values for vertex field 0.
+ static const PylithScalar _vertexField1[]; ///< Values for vertex field 1.
+ static const PylithScalar _vertexField2[]; ///< Values for vertex field 2.
+ //@}
+
+ /// @name Point information.
+ //@{
+ static const int _numPoints; ///< Number of points.
+ static const int _spaceDim; ///< Spatial dimension.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+ //@}
+
+}; // DataWriterVTKDataPointsQuad4
+
+#endif // pylith_meshio_datawritervtkdatapointsquad4_hh
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,130 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataPointsTet4.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataPointsTet4::_meshFilename =
+ "data/tet4.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataPointsTet4::_faultLabel =
+ "fault";
+const int pylith::meshio::DataWriterVTKDataPointsTet4::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataPointsTet4::_timestepFilename =
+ "tet4_points.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataPointsTet4::_vertexFilename =
+ "tet4_points_vertex.vtk";
+
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTet4::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataPointsTet4::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataPointsTet4::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataPointsTet4::_numVertices = 11;
+
+const pylith::meshio::DataWriterData::FieldStruct
+pylith::meshio::DataWriterVTKDataPointsTet4::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 3 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTet4::_vertexField0[] = {
+ 1.1, 2.2, 3.3, // 0
+ 4.4, 5.5, 6.6, // 1
+ 7.7, 8.8, 9.9, // 2
+ 10.0, 11.1, 12.2, // 3
+ 13.3, 14.4, 15.5, // 4
+ 16.6, 17.7, 18.8, // 5
+ 19.9, 20.0, 21.1, // 6
+ 22.2, 23.3, 24.4, // 7
+ 25.5, 26.6, 27.7, // 8
+ 28.8, 29.9, 30.0, // 9
+ 31.1, 32.2, 33.3, // 10
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTet4::_vertexField1[] = {
+ 2.1, // 0
+ 3.2, // 1
+ 4.3, // 2
+ 5.4, // 3
+ 6.5, // 4
+ 7.6, // 5
+ 8.7, // 6
+ 9.8, // 7
+ 10.9, // 8
+ 11.0, // 9
+ 12.1, // 10
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTet4::_vertexField2[] = {
+ 1.2, 2.3, // 0
+ 3.4, 4.5, // 1
+ 5.6, 6.7, // 2
+ 7.8, 8.9, // 3
+ 9.0, 10.1, // 4
+ 11.2, 12.3, // 5
+ 13.4, 14.5, // 6
+ 15.6, 16.7, // 7
+ 17.8, 18.9, // 8
+ 19.0, 20.1, // 9
+ 21.2, 22.3, // 10
+};
+
+const int pylith::meshio::DataWriterVTKDataPointsTet4::_numPoints = 4;
+const int pylith::meshio::DataWriterVTKDataPointsTet4::_spaceDim = 3;
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTet4::_points[] = {
+ -0.33333333, 0.0, 0.33333333,
+ +0.00000001, 0.0, 0.33333333,
+ +0.00000001, 0.0, 0.00000001,
+ +0.00000001, -0.99999999, 0.00000001,
+};
+
+
+pylith::meshio::DataWriterVTKDataPointsTet4::DataWriterVTKDataPointsTet4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ faultLabel = const_cast<char*>(_faultLabel);
+ faultId = _faultId;
+
+ timestepFilename = const_cast<char*>(_timestepFilename);
+ vertexFilename = const_cast<char*>(_vertexFilename);
+
+ time = _time;
+ timeFormat = const_cast<char*>(_timeFormat);
+
+ numVertexFields = _numVertexFields;
+ numVertices = _numVertices;
+ assert(3 == numVertexFields);
+ vertexFieldsInfo = const_cast<DataWriterData::FieldStruct*>(_vertexFields);
+ vertexFields[0] = const_cast<PylithScalar*>(_vertexField0);
+ vertexFields[1] = const_cast<PylithScalar*>(_vertexField1);
+ vertexFields[2] = const_cast<PylithScalar*>(_vertexField2);
+
+ numPoints = _numPoints;
+ spaceDim = _spaceDim;
+ points = const_cast<PylithScalar*>(_points);
+} // constructor
+
+
+pylith::meshio::DataWriterVTKDataPointsTet4::~DataWriterVTKDataPointsTet4(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTet4.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,75 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatapointstet4_hh)
+#define pylith_meshio_datawritervtkdatapointstet4_hh
+
+#include "DataWriterDataPoints.hh" // ISA DataWriterData
+
+namespace pylith {
+ namespace meshio {
+ class DataWriterVTKDataPointsTet4;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataPointsTet4 : public DataWriterDataPoints
+{ // DataWriterVTKDataPointsTet4
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataPointsTet4(void);
+
+ /// Destructor
+ ~DataWriterVTKDataPointsTet4(void);
+
+private:
+
+ static const char* _meshFilename; ///< Name of mesh file.
+ static const char* _faultLabel; ///< Name of group of vertices for fault.
+ static const int _faultId; ///< Material identifier for fault.
+
+ static const char* _timestepFilename; ///< Name of VTK file without fields.
+ static const char* _vertexFilename; ///< Name of VTK file for vertex fields.
+
+ static const PylithScalar _time; ///< Time for fields.
+ static const char* _timeFormat; ///< Format for time stamp.
+
+ /// @name Vertex field information.
+ //@{
+ static const int _numVertexFields; ///< Number of vertex fields.
+ static const int _numVertices; ///< Number of vertices.
+ static const FieldStruct _vertexFields[]; ///< Array of vertex fields.
+
+ static const PylithScalar _vertexField0[]; ///< Values for vertex field 0.
+ static const PylithScalar _vertexField1[]; ///< Values for vertex field 1.
+ static const PylithScalar _vertexField2[]; ///< Values for vertex field 2.
+ //@}
+
+ /// @name Point information.
+ //@{
+ static const int _numPoints; ///< Number of points.
+ static const int _spaceDim; ///< Spatial dimension.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+ //@}
+
+}; // DataWriterVTKDataPointsTet4
+
+#endif // pylith_meshio_datawritervtkdatapointstet4_hh
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,120 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataPointsTri3.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataPointsTri3::_meshFilename =
+ "data/tri3.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataPointsTri3::_faultLabel =
+ "fault";
+const int pylith::meshio::DataWriterVTKDataPointsTri3::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataPointsTri3::_timestepFilename =
+ "tri3_points.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataPointsTri3::_vertexFilename =
+ "tri3_points_vertex.vtk";
+
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTri3::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataPointsTri3::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataPointsTri3::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataPointsTri3::_numVertices = 8;
+
+const pylith::meshio::DataWriterData::FieldStruct
+pylith::meshio::DataWriterVTKDataPointsTri3::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 2 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTri3::_vertexField0[] = {
+ 1.1, 2.2, // 0
+ 3.3, 4.4, // 1
+ 5.5, 6.6, // 2
+ 7.7, 8.8, // 3
+ 9.9, 10.0, // 4
+ 11.1, 12.2, // 5
+ 13.3, 14.4,
+ 15.5, 16.6,
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTri3::_vertexField1[] = {
+ 2.1, // 0
+ 3.2, // 1
+ 4.3, // 2
+ 5.4, // 3
+ 6.5, // 4
+ 7.6, // 5
+ 8.7,
+ 9.8
+};
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTri3::_vertexField2[] = {
+ 1.2, 2.3, // 0
+ 3.4, 4.5, // 1
+ 5.6, 6.7, // 2
+ 7.8, 8.9, // 3
+ 9.0, 10.1, // 4
+ 11.2, 12.3, // 5
+ 13.4, 14.5,
+ 15.6, 16.7,
+};
+
+const int pylith::meshio::DataWriterVTKDataPointsTri3::_numPoints = 3;
+const int pylith::meshio::DataWriterVTKDataPointsTri3::_spaceDim = 2;
+const PylithScalar pylith::meshio::DataWriterVTKDataPointsTri3::_points[] = {
+ -0.3333333, 0.0,
+ 0.0000001, 0.0,
+ 0.9999999, 0.0,
+};
+
+
+pylith::meshio::DataWriterVTKDataPointsTri3::DataWriterVTKDataPointsTri3(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ faultLabel = const_cast<char*>(_faultLabel);
+ faultId = _faultId;
+
+ timestepFilename = const_cast<char*>(_timestepFilename);
+ vertexFilename = const_cast<char*>(_vertexFilename);
+
+ time = _time;
+ timeFormat = const_cast<char*>(_timeFormat);
+
+ numVertexFields = _numVertexFields;
+ numVertices = _numVertices;
+ assert(3 == numVertexFields);
+ vertexFieldsInfo = const_cast<DataWriterData::FieldStruct*>(_vertexFields);
+ vertexFields[0] = const_cast<PylithScalar*>(_vertexField0);
+ vertexFields[1] = const_cast<PylithScalar*>(_vertexField1);
+ vertexFields[2] = const_cast<PylithScalar*>(_vertexField2);
+
+ numPoints = _numPoints;
+ spaceDim = _spaceDim;
+ points = const_cast<PylithScalar*>(_points);
+} // constructor
+
+
+pylith::meshio::DataWriterVTKDataPointsTri3::~DataWriterVTKDataPointsTri3(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/DataWriterVTKDataPointsTri3.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,75 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatapointstri3_hh)
+#define pylith_meshio_datawritervtkdatapointstri3_hh
+
+#include "DataWriterDataPoints.hh" // ISA DataWriterData
+
+namespace pylith {
+ namespace meshio {
+ class DataWriterVTKDataPointsTri3;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataPointsTri3 : public DataWriterDataPoints
+{ // DataWriterVTKDataPointsTri3
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataPointsTri3(void);
+
+ /// Destructor
+ ~DataWriterVTKDataPointsTri3(void);
+
+private:
+
+ static const char* _meshFilename; ///< Name of mesh file.
+ static const char* _faultLabel; ///< Name of group of vertices for fault.
+ static const int _faultId; ///< Material identifier for fault.
+
+ static const char* _timestepFilename; ///< Name of VTK file without fields.
+ static const char* _vertexFilename; ///< Name of VTK file for vertex fields.
+
+ static const PylithScalar _time; ///< Time for fields.
+ static const char* _timeFormat; ///< Format for time stamp.
+
+ /// @name Vertex field information.
+ //@{
+ static const int _numVertexFields; ///< Number of vertex fields.
+ static const int _numVertices; ///< Number of vertices.
+ static const FieldStruct _vertexFields[]; ///< Array of vertex fields.
+
+ static const PylithScalar _vertexField0[]; ///< Values for vertex field 0.
+ static const PylithScalar _vertexField1[]; ///< Values for vertex field 1.
+ static const PylithScalar _vertexField2[]; ///< Values for vertex field 2.
+ //@}
+
+ /// @name Point information.
+ //@{
+ static const int _numPoints; ///< Number of points.
+ static const int _spaceDim; ///< Spatial dimension.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+ //@}
+
+}; // DataWriterVTKDataPointsTri3
+
+#endif // pylith_meshio_datawritervtkdatapointstri3_hh
+
+// End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/Makefile.am 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/Makefile.am 2012-02-24 21:37:42 UTC (rev 19678)
@@ -186,7 +186,15 @@
tet4_fault_cell.h5 \
hex8_fault.h5 \
hex8_fault_vertex.h5 \
- hex8_fault_cell.h5
+ hex8_fault_cell.h5 \
+ tri3_points_t10.vtk \
+ tri3_points_vertex_t10.vtk \
+ quad4_points_t10.vtk \
+ quad4_points_vertex_t10.vtk \
+ tet4_points_t10.vtk \
+ tet4_points_vertex_t10.vtk \
+ hex8_points_t10.vtk \
+ hex8_points_vertex_t10.vtk
noinst_TMP =
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsData.hh"
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::meshio::OutputSolnPointsData::OutputSolnPointsData(void) :
+ meshFilename(0),
+ spaceDim(0),
+ numPoints(0),
+ points(0),
+ numVertices(0),
+ fiberDim(0),
+ field(0),
+ fieldInterp(0)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::meshio::OutputSolnPointsData::~OutputSolnPointsData(void)
+{ // destructor
+} // destructor
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsData.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,70 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointsdata_hh)
+#define pylith_meshio_outputsolnpointsdata_hh
+
+#include "pylith/utils/types.hh" // HASA PylithScalar
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsData;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public :
+
+ /// Constructor
+ OutputSolnPointsData(void);
+
+ /// Destructor
+ ~OutputSolnPointsData(void);
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public:
+
+ char* meshFilename; ///< Filename for input mesh
+
+ /// @name Point information.
+ //@{
+ int spaceDim; ///< Number of dimensions in vertex coordinates
+ int numPoints; ///< Number of points.
+ PylithScalar* points; ///< Coordinates of points.
+ //@}
+
+ /// @name Input data.
+ //@{
+ int numVertices;
+ int fiberDim;
+ PylithScalar* field; ///< Field over mesh.
+ //@}
+
+ /// @name Calculated values.
+ //@{
+ PylithScalar* fieldInterp; ///< Field interpolate to points.
+ //@}
+
+};
+
+#endif // pylith_meshio_outputsolnpointsdata_hh
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,79 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataHex8.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataHex8::_meshFilename =
+ "data/hex8.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataHex8::_spaceDim = 2;
+const int pylith::meshio::OutputSolnPointsDataHex8::_numPoints = 4;
+const PylithScalar pylith::meshio::OutputSolnPointsDataHex8::_points[] = {
+ 0.1, 0.4, 0.2,// interior points
+ 0.3, 0.1, 0.8,
+ 0.001, 0.75, -0.0,// edge
+ 0.999, 0.0, 0.0, // vertex
+};
+
+const int pylith::meshio::OutputSolnPointsDataHex8::_numVertices = 12;
+const int pylith::meshio::OutputSolnPointsDataHex8::_fiberDim = 1;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataHex8::_field[] = {
+ 1.0,
+ 1.1,
+ 1.2,
+ 1.3,
+ 1.4,
+ 1.5,
+ 1.6,
+ 1.7,
+ 1.8,
+ 1.9,
+ 2.0,
+ 2.1,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataHex8::_fieldInterp[] = {
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataHex8::OutputSolnPointsDataHex8(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataHex8::~OutputSolnPointsDataHex8(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointshex8_hh)
+#define pylith_meshio_outputsolnpointshex8_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataHex8;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataHex8 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataHex8(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataHex8(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointshex8_hh
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,79 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataQuad4.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataQuad4::_meshFilename =
+ "data/quad4.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataQuad4::_spaceDim = 2;
+const int pylith::meshio::OutputSolnPointsDataQuad4::_numPoints = 7;
+const PylithScalar pylith::meshio::OutputSolnPointsDataQuad4::_points[] = {
+ 0.0, 0.1, // interior points
+ 0.3, 0.4,
+ -0.6, -0.7,
+ -1.0, 0.9,
+ -0.3, 0.8,
+ 0.3, 0.99999, // edge point
+ -0.999999, 0.99999, // vertex point
+};
+
+const int pylith::meshio::OutputSolnPointsDataQuad4::_numVertices = 6;
+const int pylith::meshio::OutputSolnPointsDataQuad4::_fiberDim = 3;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataQuad4::_field[] = {
+ 1.0, 2.1, 3.2,
+ 1.1, 2.0, 3.3,
+ 1.2, 1.9, 3.4,
+ 1.3, 1.8, 3.5,
+ 1.4, 1.7, 3.6,
+ 1.5, 1.6, 3.7,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataQuad4::_fieldInterp[] = {
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataQuad4::OutputSolnPointsDataQuad4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataQuad4::~OutputSolnPointsDataQuad4(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointsquad4_hh)
+#define pylith_meshio_outputsolnpointsquad4_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataQuad4;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataQuad4 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataQuad4(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataQuad4(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointsquad4_hh
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,74 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataTet4.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataTet4::_meshFilename =
+ "data/tet4.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataTet4::_spaceDim = 3;
+const int pylith::meshio::OutputSolnPointsDataTet4::_numPoints = 5;
+const PylithScalar pylith::meshio::OutputSolnPointsDataTet4::_points[] = {
+ 0.1, 0.4, 0.1, // interior points
+ -0.2, 0.3, 0.2,
+ 0.3, 0.1, -0.0,
+ 0.001, 0.75, 0.0001, // edge
+ 0.999, 0.0, 0.0, // vertex
+};
+
+const int pylith::meshio::OutputSolnPointsDataTet4::_numVertices = 5;
+const int pylith::meshio::OutputSolnPointsDataTet4::_fiberDim = 2;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTet4::_field[] = {
+ 1.0, 2.5,
+ 1.1, 2.4,
+ 1.2, 2.3,
+ 1.3, 2.2,
+ 1.4, 2.1,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTet4::_fieldInterp[] = {
+ 0.0, 0.0,
+ 0.0, 0.0,
+ 0.0, 0.0,
+ 0.0, 0.0,
+ 0.0, 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataTet4::OutputSolnPointsDataTet4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataTet4::~OutputSolnPointsDataTet4(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointstet4_hh)
+#define pylith_meshio_outputsolnpointstet4_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataTet4;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataTet4 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataTet4(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataTet4(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointstet4_hh
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,73 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataTri3.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataTri3::_meshFilename =
+ "data/tri3.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataTri3::_spaceDim = 2;
+const int pylith::meshio::OutputSolnPointsDataTri3::_numPoints = 5;
+const PylithScalar pylith::meshio::OutputSolnPointsDataTri3::_points[] = {
+ 0.1, 0.4, // interior points
+ -0.2, 0.3,
+ 0.3, 0.1,
+ 0.001, 0.75, // edge
+ 0.999, 0.0, // vertex
+};
+
+const int pylith::meshio::OutputSolnPointsDataTri3::_numVertices = 4;
+const int pylith::meshio::OutputSolnPointsDataTri3::_fiberDim = 1;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTri3::_field[] = {
+ 1.0,
+ 1.1,
+ 1.2,
+ 1.3,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTri3::_fieldInterp[] = {
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataTri3::OutputSolnPointsDataTri3(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataTri3::~OutputSolnPointsDataTri3(void)
+{}
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointstri3_hh)
+#define pylith_meshio_outputsolnpointstri3_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataTri3;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataTri3 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataTri3(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataTri3(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointstri3_hh
+
+
+// End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_points_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,19 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 4 double
+-5.000000e-01 0.000000e+00 5.000000e-01
+-1.000000e-08 0.000000e+00 0.000000e+00
+-1.000000e-08 0.000000e+00 1.000000e+00
+1.000000e+00 1.000000e+00 -1.000000e+00
+CELLS 4 8
+1 0
+1 1
+1 2
+1 3
+CELL_TYPES 4
+1
+1
+1
+1
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_vertex_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_points_vertex_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_vertex_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/hex8_points_vertex_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,37 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 4 double
+-5.000000e-01 0.000000e+00 5.000000e-01
+-1.000000e-07 0.000000e+00 0.000000e+00
+-1.000000e-07 0.000000e+00 1.000000e+00
+1.000000e+00 1.000000e+00 -1.000000e+00
+CELLS 4 8
+1 0
+1 1
+1 2
+1 3
+CELL_TYPES 4
+1
+1
+1
+1
+POINT_DATA 3
+VECTORS displacements double
+1.193750e+01 1.303750e+01 1.390000e+01
+5.925000e+00 7.025000e+00 8.125000e+00
+2.950000e+00 4.050000e+00 5.150000e+00
+4.500000e+00 5.600000e+00 6.700000e+00
+SCALARS pressure double 1
+LOOKUP_TABLE default
+1.077500e+00
+7.950000e+00
+1.105000e+01
+7.600000e+00
+SCALARS other double 2
+LOOKUP_TABLE default
+4.112500e+00 4.537500e+00
+4.550000e+00 5.650000e+00
+2.400000e+00 3.500000e+00
+3.500000e+00 4.600000e+00
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/quad4_points_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,16 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 3 double
+-5.000000e-01 0.000000e+00 0.0
+1.000000e-08 0.000000e+00 0.0
+1.000000e+00 -1.000000e+00 0.0
+CELLS 3 6
+1 0
+1 1
+1 2
+CELL_TYPES 3
+1
+1
+1
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/quad4_points_vertex_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,31 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 3 double
+-5.000000e-01 0.000000e+00 0.0
+1.000000e-07 0.000000e+00 0.0
+9.999999e-01 -1.000000e+00 0.0
+CELLS 3 6
+1 0
+1 1
+1 2
+CELL_TYPES 3
+1
+1
+1
+POINT_DATA 3
+VECTORS displacements double
+4.400000e+00 5.500000e+00 0.0
+6.600000e+00 7.700000e+00 0.0
+9.900000e+00 1.010000e+01 0.0
+SCALARS pressure double 1
+LOOKUP_TABLE default
+3.750000e+00
+4.850000e+00
+6.500000e+00
+SCALARS other double 2
+LOOKUP_TABLE default
+4.500000e+00 5.600000e+00
+6.700000e+00 7.800000e+00
+9.800000e+00 7.600000e+00
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_points_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,19 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 4 double
+-3.333333e-01 0.000000e+00 3.333333e-01
+1.000000e-08 0.000000e+00 3.333333e-01
+1.000000e-08 0.000000e+00 1.000000e-08
+1.000000e-08 -1.000000e+00 1.000000e-08
+CELLS 4 8
+1 0
+1 1
+1 2
+1 3
+CELL_TYPES 4
+1
+1
+1
+1
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_vertex_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_points_vertex_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_vertex_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tet4_points_vertex_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,37 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 4 double
+-3.333333e-01 0.000000e+00 3.333333e-01
+1.000000e-09 0.000000e+00 3.333333e-01
+1.000000e-09 0.000000e+00 1.000000e-12
+1.000000e-09 -1.000000e+00 1.000000e-09
+CELLS 4 8
+1 0
+1 1
+1 2
+1 3
+CELL_TYPES 4
+1
+1
+1
+1
+POINT_DATA 4
+VECTORS displacements double
+1.495000e+01 1.580000e+01 1.690000e+01
+7.133333e+00 7.255556e+00 7.377778e+00
+7.200000e+00 8.300000e+00 9.400000e+00
+4.400000e+00 5.500000e+00 6.600000e+00
+SCALARS pressure double 1
+LOOKUP_TABLE default
+7.056000e+00
+4.300000e+00
+4.300000e+00
+3.200000e+00
+SCALARS other double 2
+LOOKUP_TABLE default
+1.030000e+01 1.145000e+01
+5.600000e+00 6.700000e+00
+5.600000e+00 6.700000e+00
+3.400000e+00 4.500000e+00
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_points_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,16 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 3 double
+-3.333333e-01 0.000000e+00 0.0
+1.000000e-07 0.000000e+00 0.0
+9.999999e-01 0.000000e+00 0.0
+CELLS 3 6
+1 0
+1 1
+1 2
+CELL_TYPES 3
+1
+1
+1
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_vertex_t10.vtk (from rev 19669, short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_points_vertex_t10.vtk)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_vertex_t10.vtk (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/meshio/data/tri3_points_vertex_t10.vtk 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,31 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 3 double
+-3.333333e-01 0.000000e+00 0.0
+1.000000e-07 0.000000e+00 0.0
+9.999999e-01 0.000000e+00 0.0
+CELLS 3 6
+1 0
+1 1
+1 2
+CELL_TYPES 3
+1
+1
+1
+POINT_DATA 3
+VECTORS displacements double
+7.366667e+00 8.133334e+00 0.0
+4.400000e+00 5.500000e+00 0.0
+7.700000e+00 8.800000e+00 0.0
+SCALARS pressure double 1
+LOOKUP_TABLE default
+5.400000e+00
+3.750000e+00
+5.400000e+00
+SCALARS other double 2
+LOOKUP_TABLE default
+7.133334e+00 8.233334e+00
+4.500000e+00 5.600000e+00
+7.800000e+00 8.900000e+00
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/topology/TestRefineUniform.cc
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/topology/TestRefineUniform.cc 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/libtests/topology/TestRefineUniform.cc 2012-02-24 21:37:42 UTC (rev 19678)
@@ -148,7 +148,7 @@
faultA.id(100);
if (0 != data.faultA) {
faultA.label(data.faultA);
- const int nvertices = faultA.numVertices(*mesh);
+ const int nvertices = faultA.numVerticesNoMesh(*mesh);
firstLagrangeVertex += nvertices;
firstFaultCell += 2*nvertices; // shadow + Lagrange vertices
} // if
@@ -157,7 +157,7 @@
faultB.id(101);
if (0 != data.faultB) {
faultA.label(data.faultB);
- const int nvertices = faultB.numVertices(*mesh);
+ const int nvertices = faultB.numVerticesNoMesh(*mesh);
firstLagrangeVertex += nvertices;
firstFaultCell += 2*nvertices; // shadow + Lagrange vertices
} // if
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestAbsorbingDampers.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestAbsorbingDampers.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestAbsorbingDampers.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -80,7 +80,8 @@
"""
(mesh, bc, fields) = self._initialize()
- self.assertAlmostEqual(1.0, bc.stableTimeStep(mesh)/1.0e+30, 5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, bc.stableTimeStep(mesh)/maxscalar(), 7)
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestNeumann.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestNeumann.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/bc/TestNeumann.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -80,7 +80,8 @@
"""
(mesh, bc, fields) = self._initialize()
- self.assertAlmostEqual(1.0, bc.stableTimeStep(mesh)/1.0e+30, 5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, bc.stableTimeStep(mesh)/maxscalar(), 7)
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveDyn.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveDyn.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveDyn.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -88,7 +88,7 @@
fault.inventory.faultLabel = "fault"
fault._configure()
- nvertices = fault.numVertices(mesh)
+ nvertices = fault.numVerticesNoMesh(mesh)
firstFaultVertex = 0
firstLagrangeVertex = nvertices
firstFaultCell = 2*nvertices
@@ -132,7 +132,8 @@
"""
(mesh, fault, fields) = self._initialize()
- self.assertAlmostEqual(1.0, fault.stableTimeStep(mesh)/1.0e+30, 5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, fault.stableTimeStep(mesh)/maxscalar(), 7)
return
@@ -315,7 +316,7 @@
fault.inventory.friction = friction
fault._configure()
- nvertices = fault.numVertices(mesh)
+ nvertices = fault.numVerticesNoMesh(mesh)
firstFaultVertex = 0
firstLagrangeVertex = nvertices
firstFaultCell = 2*nvertices
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveKin.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveKin.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/faults/TestFaultCohesiveKin.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -117,7 +117,7 @@
fault.inventory.faultLabel = "fault"
fault._configure()
- nvertices = fault.numVertices(mesh)
+ nvertices = fault.numVerticesNoMesh(mesh)
firstFaultVertex = 0
firstLagrangeVertex = nvertices
firstFaultCell = 2*nvertices
@@ -161,7 +161,8 @@
"""
(mesh, fault, fields) = self._initialize()
- self.assertAlmostEqual(1.0, fault.stableTimeStep(mesh)/1.0e+30, 5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, fault.stableTimeStep(mesh)/maxscalar(), 7)
return
@@ -347,7 +348,7 @@
eqsrc.inventory.slipfn = slipfn
eqsrc._configure()
- nvertices = fault.numVertices(mesh)
+ nvertices = fault.numVerticesNoMesh(mesh)
firstFaultVertex = 0
firstLagrangeVertex = nvertices
firstFaultCell = 2*nvertices
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicit.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicit.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicit.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -121,7 +121,8 @@
(mesh, integrator) = self._preinitialize()
fields = self._initialize(mesh, integrator)
- self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/1.0e+30, places=5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/maxscalar(), 7)
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityExplicitLgDeform.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -121,7 +121,8 @@
(mesh, integrator) = self._preinitialize()
fields = self._initialize(mesh, integrator)
- self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/1.0e+30, places=5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/maxscalar(), 7)
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicit.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicit.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicit.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -105,7 +105,8 @@
(mesh, integrator) = self._preinitialize()
fields = self._initialize(mesh, integrator)
- self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/1.0e+30, places=5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/maxscalar(), 7)
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/feassemble/TestElasticityImplicitLgDeform.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -105,7 +105,8 @@
(mesh, integrator) = self._preinitialize()
fields = self._initialize(mesh, integrator)
- self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/1.0e+30, places=5)
+ from pylith.utils.utils import maxscalar
+ self.assertAlmostEqual(1.0, integrator.stableTimeStep(mesh)/maxscalar(), 7)
return
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticIsotropic3D.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticIsotropic3D.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticIsotropic3D.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,7 +85,8 @@
from pylith.topology.Mesh import Mesh
mesh = Mesh()
dt = self.material.stableTimeStepImplicit(mesh)
- self.failIf(dt < 1.0e+30)
+ from pylith.utils.utils import maxdouble
+ self.assertAlmostEqual(1.0, dt/maxdouble())
def test_factory(self):
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStrain.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStrain.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStrain.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,7 +85,8 @@
from pylith.topology.Mesh import Mesh
mesh = Mesh()
dt = self.material.stableTimeStepImplicit(mesh)
- self.failIf(dt < 1.0e+30)
+ from pylith.utils.utils import maxdouble
+ self.assertAlmostEqual(1.0, dt/maxdouble())
def test_factory(self):
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStress.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStress.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticPlaneStress.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,7 +85,8 @@
from pylith.topology.Mesh import Mesh
mesh = Mesh()
dt = self.material.stableTimeStepImplicit(mesh)
- self.failIf(dt < 1.0e+30)
+ from pylith.utils.utils import maxdouble
+ self.assertAlmostEqual(1.0, dt/maxdouble())
def test_factory(self):
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStrain1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStrain1D.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStrain1D.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,7 +85,8 @@
from pylith.topology.Mesh import Mesh
mesh = Mesh()
dt = self.material.stableTimeStepImplicit(mesh)
- self.failIf(dt < 1.0e+30)
+ from pylith.utils.utils import maxdouble
+ self.assertAlmostEqual(1.0, dt/maxdouble())
def test_factory(self):
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStress1D.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStress1D.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/materials/TestElasticStress1D.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -85,7 +85,8 @@
from pylith.topology.Mesh import Mesh
mesh = Mesh()
dt = self.material.stableTimeStepImplicit(mesh)
- self.failIf(dt < 1.0e+30)
+ from pylith.utils.utils import maxdouble
+ self.assertAlmostEqual(1.0, dt/maxdouble())
def test_factory(self):
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/topology/TestRefineUniform.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/topology/TestRefineUniform.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/topology/TestRefineUniform.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -94,7 +94,7 @@
fault.inventory.faultLabel = faultGroup
fault._configure()
- nvertices = fault.numVertices(mesh)
+ nvertices = fault.numVerticesNoMesh(mesh)
firstFaultVertex = 0
firstLagrangeVertex = nvertices
firstFaultCell = 2*nvertices
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/Makefile.am
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/Makefile.am 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/Makefile.am 2012-02-24 21:37:42 UTC (rev 19678)
@@ -28,7 +28,8 @@
noinst_PYTHON = \
TestEventLogger.py \
- TestPetscManager.py
+ TestPetscManager.py \
+ TestConstants.py
# End of file
Copied: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/TestConstants.py (from rev 19669, short/3D/PyLith/trunk/unittests/pytests/utils/TestConstants.py)
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/TestConstants.py (rev 0)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/TestConstants.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -0,0 +1,51 @@
+#!/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/utils/TestEventLogger.py
+
+## @brief Unit testing of EventLogger object.
+
+import unittest
+
+
+# ----------------------------------------------------------------------
+class TestConstants(unittest.TestCase):
+ """
+ Unit testing of constants.
+ """
+
+
+ def test_maxdouble(self):
+ """
+ Test maxdouble()
+ """
+ from pylith.utils.utils import maxdouble
+ self.assertAlmostEqual(1.0, maxdouble()/1.0e+99, 7)
+ return
+
+
+ def test_maxflat(self):
+ """
+ Test maxflat()
+ """
+ from pylith.utils.utils import maxfloat
+ self.assertAlmostEqual(1.0, maxfloat()/1.0e+30, 7)
+ return
+
+
+# End of file
Modified: short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/testutils.py
===================================================================
--- short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/testutils.py 2012-02-24 21:36:44 UTC (rev 19677)
+++ short/3D/PyLith/branches/pylith-scecdynrup/unittests/pytests/utils/testutils.py 2012-02-24 21:37:42 UTC (rev 19678)
@@ -68,6 +68,9 @@
from TestEventLogger import TestEventLogger
suite.addTest(unittest.makeSuite(TestEventLogger))
+ from TestConstants import TestConstants
+ suite.addTest(unittest.makeSuite(TestConstants))
+
return suite
More information about the CIG-COMMITS
mailing list