[cig-commits] r13137 - short/3D/PyLith/trunk/tests/2d/tri3

brad at geodynamics.org brad at geodynamics.org
Mon Oct 27 21:40:35 PDT 2008


Author: brad
Date: 2008-10-27 21:40:34 -0700 (Mon, 27 Oct 2008)
New Revision: 13137

Removed:
   short/3D/PyLith/trunk/tests/2d/tri3/dislocation_disp.spatialdb
   short/3D/PyLith/trunk/tests/2d/tri3/dislocation_sliprate.spatialdb
   short/3D/PyLith/trunk/tests/2d/tri3/shearxy.spatialdb
Modified:
   short/3D/PyLith/trunk/tests/2d/tri3/Makefile.am
   short/3D/PyLith/trunk/tests/2d/tri3/TestDislocation.py
   short/3D/PyLith/trunk/tests/2d/tri3/TestShearPlaneStrain.py
   short/3D/PyLith/trunk/tests/2d/tri3/dislocation.cfg
   short/3D/PyLith/trunk/tests/2d/tri3/shearplanestrain.cfg
   short/3D/PyLith/trunk/tests/2d/tri3/testpylith.py
Log:
Updated shear and dislocation tests.

Modified: short/3D/PyLith/trunk/tests/2d/tri3/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/Makefile.am	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/Makefile.am	2008-10-28 04:40:34 UTC (rev 13137)
@@ -23,20 +23,23 @@
 	box_tri3_100m.exo \
 	matprops.spatialdb \
 	axialplanestrain.cfg \
-	axialx.spatialdb \
-	axialy.spatialdb \
 	shearplanestrain.cfg \
-	shearxy.spatialdb \
 	dislocation.cfg \
-	dislocation_disp.spatialdb \
-	dislocation_sliprate.spatialdb \
 	dislocation_slip.spatialdb \
 	dislocation_sliptime.spatialdb
 
 noinst_TMP = \
 	axialplanestrain_t0000000.vtk \
 	axialplanestrain-statevars-elastic_info.vtk \
-	axialplanestrain-statevars-elastic_t0000000.vtk
+	axialplanestrain-statevars-elastic_t0000000.vtk \
+	shearplanestrain_t0000000.vtk \
+	shearplanestrain-statevars-elastic_info.vtk \
+	shearplanestrain-statevars-elastic_t0000000.vtk \
+	dislocation_t0000000.vtk \
+	dislocation-statevars-elastic_info.vtk \
+	dislocation-statevars-elastic_t0000000.vtk \
+	dislocation-fault_info.vtk \
+	dislocation-fault_t0000000.vtk
 
 
 TESTS_ENVIRONMENT = $(PYTHON)

Modified: short/3D/PyLith/trunk/tests/2d/tri3/TestDislocation.py
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/TestDislocation.py	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/TestDislocation.py	2008-10-28 04:40:34 UTC (rev 13137)
@@ -10,7 +10,7 @@
 # ----------------------------------------------------------------------
 #
 
-## @file tests/2d/tri3/TestDislocationPlaneStrain.py
+## @file tests/2d/tri3/TestDislocation.py
 ##
 ## @brief Test suite for testing pylith with shear dislocation for 2-D
 ## box.
@@ -20,9 +20,8 @@
 # Local application
 from pylith.PyLithApp import PyLithApp
 class DislocationApp(PyLithApp):
-
-  def __init__(self, name="dislocation"):
-    PyLithApp.__init__(self, name)
+  def __init__(self):
+    PyLithApp.__init__(self, name="dislocation")
     return
 
 
@@ -38,7 +37,7 @@
   return
 
 
-class TestDislocationPlaneStrain(unittest.TestCase):
+class TestDislocation(unittest.TestCase):
   """
   Test suite for testing pylith with shear dislocation for 2-D box.
   """

Modified: short/3D/PyLith/trunk/tests/2d/tri3/TestShearPlaneStrain.py
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/TestShearPlaneStrain.py	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/TestShearPlaneStrain.py	2008-10-28 04:40:34 UTC (rev 13137)
@@ -16,16 +16,22 @@
 ## 2-D box.
 
 import unittest
-import numpy
-import tables
 
+# Local version of PyLithApp
+from pylith.PyLithApp import PyLithApp
+class ShearPlaneStrainApp(PyLithApp):
+  def __init__(self):
+    PyLithApp.__init__(self, name="shearplanestrain")
+    return
+
+
+# Helper function to run PyLith
 def run_pylith():
   """
   Run pylith.
   """
   if not "done" in dir(run_pylith):
-    from pylith.PyLithApp import PyLithApp
-    app = PyLithApp("shearplanestrain")
+    app = ShearPlaneStrainApp()
     app.run()
     run_pylith.done = True
   return

Modified: short/3D/PyLith/trunk/tests/2d/tri3/dislocation.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/dislocation.cfg	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/dislocation.cfg	2008-10-28 04:40:34 UTC (rev 13137)
@@ -1,51 +1,50 @@
 # -*- Python -*-
-[pylithapp]
+[dislocation]
 
 # ----------------------------------------------------------------------
 # journal
 # ----------------------------------------------------------------------
-[pylithapp.journal.info]
-timedependent = 1
-explicit = 1
-implicit = 1
-petsc = 1
-solverlinear = 1
-meshioascii = 1
-homogeneous = 1
-implicitelasticity = 1
-quadrature1d = 1
-fiatsimplex = 1
-faultcohesivekin = 1
+[dislocation.journal.info]
+#timedependent = 1
+#implicit = 1
+#petsc = 1
+#solverlinear = 1
+#meshiocubit = 1
+#implicitelasticity = 1
+#quadrature2d = 1
+#fiatsimplex = 1
 
 # ----------------------------------------------------------------------
 # mesh_generator
 # ----------------------------------------------------------------------
-[pylithapp.mesh_generator]
-debug = 1
+[dislocation.mesh_generator]
+#debug = 1
+importer = pylith.meshio.MeshIOCubit
 
-[pylithapp.mesh_generator.importer]
-filename = twocells.mesh
+[dislocation.mesh_generator.importer]
+filename = box_tri3_100m.exo
 coordsys.space_dim = 2
 
 # ----------------------------------------------------------------------
 # problem
 # ----------------------------------------------------------------------
-[pylithapp.timedependent]
-total_time = 0.0*s
-default_dt = 1.0*s
+[dislocation.timedependent]
 dimension = 2
-formulation = pylith.problems.Implicit
-bc = pylith.bc.BCSingle
-interfaces = pylith.faults.SingleFault
+bc = [x_neg,x_pos]
+interfaces = [fault]
 
+[dislocation.timedependent.formulation.time_step]
+total_time = 0.0*s
+
 # ----------------------------------------------------------------------
 # materials
 # ----------------------------------------------------------------------
-[pylithapp.timedependent.materials]
-material = pylith.materials.ElasticPlaneStrain
+[dislocation.timedependent]
+materials = [elastic]
+materials.elastic = pylith.materials.ElasticPlaneStrain
 
-[pylithapp.timedependent.materials.material]
-label = elastic material
+[dislocation.timedependent.materials.elastic]
+label = Elastic material
 id = 1
 db.iohandler.filename = matprops.spatialdb
 quadrature = pylith.feassemble.quadrature.Quadrature2D
@@ -54,39 +53,64 @@
 # ----------------------------------------------------------------------
 # boundary conditions
 # ----------------------------------------------------------------------
-[pylithapp.timedependent.bc.bc]
+[dislocation.timedependent.bc.x_neg]
 fixed_dof = [0, 1]
-id = 10
-label = end points
-db.label = Dirichlet BC
-db.iohandler.filename = dislocation_disp.spatialdb
+label = 12
+db = spatialdata.spatialdb.UniformDB
+db.label = Dirichlet BC -x edge
+db.values = [dof-0,dof-1]
+db.data = [0.0,-1.0]
 
+[dislocation.timedependent.bc.x_pos]
+fixed_dof = [0, 1]
+label = 11
+db = spatialdata.spatialdb.UniformDB
+db.label = Dirichlet BC +x edge
+db.values = [dof-0,dof-1]
+db.data = [0.0,+1.0]
+
 # ----------------------------------------------------------------------
 # faults
 # ----------------------------------------------------------------------
-[pylithapp.timedependent.interfaces]
+[dislocation.timedependent.interfaces]
 fault = pylith.faults.FaultCohesiveKin
 
-[pylithapp.timedependent.interfaces.fault]
+[dislocation.timedependent.interfaces.fault]
 id = 20
-label = fault
+label = 10
 quadrature = pylith.feassemble.quadrature.Quadrature1Din2D
 quadrature.cell.shape = line
+mat_db.iohandler.filename = matprops.spatialdb
 
-[pylithapp.timedependent.interfaces.fault.eq_src.slip_function]
+[dislocation.timedependent.interfaces.fault.eq_srcs.rupture.slip_function]
 slip.iohandler.filename = dislocation_slip.spatialdb
-slip_rate.iohandler.filename = dislocation_sliprate.spatialdb
 slip_time.iohandler.filename = dislocation_sliptime.spatialdb
 
 
 # ----------------------------------------------------------------------
 # PETSc
 # ----------------------------------------------------------------------
-[pylithapp.petsc]
-pc_type = jacobi
+[dislocation.petsc]
+ksp_rtol = 1.0e-8
+pc_type = asm
+ksp_max_it = 100
+ksp_gmres_restart = 50
+#ksp_monitor = true
+#ksp_view = true
+#log_summary = true
+# start_in_debugger = true
 
 # ----------------------------------------------------------------------
 # output
 # ----------------------------------------------------------------------
-[pylithapp.problem.formulation.output.output.writer]
+# Give basename for VTK domain output of solution over domain.
+[dislocation.problem.formulation.output.output.writer]
 filename = dislocation.vtk
+
+# Give basename for VTK output of state variables.
+[dislocation.timedependent.materials.elastic.output]
+cell_filter = pylith.meshio.CellFilterAvg
+writer.filename = dislocation-statevars-elastic.vtk
+
+[dislocation.timedependent.interfaces.fault.output.writer]
+filename = dislocation-fault.vtk

Deleted: short/3D/PyLith/trunk/tests/2d/tri3/dislocation_disp.spatialdb
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/dislocation_disp.spatialdb	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/dislocation_disp.spatialdb	2008-10-28 04:40:34 UTC (rev 13137)
@@ -1,14 +0,0 @@
-#SPATIAL.ascii 1
-SimpleDB {
-  num-values = 2
-  value-names =  dof-0 dof-1
-  value-units =  m  m
-  num-locs = 1
-  data-dim = 0
-  space-dim = 2
-  cs-data = cartesian {
-    to-meters = 1.0
-    space-dim = 2
-  }
-}
-0.0  0.0     0.0  0.0

Deleted: short/3D/PyLith/trunk/tests/2d/tri3/dislocation_sliprate.spatialdb
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/dislocation_sliprate.spatialdb	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/dislocation_sliprate.spatialdb	2008-10-28 04:40:34 UTC (rev 13137)
@@ -1,14 +0,0 @@
-#SPATIAL.ascii 1
-SimpleDB {
-  num-values = 1
-  value-names =  slip-rate
-  value-units =  m/s
-  num-locs = 1
-  data-dim = 0
-  space-dim = 2
-  cs-data = cartesian {
-    to-meters = 1.0
-    space-dim = 2
-  }
-}
-0.0  0.0  1.0e+6

Modified: short/3D/PyLith/trunk/tests/2d/tri3/shearplanestrain.cfg
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/shearplanestrain.cfg	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/shearplanestrain.cfg	2008-10-28 04:40:34 UTC (rev 13137)
@@ -1,50 +1,49 @@
 # -*- Python -*-
-[pylithapp]
+[shearplanestrain]
 
 # ----------------------------------------------------------------------
 # journal
 # ----------------------------------------------------------------------
-[pylithapp.journal.info]
-timedependent = 1
-explicit = 1
-implicit = 1
-petsc = 1
-solverlinear = 1
-meshioascii = 1
-homogeneous = 1
-explicitelasticity = 1
-quadrature2d = 1
-fiatsimplex = 1
+[shearplanestrain.journal.info]
+#timedependent = 1
+#implicit = 1
+#petsc = 1
+#solverlinear = 1
+#meshiocubit = 1
+#implicitelasticity = 1
+#quadrature2d = 1
+#fiatsimplex = 1
 
 # ----------------------------------------------------------------------
 # mesh_generator
 # ----------------------------------------------------------------------
-[pylithapp.mesh_generator]
-debug = 1
+[shearplanestrain.mesh_generator]
+#debug = 1
 importer = pylith.meshio.MeshIOCubit
 
-[pylithapp.mesh_generator.importer]
-filename = box.exo
+[shearplanestrain.mesh_generator.importer]
+filename = box_tri3_100m.exo
 coordsys.space_dim = 2
 
 # ----------------------------------------------------------------------
 # problem
 # ----------------------------------------------------------------------
-[pylithapp.timedependent]
-total_time = 0.0*s
-default_dt = 1.0*s
+[shearplanestrain.timedependent]
 dimension = 2
-formulation = pylith.problems.Implicit
-bc = pylith.bc.BCFourSides
+bc = [y_neg,y_pos]
 
+[shearplanestrain.timedependent.formulation.time_step]
+total_time = 0.0*s
+
 # ----------------------------------------------------------------------
 # materials
 # ----------------------------------------------------------------------
-[pylithapp.timedependent.materials]
-material = pylith.materials.ElasticPlaneStrain
+[shearplanestrain.timedependent]
+materials = [elastic]
+materials.elastic = pylith.materials.ElasticPlaneStrain
 
-[pylithapp.timedependent.materials.material]
-label = elastic material
+[shearplanestrain.timedependent.materials.elastic]
+label = Elastic material
 id = 1
 db.iohandler.filename = matprops.spatialdb
 quadrature = pylith.feassemble.quadrature.Quadrature2D
@@ -53,28 +52,43 @@
 # ----------------------------------------------------------------------
 # boundary conditions
 # ----------------------------------------------------------------------
-[pylithapp.timedependent.bc.x_neg]
+[shearplanestrain.timedependent.bc.y_neg]
 fixed_dof = [0, 1]
-id = 10
-label = 10
-db.label = Dirichlet BC -x edge
-db.iohandler.filename = shearxy.spatialdb
+label = 14
+db = spatialdata.spatialdb.UniformDB
+db.label = Dirichlet BC -y edge
+db.values = [dof-0,dof-1]
+db.data = [-1.0,0.0]
 
-[pylithapp.timedependent.bc.x_pos]
+[shearplanestrain.timedependent.bc.y_pos]
 fixed_dof = [0, 1]
-id = 11
-label = 11
-db.label = Dirichlet BC +x edge
-db.iohandler.filename = shearxy.spatialdb
+label = 13
+db = spatialdata.spatialdb.UniformDB
+db.label = Dirichlet BC +y edge
+db.values = [dof-0,dof-1]
+db.data = [+1.0,0.0]
 
 # ----------------------------------------------------------------------
 # PETSc
 # ----------------------------------------------------------------------
-[pylithapp.petsc]
-pc_type = jacobi
+[shearplanestrain.petsc]
+ksp_rtol = 1.0e-8
+pc_type = asm
+ksp_max_it = 100
+ksp_gmres_restart = 50
+#ksp_monitor = true
+#ksp_view = true
+#log_summary = true
+# start_in_debugger = true
 
 # ----------------------------------------------------------------------
 # output
 # ----------------------------------------------------------------------
-[pylithapp.problem.formulation.output.output.writer]
+# Give basename for VTK domain output of solution over domain.
+[shearplanestrain.problem.formulation.output.output.writer]
 filename = shearplanestrain.vtk
+
+# Give basename for VTK output of state variables.
+[shearplanestrain.timedependent.materials.elastic.output]
+cell_filter = pylith.meshio.CellFilterAvg
+writer.filename = shearplanestrain-statevars-elastic.vtk

Deleted: short/3D/PyLith/trunk/tests/2d/tri3/shearxy.spatialdb
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/shearxy.spatialdb	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/shearxy.spatialdb	2008-10-28 04:40:34 UTC (rev 13137)
@@ -1,15 +0,0 @@
-#SPATIAL.ascii 1
-SimpleDB {
-  num-values = 2
-  value-names =  dof-0  dof-1
-  value-units =  m  m
-  num-locs = 2
-  data-dim = 1
-  space-dim = 2
-  cs-data = cartesian {
-    to-meters = 1.0
-    space-dim = 2
-  }
-}
--200.0  0.0    0.0  -1.0
-+200.0  0.0    0.0  +1.0

Modified: short/3D/PyLith/trunk/tests/2d/tri3/testpylith.py
===================================================================
--- short/3D/PyLith/trunk/tests/2d/tri3/testpylith.py	2008-10-27 17:44:02 UTC (rev 13136)
+++ short/3D/PyLith/trunk/tests/2d/tri3/testpylith.py	2008-10-28 04:40:34 UTC (rev 13137)
@@ -23,11 +23,11 @@
   from TestAxialPlaneStrain import TestAxialPlaneStrain
   suite.addTest(unittest.makeSuite(TestAxialPlaneStrain))
 
-  #from TestShearPlaneStrain import TestShearPlaneStrain
-  #suite.addTest(unittest.makeSuite(TestShearPlaneStrain))
+  from TestShearPlaneStrain import TestShearPlaneStrain
+  suite.addTest(unittest.makeSuite(TestShearPlaneStrain))
 
-  #from TestDislocation import TestDislocation
-  #suite.addTest(unittest.makeSuite(TestDislocation))
+  from TestDislocation import TestDislocation
+  suite.addTest(unittest.makeSuite(TestDislocation))
 
   return suite
 



More information about the CIG-COMMITS mailing list