[cig-commits] r16512 - short/3D/PyLith/trunk/tests/2d/quad4

brad at geodynamics.org brad at geodynamics.org
Thu Apr 8 15:21:05 PDT 2010


Author: brad
Date: 2010-04-08 15:21:05 -0700 (Thu, 08 Apr 2010)
New Revision: 16512

Added:
   short/3D/PyLith/trunk/tests/2d/quad4/friction_compression.cfg
Removed:
   short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionQuad4.py
   short/3D/PyLith/trunk/tests/2d/quad4/friction-compression.cfg
Modified:
   short/3D/PyLith/trunk/tests/2d/quad4/Makefile.am
   short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionCompression.py
Log:
Work on full-scale friction test cases. Fixed name of application and removed superfluous class.

Modified: short/3D/PyLith/trunk/tests/2d/quad4/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/tests/2d/quad4/Makefile.am	2010-04-08 21:31:44 UTC (rev 16511)
+++ short/3D/PyLith/trunk/tests/2d/quad4/Makefile.am	2010-04-08 22:21:05 UTC (rev 16512)
@@ -30,7 +30,6 @@
 	rigidbody_gendb.py \
 	TestLgDeformTraction.py \
 	lgdeformtraction_soln.py \
-	TestFrictionQuad4.py \
 	TestFrictionCompression.py \
 	friction_compression_soln.py \
 	testpylith.py

Modified: short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionCompression.py
===================================================================
--- short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionCompression.py	2010-04-08 21:31:44 UTC (rev 16511)
+++ short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionCompression.py	2010-04-08 22:21:05 UTC (rev 16512)
@@ -15,7 +15,7 @@
 ## @brief Test suite for testing pylith with 2-D axial compression with friction.
 
 import numpy
-from TestFrictionQuad4 import TestFrictionQuad4
+from TestQuad4 import TestQuad4
 from friction_compression_soln import AnalyticalSoln
 from pylith.utils.VTKDataReader import has_vtk
 from pylith.utils.VTKDataReader import VTKDataReader
@@ -24,7 +24,7 @@
 from pylith.apps.PyLithApp import PyLithApp
 class CompressionApp(PyLithApp):
   def __init__(self):
-    PyLithApp.__init__(self, name="pylithapp")
+    PyLithApp.__init__(self, name="friction_compression")
     return
 
 
@@ -41,7 +41,7 @@
   return
 
 
-class TestFrictionCompression(TestFrictionQuad4):
+class TestFrictionCompression(TestQuad4):
   """
   Test suite for testing pylith with 2-D axial compression with friction.
   """
@@ -50,7 +50,7 @@
     """
     Setup for test.
     """
-    TestFrictionQuad4.setUp(self)
+    TestQuad4.setUp(self)
     run_pylith()
     self.outputRoot = "friction_compression"
     if has_vtk():

Deleted: short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionQuad4.py
===================================================================
--- short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionQuad4.py	2010-04-08 21:31:44 UTC (rev 16511)
+++ short/3D/PyLith/trunk/tests/2d/quad4/TestFrictionQuad4.py	2010-04-08 22:21:05 UTC (rev 16512)
@@ -1,93 +0,0 @@
-#!/usr/bin/env python
-#
-# ----------------------------------------------------------------------
-#
-#                           Brad T. Aagaard
-#                        U.S. Geological Survey
-#
-# <LicenseText>
-#
-# ----------------------------------------------------------------------
-#
-
-## @file tests/2d/quad4/TestFrictionQuad4.py
-##
-## @brief Generic tests for problems using 2-D mesh.
-
-import unittest
-import numpy
-
-class TestFrictionQuad4(unittest.TestCase):
-  """
-  Generic tests for problems using 2-D mesh.
-  """
-
-  def setUp(self):
-    """
-    Setup for tests.
-    """
-    self.mesh = {'ncells': 64,
-                 'ncorners': 4,
-                 'nvertices': 81,
-                 'spaceDim': 3,
-                 'tensorSize': 3}
-    return
-
-
-  def test_elastic_info(self):
-    """
-    Check elastic info.
-    """
-    if self.reader is None:
-      return
-
-    ncells= self.mesh['ncells']
-
-    filename = "%s-elastic_info.vtk" % self.outputRoot
-    from friction_compression_soln import p_mu,p_lambda,p_density
-
-    propMu =  p_mu*numpy.ones( (ncells, 1), dtype=numpy.float64)
-    propLambda = p_lambda*numpy.ones( (ncells, 1), dtype=numpy.float64)
-    propDensity = p_density*numpy.ones( (ncells, 2), dtype=numpy.float64)
-
-    properties = {'mu': propMu,
-                  'lambda': propLambda,
-                  'density': propDensity}
-
-    from pylith.tests.PhysicalProperties import check_properties
-    check_properties(self, filename, self.mesh, properties)
-
-    return
-
-
-  def test_soln(self):
-    """
-    Check solution (displacement) field.
-    """
-    if self.reader is None:
-      return
-
-    filename = "%s_t0000000.vtk" % self.outputRoot
-    from pylith.tests.Solution import check_displacements
-    check_displacements(self, filename, self.mesh)
-
-    return
-
-
-  def test_elastic_statevars(self):
-    """
-    Check elastic state variables.
-    """
-    if self.reader is None:
-      return
-
-    filename = "%s-elastic_t0000000.vtk" % self.outputRoot
-
-    from pylith.tests.StateVariables import check_state_variables
-    stateVars = ["total_strain", "stress"]
-    check_state_variables(self, filename, self.mesh, stateVars)
-
-    return
-
-
-# End of file

Deleted: short/3D/PyLith/trunk/tests/2d/quad4/friction-compression.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/2d/quad4/friction-compression.cfg	2010-04-08 21:31:44 UTC (rev 16511)
+++ short/3D/PyLith/trunk/tests/2d/quad4/friction-compression.cfg	2010-04-08 22:21:05 UTC (rev 16512)
@@ -1,176 +0,0 @@
-# -*- Python -*-
-[pylithapp]
-
-[pylithapp.launcher] # WARNING: THIS IS NOT PORTABLE
-command = mpirun -np ${nodes}
-
-# ----------------------------------------------------------------------
-# journal
-# ----------------------------------------------------------------------
-[pylithapp.journal.info]
-#timedependent = 1
-#implicit = 1
-#petsc = 1
-#solvernonlinear = 1
-#meshioascii = 1
-#homogeneous = 1
-#elasticityimplicit = 1
-#fiatlagrange = 1
-#quadrature1d = 1
-#faultcohesivedyn = 1
-
-# ----------------------------------------------------------------------
-# mesh_generator
-# ----------------------------------------------------------------------
-[pylithapp.mesh_generator]
-#debug = 1
-reader = pylith.meshio.MeshIOCubit
-
-[pylithapp.mesh_generator.reader]
-filename = mesh.exo
-coordsys.space_dim = 2
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-[pylithapp.timedependent]
-dimension = 2
-normalizer.length_scale = 1.0*m
-formulation = pylith.problems.Implicit
-formulation.solver = pylith.problems.SolverNonlinear
-
-# Set bc to an array with 3 boundary conditions: 'x_neg', 'y_neg' and 'x_pos'.
-bc = [x_neg,y_neg,x_pos]
-bc.x_pos = pylith.bc.Neumann
-
-# Set interfaces to an array with 1 fault: 'fault'.
-interfaces = [fault]
-
-
-[pylithapp.timedependent.formulation.time_step]
-total_time = 0.0*s
-dt = 1.0*s
-
-
-# ----------------------------------------------------------------------
-# materials
-# ----------------------------------------------------------------------
-# Specify the material information for the problem.
-# The material type is isotropic elastic formulated for plane strain.
-[pylithapp.timedependent.materials]
-material = pylith.materials.ElasticPlaneStrain
-
-[pylithapp.timedependent.materials.material]
-
-# We give a label of 'elastic material' to this material.
-label = elastic material
-
-# The cells associated with this material are given a material ID of 1
-# in the mesh file.
-id = 1
-
-# The properties for this material are given in the spatial database file
-# 'matprops.spatialdb'.
-db_properties.iohandler.filename = matprops.spatialdb
-
-# Set cell type to quadrilateral (2-d Lagrange).
-quadrature.cell = pylith.feassemble.FIATLagrange
-quadrature.cell.dimension = 2
-
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-# Provide information on the boundary conditions.
-
-# Boundary conditions to be applied to the negative x-side of the mesh.
-[pylithapp.timedependent.bc.x_neg]
-bc_dof = [0]
-label = 21
-
-# Boundary conditions to be applied to the negative y-side of the mesh.
-[pylithapp.timedependent.bc.y_neg]
-bc_dof = [1]
-label = 24
-
-# Boundary conditions to be applied to the positive x-side of the mesh.
-[pylithapp.timedependent.bc.x_pos]
-label = 20
-
-db_initial = spatialdata.spatialdb.UniformDB
-db_initial.label = Neumann BC +x edge
-db_initial.values = [traction-shear,traction-normal]
-db_initial.data = [0.0*MPa,-12000*MPa]
-
-quadrature.cell = pylith.feassemble.FIATLagrange
-quadrature.cell.dimension = 1
-
-# ----------------------------------------------------------------------
-# faults
-# ----------------------------------------------------------------------
-# Provide information on the fault (interface).
-[pylithapp.timedependent.interfaces]
-
-fault = pylith.faults.FaultCohesiveDyn
-
-# Define fault properties.
-[pylithapp.timedependent.interfaces.fault]
-
-# The nodes associated with this fault have the name 'fault' in the mesh file.
-label = 10
-
-# The quadrature for a 2D fault is 1D with a linear shape.
-quadrature.cell = pylith.feassemble.FIATLagrange
-quadrature.cell.dimension = 1
-
-db_initial_tractions = spatialdata.spatialdb.UniformDB
-db_initial_tractions.label = Initial fault tractions
-db_initial_tractions.values = [traction-shear,traction-normal]
-db_initial_tractions.data = [0.0*Pa, -10000.0*MPa]
-
-friction.db_properties = spatialdata.spatialdb.UniformDB
-friction.db_properties.label = Static friction
-friction.db_properties.values = [friction-coefficient,cohesion]
-friction.db_properties.data = [0.6*m,0.0*Pa]
-
-
-# ----------------------------------------------------------------------
-# PETSc
-# ----------------------------------------------------------------------
-[pylithapp.petsc]
-pc_type = asm
-
-# Change the preconditioner settings.
-sub_pc_factor_shift_type = nonzero
-
-ksp_rtol = 1.0e-8
-ksp_max_it = 100
-ksp_gmres_restart = 50
-snes_max_it = 200
-
-#ksp_monitor = true
-#ksp_view = true
-#ksp_converged_reason = true
-
-#snes_monitor = true
-#snes_view = true
-#snes_converged_reason = true
-
-#log_summary = true
-#start_in_debugger = true
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK domain output of solution over domain.
-[pylithapp.problem.formulation.output.output.writer]
-filename = friction-compression.vtk
-
-# Give basename for VTK fault output.
-[pylithapp.timedependent.interfaces.fault.output]
-writer.filename = friction-compression-fault.vtk
-vertex_info_fields = [strike_dir,normal_dir,initial_traction]
-
-# Give basename for VTK output of state variables.
-[pylithapp.timedependent.materials.material.output]
-cell_filter = pylith.meshio.CellFilterAvgMesh
-writer.filename = friction-compression-statevars.vtk

Copied: short/3D/PyLith/trunk/tests/2d/quad4/friction_compression.cfg (from rev 16510, short/3D/PyLith/trunk/tests/2d/quad4/friction-compression.cfg)
===================================================================
--- short/3D/PyLith/trunk/tests/2d/quad4/friction_compression.cfg	                        (rev 0)
+++ short/3D/PyLith/trunk/tests/2d/quad4/friction_compression.cfg	2010-04-08 22:21:05 UTC (rev 16512)
@@ -0,0 +1,176 @@
+# -*- Python -*-
+[friction_compression]
+
+[friction_compression.launcher] # WARNING: THIS IS NOT PORTABLE
+command = mpirun -np ${nodes}
+
+# ----------------------------------------------------------------------
+# journal
+# ----------------------------------------------------------------------
+[friction_compression.journal.info]
+#timedependent = 1
+#implicit = 1
+#petsc = 1
+#solvernonlinear = 1
+#meshioascii = 1
+#homogeneous = 1
+#elasticityimplicit = 1
+#fiatlagrange = 1
+#quadrature1d = 1
+#faultcohesivedyn = 1
+
+# ----------------------------------------------------------------------
+# mesh_generator
+# ----------------------------------------------------------------------
+[friction_compression.mesh_generator]
+#debug = 1
+reader = pylith.meshio.MeshIOCubit
+
+[friction_compression.mesh_generator.reader]
+filename = mesh.exo
+coordsys.space_dim = 2
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+[friction_compression.timedependent]
+dimension = 2
+normalizer.length_scale = 1.0*m
+formulation = pylith.problems.Implicit
+formulation.solver = pylith.problems.SolverNonlinear
+
+# Set bc to an array with 3 boundary conditions: 'x_neg', 'y_neg' and 'x_pos'.
+bc = [x_neg,y_neg,x_pos]
+bc.x_pos = pylith.bc.Neumann
+
+# Set interfaces to an array with 1 fault: 'fault'.
+interfaces = [fault]
+
+
+[friction_compression.timedependent.formulation.time_step]
+total_time = 0.0*s
+dt = 1.0*s
+
+
+# ----------------------------------------------------------------------
+# materials
+# ----------------------------------------------------------------------
+# Specify the material information for the problem.
+# The material type is isotropic elastic formulated for plane strain.
+[friction_compression.timedependent.materials]
+material = pylith.materials.ElasticPlaneStrain
+
+[friction_compression.timedependent.materials.material]
+
+# We give a label of 'elastic material' to this material.
+label = elastic material
+
+# The cells associated with this material are given a material ID of 1
+# in the mesh file.
+id = 1
+
+# The properties for this material are given in the spatial database file
+# 'matprops.spatialdb'.
+db_properties.iohandler.filename = matprops.spatialdb
+
+# Set cell type to quadrilateral (2-d Lagrange).
+quadrature.cell = pylith.feassemble.FIATLagrange
+quadrature.cell.dimension = 2
+
+# ----------------------------------------------------------------------
+# boundary conditions
+# ----------------------------------------------------------------------
+# Provide information on the boundary conditions.
+
+# Boundary conditions to be applied to the negative x-side of the mesh.
+[friction_compression.timedependent.bc.x_neg]
+bc_dof = [0]
+label = 21
+
+# Boundary conditions to be applied to the negative y-side of the mesh.
+[friction_compression.timedependent.bc.y_neg]
+bc_dof = [1]
+label = 24
+
+# Boundary conditions to be applied to the positive x-side of the mesh.
+[friction_compression.timedependent.bc.x_pos]
+label = 20
+
+db_initial = spatialdata.spatialdb.UniformDB
+db_initial.label = Neumann BC +x edge
+db_initial.values = [traction-shear,traction-normal]
+db_initial.data = [0.0*MPa,-12000*MPa]
+
+quadrature.cell = pylith.feassemble.FIATLagrange
+quadrature.cell.dimension = 1
+
+# ----------------------------------------------------------------------
+# faults
+# ----------------------------------------------------------------------
+# Provide information on the fault (interface).
+[friction_compression.timedependent.interfaces]
+
+fault = pylith.faults.FaultCohesiveDyn
+
+# Define fault properties.
+[friction_compression.timedependent.interfaces.fault]
+
+# The nodes associated with this fault have the name 'fault' in the mesh file.
+label = 10
+
+# The quadrature for a 2D fault is 1D with a linear shape.
+quadrature.cell = pylith.feassemble.FIATLagrange
+quadrature.cell.dimension = 1
+
+db_initial_tractions = spatialdata.spatialdb.UniformDB
+db_initial_tractions.label = Initial fault tractions
+db_initial_tractions.values = [traction-shear,traction-normal]
+db_initial_tractions.data = [0.0*Pa, -10000.0*MPa]
+
+friction.db_properties = spatialdata.spatialdb.UniformDB
+friction.db_properties.label = Static friction
+friction.db_properties.values = [friction-coefficient,cohesion]
+friction.db_properties.data = [0.6*m,0.0*Pa]
+
+
+# ----------------------------------------------------------------------
+# PETSc
+# ----------------------------------------------------------------------
+[friction_compression.petsc]
+pc_type = asm
+
+# Change the preconditioner settings.
+sub_pc_factor_shift_type = nonzero
+
+ksp_rtol = 1.0e-8
+ksp_max_it = 100
+ksp_gmres_restart = 50
+snes_max_it = 200
+
+#ksp_monitor = true
+#ksp_view = true
+#ksp_converged_reason = true
+
+#snes_monitor = true
+#snes_view = true
+#snes_converged_reason = true
+
+#log_summary = true
+#start_in_debugger = true
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+# Give basename for VTK domain output of solution over domain.
+[friction_compression.problem.formulation.output.output.writer]
+filename = friction_compression.vtk
+
+# Give basename for VTK fault output.
+[friction_compression.timedependent.interfaces.fault.output]
+writer.filename = friction_compression-fault.vtk
+vertex_info_fields = [strike_dir,normal_dir,initial_traction]
+
+# Give basename for VTK output of state variables.
+[friction_compression.timedependent.materials.material.output]
+cell_filter = pylith.meshio.CellFilterAvgMesh
+writer.filename = friction_compression-statevars.vtk



More information about the CIG-COMMITS mailing list