[cig-commits] r7962 - in short/3D/PyLith/trunk/examples: .
twofaults twofaults/2d
willic3 at geodynamics.org
willic3 at geodynamics.org
Thu Sep 13 09:01:07 PDT 2007
Author: willic3
Date: 2007-09-13 09:01:06 -0700 (Thu, 13 Sep 2007)
New Revision: 7962
Added:
short/3D/PyLith/trunk/examples/twofaults/
short/3D/PyLith/trunk/examples/twofaults/2d/
short/3D/PyLith/trunk/examples/twofaults/2d/dislocation.cfg
short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliprate.spatialdb
short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliptime.spatialdb
short/3D/PyLith/trunk/examples/twofaults/2d/displacement.spatialdb
short/3D/PyLith/trunk/examples/twofaults/2d/fault_1_slip.spatialdb
short/3D/PyLith/trunk/examples/twofaults/2d/fault_2_slip.spatialdb
short/3D/PyLith/trunk/examples/twofaults/2d/faults.odb
short/3D/PyLith/trunk/examples/twofaults/2d/matprops.spatialdb
short/3D/PyLith/trunk/examples/twofaults/2d/mazecmds
short/3D/PyLith/trunk/examples/twofaults/2d/pylithapp.cfg
short/3D/PyLith/trunk/examples/twofaults/2d/twofaults.odb
short/3D/PyLith/trunk/examples/twofaults/2d/twofaults2d.mesh
short/3D/PyLith/trunk/examples/twofaults/2d/twomaterials.odb
short/3D/PyLith/trunk/examples/twofaults/3d/
Log:
Simple example problem with 2 faults.
At present, there are problems with either the problem setup or the
code, and some debugging will be needed.
Added: short/3D/PyLith/trunk/examples/twofaults/2d/dislocation.cfg
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/dislocation.cfg 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/dislocation.cfg 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,86 @@
+# -*- Python -*-
+
+# The settings in this file (dislocation.cfg) will be read if it is
+# specified on the command line:
+# 'pylith dislocation.cfg'
+
+# If this file is given, the settings in this file will override all
+# others except for parameters specified directly on the command line.
+
+# These settings define an implicit problem using a fault with
+# kinematically-specified slip.
+
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# journal
+# ----------------------------------------------------------------------
+# Journal settings in addition to those given in 'pylithapp.cfg'
+[pylithapp.journal.info]
+quadrature1d = 1
+faultcohesivekin = 1
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+# Specify the problem settings.
+# This is a time-dependent problem so we use that facility.
+[pylithapp.timedependent]
+
+# We want an implicit formulation.
+formulation = pylith.problems.Implicit
+
+# This is a container for a boundary condition specified at a point.
+bc = pylith.bc.BCFourSides
+
+# This is a container for two faults
+interfaces = twofaults
+
+# ----------------------------------------------------------------------
+# 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]
+fixed_dof = [0, 1]
+label = x_neg
+db.label = Dirichlet BC -x edge
+db.iohandler.filename = displacement.spatialdb
+
+# ----------------------------------------------------------------------
+# faults
+# ----------------------------------------------------------------------
+# Provide information on the fault (interface).
+[pylithapp.timedependent.interfaces]
+
+# Define fault 1 properties.
+[pylithapp.timedependent.interfaces.fault_1]
+label = fault_1
+mat_db.iohandler.filename = matprops.spatialdb
+quadrature = pylith.feassemble.quadrature.Quadrature1Din2D
+quadrature.cell.shape = line
+[pylithapp.timedependent.interfaces.fault_1.eq_src.slip_function]
+slip.iohandler.filename = fault_1_slip.spatialdb
+slip.query_type = nearest
+slip_rate.iohandler.filename = dislocation_sliprate.spatialdb
+slip_time.iohandler.filename = dislocation_sliptime.spatialdb
+
+# Define fault 2 properties.
+[pylithapp.timedependent.interfaces.fault_2]
+label = fault_2
+mat_db.iohandler.filename = matprops.spatialdb
+quadrature = pylith.feassemble.quadrature.Quadrature1Din2D
+quadrature.cell.shape = line
+[pylithapp.timedependent.interfaces.fault_2.eq_src.slip_function]
+slip.iohandler.filename = fault_2_slip.spatialdb
+slip.query_type = nearest
+slip_rate.iohandler.filename = dislocation_sliprate.spatialdb
+slip_time.iohandler.filename = dislocation_sliptime.spatialdb
+
+# ----------------------------------------------------------------------
+# output
+# ----------------------------------------------------------------------
+# Give basename for vtk output.
+[pylithapp.problem.formulation.output.output]
+filename = twofaults2d.vtk
Added: short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliprate.spatialdb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliprate.spatialdb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliprate.spatialdb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,41 @@
+#SPATIAL.ascii 1
+
+// This database is used to specify the fault slip rate for the
+// dislocation (kinematic fault) example.
+SimpleDB {
+
+ // There is one value specified in the database, corresponding to the
+ // slip rate.
+ num-values = 1
+ value-names = slip-rate
+
+ // The fault slip rate has units of meters/second.
+ value-units = m/s
+
+ // The value is specified at one spatial location.
+ num-locs = 1
+
+ // The dimension of the spatial distribution is 0, since the same data
+ // is specified for all points in the set.
+ data-dim = 0
+
+ // The spatial dimension of the database is 2.
+ space-dim = 2
+
+ // We are specifying the data in a Cartesian coordinate system.
+ cs-data = cartesian {
+
+ // Our units are already in meters, so we can just multiply by one.
+ to-meters = 1.0
+
+ // We are using a 2D Cartesian coordinate system.
+ space-dim = 2
+ }
+}
+
+// This is where the data is specified.
+// As described in dislocation.cfg, this database will be used to specify
+// uniform data for a fault (pylith.faults.SingleFault).
+// The entries are:
+// X-Coord, Y-Coord, slip rate
+0.0 0.0 1.0e+6
Added: short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliptime.spatialdb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliptime.spatialdb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/dislocation_sliptime.spatialdb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,41 @@
+#SPATIAL.ascii 1
+
+// This database is used to specify the fault slip time for the
+// dislocation (kinematic fault) example.
+SimpleDB {
+
+ // There is one value specified in the database, corresponding to the
+ // time at which fault slip begins.
+ num-values = 1
+ value-names = slip-time
+
+ // The fault slip time has units of meters.
+ value-units = s
+
+ // The value is specified at one spatial location.
+ num-locs = 1
+
+ // The dimension of the spatial distribution is 0, since the same data
+ // is specified for all points in the set.
+ data-dim = 0
+
+ // The spatial dimension of the database is 2.
+ space-dim = 2
+
+ // We are specifying the data in a Cartesian coordinate system.
+ cs-data = cartesian {
+
+ // Our units are already in meters, so we can just multiply by one.
+ to-meters = 1.0
+
+ // We are using a 2D Cartesian coordinate system.
+ space-dim = 2
+ }
+}
+
+// This is where the data is specified.
+// As described in dislocation.cfg, this database will be used to specify
+// uniform data for a fault (pylith.faults.SingleFault).
+// The entries are:
+// X-Coord, Y-Coord, slip time
+0.0 0.0 -1.0
Added: short/3D/PyLith/trunk/examples/twofaults/2d/displacement.spatialdb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/displacement.spatialdb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/displacement.spatialdb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,43 @@
+#SPATIAL.ascii 1
+
+// This database is used to specify the boundary conditions for the
+// dislocation (kinematic fault) example.
+
+// This follows the format for a Simple DB (the only type presently available).
+SimpleDB {
+
+ // There are two values specified in the database, corresponding to the
+ // constraint values for the x (dof-0) and y (dof-1) degrees of freedom.
+ num-values = 2
+ value-names = dof-0 dof-1
+
+ // The constraint values (displacements) have units of meters.
+ value-units = m m
+
+ // The values are specified at one spatial location.
+ num-locs = 1
+
+ // The dimension of the spatial distribution is 0, since the data
+ // is specified at a single point.
+ data-dim = 0
+
+ // The spatial dimension of the database is 2.
+ space-dim = 2
+
+ // We are specifying the data in a Cartesian coordinate system.
+ cs-data = cartesian {
+
+ // Our units are already in meters, so we can just multiply by one.
+ to-meters = 1.0
+
+ // We are using a 2D Cartesian coordinate system.
+ space-dim = 2
+ }
+}
+
+// This is where the data is specified.
+// As described in dislocation.cfg, this database will be used to specify
+// data along an edge (pylith.bc.BCFourSides).
+// The entries are:
+// X-coord, Y-coord, dof-0 (x constraint), dof-1 (y constraint).
+ 0.0 0.0 0.0 0.0
Added: short/3D/PyLith/trunk/examples/twofaults/2d/fault_1_slip.spatialdb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/fault_1_slip.spatialdb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/fault_1_slip.spatialdb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,45 @@
+#SPATIAL.ascii 1
+
+// This database is used to specify the fault slip for the
+// dislocation (kinematic fault) example.
+SimpleDB {
+
+ // There are two values specified in the database, corresponding to the
+ // slip values for the left-lateral and fault-opening components.
+ num-values = 2
+ value-names = left-lateral-slip fault-opening
+
+ // The fault slip values have units of meters.
+ value-units = m m
+
+ // The values are specified at each vertex on the fault.
+ num-locs = 5
+
+ // The dimension of the spatial distribution is 1, since the data
+ // locations form a line.
+ data-dim = 1
+
+ // The spatial dimension of the database is 2.
+ space-dim = 2
+
+ // We are specifying the data in a Cartesian coordinate system.
+ cs-data = cartesian {
+
+ // Our units are already in meters, so we can just multiply by one.
+ to-meters = 1.0
+
+ // We are using a 2D Cartesian coordinate system.
+ space-dim = 2
+ }
+}
+
+// This is where the data is specified.
+// As described in dislocation.cfg, this database will be used to specify
+// uniform data for a fault (pylith.faults.SingleFault).
+// The entries are:
+// X-Coord, Y-Coord, left-lateral slip, fault-opening slip
+ 8.0 16.0 0.01 0.0
+ 9.0 15.0 0.02 0.0
+10.0 14.0 0.03 0.0
+11.0 13.0 0.04 0.0
+12.0 12.0 0.05 0.0
Added: short/3D/PyLith/trunk/examples/twofaults/2d/fault_2_slip.spatialdb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/fault_2_slip.spatialdb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/fault_2_slip.spatialdb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,48 @@
+#SPATIAL.ascii 1
+
+// This database is used to specify the fault slip for the
+// dislocation (kinematic fault) example.
+SimpleDB {
+
+ // There are two values specified in the database, corresponding to the
+ // slip values for the left-lateral and fault-opening components.
+ num-values = 2
+ value-names = left-lateral-slip fault-opening
+
+ // The fault slip values have units of meters.
+ value-units = m m
+
+ // The values are specified at each vertex on the fault.
+ num-locs = 8
+
+ // The dimension of the spatial distribution is 1, since the data
+ // locations form a line.
+ data-dim = 1
+
+ // The spatial dimension of the database is 2.
+ space-dim = 2
+
+ // We are specifying the data in a Cartesian coordinate system.
+ cs-data = cartesian {
+
+ // Our units are already in meters, so we can just multiply by one.
+ to-meters = 1.0
+
+ // We are using a 2D Cartesian coordinate system.
+ space-dim = 2
+ }
+}
+
+// This is where the data is specified.
+// As described in dislocation.cfg, this database will be used to specify
+// uniform data for a fault (pylith.faults.SingleFault).
+// The entries are:
+// X-Coord, Y-Coord, left-lateral slip, fault-opening slip
+12.0 10.5 0.08 0.0
+12.0 9.0 0.07 0.0
+12.0 7.5 0.06 0.0
+12.0 6.0 0.05 0.0
+12.0 4.5 0.04 0.0
+12.0 3.0 0.03 0.0
+12.0 1.5 0.02 0.0
+12.0 0.0 0.01 0.0
Added: short/3D/PyLith/trunk/examples/twofaults/2d/faults.odb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/faults.odb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/faults.odb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## Template for user-defined faults container.
+##
+## Copy this file to your working directory and rename it as
+## appropriate. Note: the extension MUST rename ".odb" for PyLith to
+## find it.
+##
+## To use this container, in your .cfg file, bind this component to
+## the interfaces facility of the problem:
+##
+## [pylithapp.timedependent]
+## interfaces = MyFaults
+##
+## You can then set the properties of the facilities in this container
+## just as you would any other Pyre component.
+##
+## For example:
+##
+## [pylithapp.timedependent.interfaces.san_andreas]
+## label = San Andreas Fault
+## id = 2
+
+# Parent class
+from pylith.utils.ObjectBin import ObjectBin
+
+# Define new faults container class
+#
+# You can change the name of this class, but the name here MUST match
+# the one in the object_bin() function at the bottom of this file.
+class MyFaults(ObjectBin):
+ """
+ User-defined boundary conditions container.
+
+ Factory: object_bin
+ """
+
+ # INVENTORY //////////////////////////////////////////////////////////
+
+ class Inventory(ObjectBin.Inventory):
+ """
+ Python object for managing MyBC facilities and properties.
+ """
+
+ # Define the facilities in this faults container.
+ #
+ # You must import any Python objects that are bound to the
+ # facilities.
+ #
+ # Synopsis:
+ #
+ # facilityName = pyre.inventory.facility("facility_name",
+ # family="fault", factory=ClassNameOfComponent)
+ #
+ # where ClassNameOfComponent is the class name of the default
+ # component to bind to the facility 'facility_name'.
+
+ import pyre.inventory
+
+ from pylith.faults.FaultCohesiveKin import FaultCohesiveKin
+
+ sanandreas = pyre.inventory.facility("san_andreas", family="fault",
+ factory=FaultCohesiveKin)
+ sanandreas.meta['tip'] = "San Andreas fault."
+
+ sanjacinto = pyre.inventory.facility("san_jacinto", family="fault",
+ factory=FaultCohesiveKin)
+ sanjacinto.meta['tip'] = "San Jacinto fault."
+
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ # The 'name' argument on the next line defines the default name used
+ # to configure this component. Generally, we use the class name in
+ # lowercase.
+ def __init__(self, name="myfaults"):
+ """
+ Constructor.
+ """
+ ObjectBin.__init__(self, name)
+ return
+
+
+ # PRIVATE METHODS ////////////////////////////////////////////////////
+
+ def _configure(self):
+ """
+ Set attributes from inventory.
+ """
+ ObjectBin._configure(self)
+
+ # Define how the components are ordered in the container.
+ #
+ # Synopsis:
+ #
+ # self.bin = [self.inventory.facilityName1,
+ # self.inventory.facilityName2]
+ #
+ # Replace the names of the facilities as desired. The names MUST
+ # match the VARIABLES in the inventory, as opposed to the names
+ # used to bind the components to the facilities, which is the
+ # first arugment in the calls to pyre.inventory.facility()).
+ #
+ # DO NOT change the name 'self.bin'.
+ self.bin = [self.inventory.sanjacinto,
+ self.inventory.sanandreas]
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def object_bin():
+ """
+ Factory associated with MyFaults.
+ """
+ # The class name for the container used above MUST match the name
+ # used on the next line.
+ return MyFaults()
+
+
+# End of file
Added: short/3D/PyLith/trunk/examples/twofaults/2d/matprops.spatialdb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/matprops.spatialdb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/matprops.spatialdb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,46 @@
+#SPATIAL.ascii 1
+
+// This database is used to specify the material properties for all of the
+// examples in this directory.
+
+// This follows the format for a Simple DB (the only type presently available).
+SimpleDB {
+
+ // There are 3 values specified in the database, corresponding to density,
+ // S-velocity, and P-velocity (values for shear modulus and Lame's constant
+ // are computed from these values.
+ num-values = 3
+ value-names = density vs vp
+
+ // These are the units used to specify density, vs, and vp.
+ value-units = kg/m^3 m/s m/s
+
+ // Values are only specified at a single point since they are constant
+ // throughout the mesh.
+ num-locs = 1
+
+ // The dimension of the spatial distribution is 0, since it is constant
+ // throughout the mesh.
+ data-dim = 0
+
+ // The spatial dimension of the database is 2.
+ space-dim = 2
+
+ // We are specifying the data in a Cartesian coordinate system.
+ cs-data = cartesian {
+
+ // Our units are already in meters, so we can just multiply by one.
+ to-meters = 1.0
+
+ // We are using a 2D Cartesian coordinate system.
+ space-dim = 2
+ }
+}
+// This is where the data is specified.
+// We only need to specify a single point, since the properties are uniform.
+// The values given here will give a shear modulus and Lame's constant both
+// equal to 30 GPa (Poisson's ratio = 0.25).
+// The entries are:
+// X-coord, Y-coord, density, Vs, Vp.
+
+0.0 0.0 2700.0 3333.333333333333 5773.502691896258
Added: short/3D/PyLith/trunk/examples/twofaults/2d/mazecmds
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/mazecmds 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/mazecmds 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,81 @@
+ 2
+c
+c 2D PyLith test problem consisting of 2 fault segments cutting through
+c a square domain.
+c
+c
+c Line definitions
+c
+c
+c Outer boundaries
+c
+ld 1
+lp 2 0.0 0.0 16.0 0.0
+ld 2
+lp 2 16.0 0.0 16.0 16.0
+ld 3
+lp 2 16.0 16.0 0.0 16.0
+ld 4
+lp 2 0.0 16.0 0.0 0.0
+c
+c Fault segment 1 (45 degree angle)
+c
+ld 5
+lp 2 8.0 16.0 12.0 12.0
+c
+c Fault segment 2 (90 degree angle)
+c
+ld 6
+lp 2 12.0 12.0 12.0 0.0
+c
+c Auxiliary segment
+c
+ld 7
+lp 2 0.0 12.0 16.0 12.0
+c
+c Part definitions
+c
+c
+c Left side of faults
+c
+part 1 6 7 4 1 8 8
+y
+part 7 5 3 4 1 8 4
+y
+c
+c Right side of faults
+part 1 2 7 6 2 4 8
+y
+part 2 3 5 7 2 4 4
+y
+pv
+assm
+delt 1.
+nstep 1
+anal 0
+pltt 1.
+prtt 1.
+lcd 1 2 0. 0. 1. 1.
+lcd 2 2 0. 0. 1. 1.
+lcd 3 2 0. 0. 1. 1.
+lcd 4 2 0. 0. 1. 1.
+mg 1 2
+mg 1 3
+mg 1 4
+mg 3 4
+c p 1 b
+c pbcs 3 1 1. 1.
+wbcd nike2d
+mat 1 1
+ro 2700.
+e 1.25e10
+pr 0.25
+endmat
+mat 2 1
+ro 2700.
+e 1.25e10
+pr 0.25
+endmat
+fson
+o
+end
Property changes on: short/3D/PyLith/trunk/examples/twofaults/2d/mazecmds
___________________________________________________________________
Name: svn:executable
+ *
Added: short/3D/PyLith/trunk/examples/twofaults/2d/pylithapp.cfg
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/pylithapp.cfg 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/pylithapp.cfg 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,101 @@
+# -*- Python -*-
+
+# The settings in this file (pylithapp.cfg) will be read automatically
+# by pylith, as long as the file is placed in the run directory.
+
+# The settings in this file will override any settings in:
+# PREFIX/etc/pylithapp.cfg
+# $HOME/.pyre/pylithapp/pylithapp.cfg
+
+# The settings in this file will be overridden by any .cfg file given
+# on the command line or by any command line settings.
+
+[pylithapp]
+
+# ----------------------------------------------------------------------
+# journal
+# ----------------------------------------------------------------------
+# The settings below turn on journal info for the specified components.
+# If you want less output to stdout, you can turn these off.
+[pylithapp.journal.info]
+timedependent = 1
+explicit = 1
+implicit = 1
+petsc = 1
+solverlinear = 1
+meshioascii = 1
+homogeneous = 1
+implicitelasticity = 1
+quadrature2d = 1
+fiatsimplex = 1
+
+# ----------------------------------------------------------------------
+# mesh_generator
+# ----------------------------------------------------------------------
+# The settings below control the mesh generation (importing mesh info).
+# Turn on debugging output for mesh generation.
+[pylithapp.mesh_generator]
+debug = 1
+
+# This component specification means we are using PyLith ASCII format,
+# and we then specify the filename and number of space dimensions for
+# the mesh.
+[pylithapp.mesh_generator.importer]
+filename = twofaults2d.mesh
+coordsys.space_dim = 2
+
+# ----------------------------------------------------------------------
+# problem
+# ----------------------------------------------------------------------
+# Specify the problem settings.
+# This is a time-dependent problem, so we select this as our problem type.
+# We select a total time of 1 sec, and a time step size of 1 sec, so we
+# are performing a single time step.
+# The spatial dimension for this problem is 2.
+# For an implicit formulation (using implicit.cfg), we will perform 1
+# implicit time step from t = -1.0 to t = 0.0 (elastic solution step).
+[pylithapp.timedependent]
+total_time = 0.0*s
+default_dt = 1.0*s
+dimension = 2
+formulation = pylith.problems.Implicit
+
+# ----------------------------------------------------------------------
+# materials
+# ----------------------------------------------------------------------
+# Specify the material information for the problem.
+# The material type is isotropic elastic formulated for plane strain.
+[pylithapp.timedependent]
+materials = twomaterials
+
+[pylithapp.timedependent.materials]
+material_1 = pylith.materials.ElasticPlaneStrain
+material_2 = pylith.materials.ElasticPlaneStrain
+
+[pylithapp.timedependent.materials.material_1]
+label = elastic material
+id = 1
+db.iohandler.filename = matprops.spatialdb
+quadrature = pylith.feassemble.quadrature.Quadrature2D
+quadrature.cell = pylith.feassemble.FIATLagrange
+quadrature.cell.dimension = 2
+
+[pylithapp.timedependent.materials.material_2]
+label = elastic material
+id = 2
+db.iohandler.filename = matprops.spatialdb
+quadrature = pylith.feassemble.quadrature.Quadrature2D
+quadrature.cell = pylith.feassemble.FIATLagrange
+quadrature.cell.dimension = 2
+
+# ----------------------------------------------------------------------
+# PETSc
+# ----------------------------------------------------------------------
+# We are using all of the default settings for PETSc except for specifying
+# the block Jacobi preconditioner.
+# Additional PETSc command-line arguments may be found in the PETSc
+# documentation.
+[pylithapp.petsc]
+pc_type = asm
+# start_in_debugger = true
+# debugger_timeout = 100
Added: short/3D/PyLith/trunk/examples/twofaults/2d/twofaults.odb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/twofaults.odb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/twofaults.odb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## Template for user-defined faults container.
+##
+## Copy this file to your working directory and rename it as
+## appropriate. Note: the extension MUST rename ".odb" for PyLith to
+## find it.
+##
+## To use this container, in your .cfg file, bind this component to
+## the interfaces facility of the problem:
+##
+## [pylithapp.timedependent]
+## interfaces = MyFaults
+##
+## You can then set the properties of the facilities in this container
+## just as you would any other Pyre component.
+##
+## For example:
+##
+## [pylithapp.timedependent.interfaces.san_andreas]
+## label = San Andreas Fault
+## id = 2
+
+# Parent class
+from pylith.utils.ObjectBin import ObjectBin
+
+# Define new faults container class
+#
+# You can change the name of this class, but the name here MUST match
+# the one in the object_bin() function at the bottom of this file.
+class TwoFaults(ObjectBin):
+ """
+ User-defined boundary conditions container.
+
+ Factory: object_bin
+ """
+
+ # INVENTORY //////////////////////////////////////////////////////////
+
+ class Inventory(ObjectBin.Inventory):
+ """
+ Python object for managing MyBC facilities and properties.
+ """
+
+ # Define the facilities in this faults container.
+ #
+ # You must import any Python objects that are bound to the
+ # facilities.
+ #
+ # Synopsis:
+ #
+ # facilityName = pyre.inventory.facility("facility_name",
+ # family="fault", factory=ClassNameOfComponent)
+ #
+ # where ClassNameOfComponent is the class name of the default
+ # component to bind to the facility 'facility_name'.
+
+ import pyre.inventory
+
+ from pylith.faults.FaultCohesiveKin import FaultCohesiveKin
+
+ fault1 = pyre.inventory.facility("fault_1", family="fault",
+ factory=FaultCohesiveKin)
+ fault1.meta['tip'] = "First fault."
+
+ fault2 = pyre.inventory.facility("fault_2", family="fault",
+ factory=FaultCohesiveKin)
+ fault2.meta['tip'] = "Second fault."
+
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ # The 'name' argument on the next line defines the default name used
+ # to configure this component. Generally, we use the class name in
+ # lowercase.
+ def __init__(self, name="twofaults"):
+ """
+ Constructor.
+ """
+ ObjectBin.__init__(self, name)
+ return
+
+
+ # PRIVATE METHODS ////////////////////////////////////////////////////
+
+ def _configure(self):
+ """
+ Set attributes from inventory.
+ """
+ ObjectBin._configure(self)
+
+ # Define how the components are ordered in the container.
+ #
+ # Synopsis:
+ #
+ # self.bin = [self.inventory.facilityName1,
+ # self.inventory.facilityName2]
+ #
+ # Replace the names of the facilities as desired. The names MUST
+ # match the VARIABLES in the inventory, as opposed to the names
+ # used to bind the components to the facilities, which is the
+ # first arugment in the calls to pyre.inventory.facility()).
+ #
+ # DO NOT change the name 'self.bin'.
+ self.bin = [self.inventory.fault1,
+ self.inventory.fault2]
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def object_bin():
+ """
+ Factory associated with MyFaults.
+ """
+ # The class name for the container used above MUST match the name
+ # used on the next line.
+ return TwoFaults()
+
+
+# End of file
Added: short/3D/PyLith/trunk/examples/twofaults/2d/twofaults2d.mesh
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/twofaults2d.mesh 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/twofaults2d.mesh 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,628 @@
+// Global mesh object.
+// This defines a sqare mesh cut by two fault segments.
+mesh = {
+
+ // This is a two-dimensional mesh.
+ dimension = 2
+
+ // We are using one-indexing.
+ use-index-zero = false
+
+ // Describe the vertices (nodes) defining the mesh.
+ vertices = {
+
+ // The vertices are defined in a 2D coordinate system.
+ dimension = 2
+
+ // There are 169 vertices.
+ count = 169
+
+ // List the coordinates as:
+ // Vertex number (starting from zero), x-coord, y-coord
+ // Use coordinate units that are consistent with the other units used.
+ coordinates = {
+ 1 0.000000 0.000000
+ 2 1.500000 0.000000
+ 3 3.000000 0.000000
+ 4 4.500000 0.000000
+ 5 6.000000 0.000000
+ 6 7.500000 0.000000
+ 7 9.000000 0.000000
+ 8 10.500000 0.000000
+ 9 12.000000 0.000000
+ 10 0.000000 1.500000
+ 11 1.500000 1.500000
+ 12 3.000000 1.500000
+ 13 4.500000 1.500000
+ 14 6.000000 1.500000
+ 15 7.500000 1.500000
+ 16 9.000000 1.500000
+ 17 10.500000 1.500000
+ 18 12.000000 1.500000
+ 19 0.000000 3.000000
+ 20 1.500000 3.000000
+ 21 3.000000 3.000000
+ 22 4.500000 3.000000
+ 23 6.000000 3.000000
+ 24 7.500000 3.000000
+ 25 9.000000 3.000000
+ 26 10.500000 3.000000
+ 27 12.000000 3.000000
+ 28 0.000000 4.500000
+ 29 1.500000 4.500000
+ 30 3.000000 4.500000
+ 31 4.500000 4.500000
+ 32 6.000000 4.500000
+ 33 7.500000 4.500000
+ 34 9.000000 4.500000
+ 35 10.500000 4.500000
+ 36 12.000000 4.500000
+ 37 0.000000 6.000000
+ 38 1.500000 6.000000
+ 39 3.000000 6.000000
+ 40 4.500000 6.000000
+ 41 6.000000 6.000000
+ 42 7.500000 6.000000
+ 43 9.000000 6.000000
+ 44 10.500000 6.000000
+ 45 12.000000 6.000000
+ 46 0.000000 7.500000
+ 47 1.500000 7.500000
+ 48 3.000000 7.500000
+ 49 4.500000 7.500000
+ 50 6.000000 7.500000
+ 51 7.500000 7.500000
+ 52 9.000000 7.500000
+ 53 10.500000 7.500000
+ 54 12.000000 7.500000
+ 55 0.000000 9.000000
+ 56 1.500000 9.000000
+ 57 3.000000 9.000000
+ 58 4.500000 9.000000
+ 59 6.000000 9.000000
+ 60 7.500000 9.000000
+ 61 9.000000 9.000000
+ 62 10.500000 9.000000
+ 63 12.000000 9.000000
+ 64 0.000000 10.500000
+ 65 1.500000 10.500000
+ 66 3.000000 10.500000
+ 67 4.500000 10.500000
+ 68 6.000000 10.500000
+ 69 7.500000 10.500000
+ 70 9.000000 10.500000
+ 71 10.500000 10.500000
+ 72 12.000000 10.500000
+ 73 0.000000 12.000000
+ 74 1.500000 12.000000
+ 75 3.000000 12.000000
+ 76 4.500000 12.000000
+ 77 6.000000 12.000000
+ 78 7.500000 12.000000
+ 79 9.000000 12.000000
+ 80 10.500000 12.000000
+ 81 12.000000 12.000000
+ 82 0.000000 13.000000
+ 83 1.375000 13.000000
+ 84 2.750000 13.000000
+ 85 4.125000 13.000000
+ 86 5.500000 13.000000
+ 87 6.875000 13.000000
+ 88 8.250000 13.000000
+ 89 9.625000 13.000000
+ 90 11.000000 13.000000
+ 91 0.000000 14.000000
+ 92 1.250000 14.000000
+ 93 2.500000 14.000000
+ 94 3.750000 14.000000
+ 95 5.000000 14.000000
+ 96 6.250000 14.000000
+ 97 7.500000 14.000000
+ 98 8.750000 14.000000
+ 99 10.000000 14.000000
+ 100 0.000000 15.000000
+ 101 1.125000 15.000000
+ 102 2.250000 15.000000
+ 103 3.375000 15.000000
+ 104 4.500000 15.000000
+ 105 5.625000 15.000000
+ 106 6.750000 15.000000
+ 107 7.875000 15.000000
+ 108 9.000000 15.000000
+ 109 0.000000 16.000000
+ 110 1.000000 16.000000
+ 111 2.000000 16.000000
+ 112 3.000000 16.000000
+ 113 4.000000 16.000000
+ 114 5.000000 16.000000
+ 115 6.000000 16.000000
+ 116 7.000000 16.000000
+ 117 8.000000 16.000000
+ 118 13.000000 0.000000
+ 119 14.000000 0.000000
+ 120 15.000000 0.000000
+ 121 16.000000 0.000000
+ 122 13.000000 1.500000
+ 123 14.000000 1.500000
+ 124 15.000000 1.500000
+ 125 16.000000 1.500000
+ 126 13.000000 3.000000
+ 127 14.000000 3.000000
+ 128 15.000000 3.000000
+ 129 16.000000 3.000000
+ 130 13.000000 4.500000
+ 131 14.000000 4.500000
+ 132 15.000000 4.500000
+ 133 16.000000 4.500000
+ 134 13.000000 6.000000
+ 135 14.000000 6.000000
+ 136 15.000000 6.000000
+ 137 16.000000 6.000000
+ 138 13.000000 7.500000
+ 139 14.000000 7.500000
+ 140 15.000000 7.500000
+ 141 16.000000 7.500000
+ 142 13.000000 9.000000
+ 143 14.000000 9.000000
+ 144 15.000000 9.000000
+ 145 16.000000 9.000000
+ 146 13.000000 10.500000
+ 147 14.000000 10.500000
+ 148 15.000000 10.500000
+ 149 16.000000 10.500000
+ 150 13.000000 12.000000
+ 151 14.000000 12.000000
+ 152 15.000000 12.000000
+ 153 16.000000 12.000000
+ 154 16.000000 13.000000
+ 155 16.000000 14.000000
+ 156 16.000000 15.000000
+ 157 16.000000 16.000000
+ 158 14.750000 13.000000
+ 159 14.500000 14.000000
+ 160 14.250000 15.000000
+ 161 14.000000 16.000000
+ 162 13.500000 13.000000
+ 163 13.000000 14.000000
+ 164 12.500000 15.000000
+ 165 12.000000 16.000000
+ 166 12.250000 13.000000
+ 167 11.500000 14.000000
+ 168 10.750000 15.000000
+ 169 10.000000 16.000000
+ }
+ }
+
+ // Describe the cells (elements) composing the mesh.
+ cells = {
+
+ // There are 144 cells.
+ count = 144
+
+ // These are bilinear quadrilateral cells, so there are 4 corners per cell.
+ num-corners = 4
+
+ // List the vertices composing each cell,
+ // moving counter-clockwise around the cell.
+ // List the information as:
+ // Cell number (starting from zero), vertex 0, vertex 1, vertex 2, vertex 3
+ simplices = {
+ 1 1 2 11 10
+ 2 2 3 12 11
+ 3 3 4 13 12
+ 4 4 5 14 13
+ 5 5 6 15 14
+ 6 6 7 16 15
+ 7 7 8 17 16
+ 8 8 9 18 17
+ 9 10 11 20 19
+ 10 11 12 21 20
+ 11 12 13 22 21
+ 12 13 14 23 22
+ 13 14 15 24 23
+ 14 15 16 25 24
+ 15 16 17 26 25
+ 16 17 18 27 26
+ 17 19 20 29 28
+ 18 20 21 30 29
+ 19 21 22 31 30
+ 20 22 23 32 31
+ 21 23 24 33 32
+ 22 24 25 34 33
+ 23 25 26 35 34
+ 24 26 27 36 35
+ 25 28 29 38 37
+ 26 29 30 39 38
+ 27 30 31 40 39
+ 28 31 32 41 40
+ 29 32 33 42 41
+ 30 33 34 43 42
+ 31 34 35 44 43
+ 32 35 36 45 44
+ 33 37 38 47 46
+ 34 38 39 48 47
+ 35 39 40 49 48
+ 36 40 41 50 49
+ 37 41 42 51 50
+ 38 42 43 52 51
+ 39 43 44 53 52
+ 40 44 45 54 53
+ 41 46 47 56 55
+ 42 47 48 57 56
+ 43 48 49 58 57
+ 44 49 50 59 58
+ 45 50 51 60 59
+ 46 51 52 61 60
+ 47 52 53 62 61
+ 48 53 54 63 62
+ 49 55 56 65 64
+ 50 56 57 66 65
+ 51 57 58 67 66
+ 52 58 59 68 67
+ 53 59 60 69 68
+ 54 60 61 70 69
+ 55 61 62 71 70
+ 56 62 63 72 71
+ 57 64 65 74 73
+ 58 65 66 75 74
+ 59 66 67 76 75
+ 60 67 68 77 76
+ 61 68 69 78 77
+ 62 69 70 79 78
+ 63 70 71 80 79
+ 64 71 72 81 80
+ 65 73 74 83 82
+ 66 74 75 84 83
+ 67 75 76 85 84
+ 68 76 77 86 85
+ 69 77 78 87 86
+ 70 78 79 88 87
+ 71 79 80 89 88
+ 72 80 81 90 89
+ 73 82 83 92 91
+ 74 83 84 93 92
+ 75 84 85 94 93
+ 76 85 86 95 94
+ 77 86 87 96 95
+ 78 87 88 97 96
+ 79 88 89 98 97
+ 80 89 90 99 98
+ 81 91 92 101 100
+ 82 92 93 102 101
+ 83 93 94 103 102
+ 84 94 95 104 103
+ 85 95 96 105 104
+ 86 96 97 106 105
+ 87 97 98 107 106
+ 88 98 99 108 107
+ 89 100 101 110 109
+ 90 101 102 111 110
+ 91 102 103 112 111
+ 92 103 104 113 112
+ 93 104 105 114 113
+ 94 105 106 115 114
+ 95 106 107 116 115
+ 96 107 108 117 116
+ 97 9 118 122 18
+ 98 118 119 123 122
+ 99 119 120 124 123
+ 100 120 121 125 124
+ 101 18 122 126 27
+ 102 122 123 127 126
+ 103 123 124 128 127
+ 104 124 125 129 128
+ 105 27 126 130 36
+ 106 126 127 131 130
+ 107 127 128 132 131
+ 108 128 129 133 132
+ 109 36 130 134 45
+ 110 130 131 135 134
+ 111 131 132 136 135
+ 112 132 133 137 136
+ 113 45 134 138 54
+ 114 134 135 139 138
+ 115 135 136 140 139
+ 116 136 137 141 140
+ 117 54 138 142 63
+ 118 138 139 143 142
+ 119 139 140 144 143
+ 120 140 141 145 144
+ 121 63 142 146 72
+ 122 142 143 147 146
+ 123 143 144 148 147
+ 124 144 145 149 148
+ 125 72 146 150 81
+ 126 146 147 151 150
+ 127 147 148 152 151
+ 128 148 149 153 152
+ 129 153 154 158 152
+ 130 154 155 159 158
+ 131 155 156 160 159
+ 132 156 157 161 160
+ 133 152 158 162 151
+ 134 158 159 163 162
+ 135 159 160 164 163
+ 136 160 161 165 164
+ 137 151 162 166 150
+ 138 162 163 167 166
+ 139 163 164 168 167
+ 140 164 165 169 168
+ 141 150 166 90 81
+ 142 166 167 99 90
+ 143 167 168 108 99
+ 144 168 169 117 108
+ }
+
+ // List the material ID's associated with each cell.
+ // Different ID's may be used to specify a different material type, or
+ // to use a different spatial database for each material ID.
+ material-ids = {
+ 1 1
+ 2 1
+ 3 1
+ 4 1
+ 5 1
+ 6 1
+ 7 1
+ 8 1
+ 9 1
+ 10 1
+ 11 1
+ 12 1
+ 13 1
+ 14 1
+ 15 1
+ 16 1
+ 17 1
+ 18 1
+ 19 1
+ 20 1
+ 21 1
+ 22 1
+ 23 1
+ 24 1
+ 25 1
+ 26 1
+ 27 1
+ 28 1
+ 29 1
+ 30 1
+ 31 1
+ 32 1
+ 33 1
+ 34 1
+ 35 1
+ 36 1
+ 37 1
+ 38 1
+ 39 1
+ 40 1
+ 41 1
+ 42 1
+ 43 1
+ 44 1
+ 45 1
+ 46 1
+ 47 1
+ 48 1
+ 49 1
+ 50 1
+ 51 1
+ 52 1
+ 53 1
+ 54 1
+ 55 1
+ 56 1
+ 57 1
+ 58 1
+ 59 1
+ 60 1
+ 61 1
+ 62 1
+ 63 1
+ 64 1
+ 65 1
+ 66 1
+ 67 1
+ 68 1
+ 69 1
+ 70 1
+ 71 1
+ 72 1
+ 73 1
+ 74 1
+ 75 1
+ 76 1
+ 77 1
+ 78 1
+ 79 1
+ 80 1
+ 81 1
+ 82 1
+ 83 1
+ 84 1
+ 85 1
+ 86 1
+ 87 1
+ 88 1
+ 89 1
+ 90 1
+ 91 1
+ 92 1
+ 93 1
+ 94 1
+ 95 1
+ 96 1
+ 97 2
+ 98 2
+ 99 2
+ 100 2
+ 101 2
+ 102 2
+ 103 2
+ 104 2
+ 105 2
+ 106 2
+ 107 2
+ 108 2
+ 109 2
+ 110 2
+ 111 2
+ 112 2
+ 113 2
+ 114 2
+ 115 2
+ 116 2
+ 117 2
+ 118 2
+ 119 2
+ 120 2
+ 121 2
+ 122 2
+ 123 2
+ 124 2
+ 125 2
+ 126 2
+ 127 2
+ 128 2
+ 129 2
+ 130 2
+ 131 2
+ 132 2
+ 133 2
+ 134 2
+ 135 2
+ 136 2
+ 137 2
+ 138 2
+ 139 2
+ 140 2
+ 141 2
+ 142 2
+ 143 2
+ 144 2
+ }
+ }
+
+ // Here we list different groups (cells or vertices) that we want to associate
+ // with a particular name (ID).
+
+ // This group of vertices may be used to define a fault.
+ group = {
+ name = fault_1
+ type = vertices
+ count = 5
+ indices = {
+ 117
+ 108
+ 99
+ 90
+ 81
+ }
+ }
+
+ // This group of vertices may be used to define a fault.
+ group = {
+ name = fault_2
+ type = vertices
+ count = 8
+ indices = {
+ 72
+ 63
+ 54
+ 45
+ 36
+ 27
+ 18
+ 9
+ }
+ }
+
+ // This group of vertices may be used to specify boundary conditions.
+ group = {
+ name = y_neg
+ type = vertices
+ count = 13
+ indices = {
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
+ 8
+ 9
+ 118
+ 119
+ 120
+ 121
+ }
+ }
+
+ // This group of vertices may be used to specify boundary conditions.
+ group = {
+ name = x_neg
+ type = vertices
+ count = 13
+ indices = {
+ 1
+ 10
+ 19
+ 28
+ 37
+ 46
+ 55
+ 64
+ 73
+ 82
+ 91
+ 100
+ 109
+ }
+ }
+
+ // This group of vertices may be used to specify boundary conditions.
+ group = {
+ name = x_pos
+ type = vertices
+ count = 13
+ indices = {
+ 121
+ 125
+ 129
+ 133
+ 137
+ 141
+ 145
+ 149
+ 153
+ 154
+ 155
+ 156
+ 157
+ }
+ }
+
+ // This group of vertices may be used to specify boundary conditions.
+ group = {
+ name = y_pos
+ type = vertices
+ count = 13
+ indices = {
+ 109
+ 110
+ 111
+ 112
+ 113
+ 114
+ 115
+ 116
+ 117
+ 169
+ 165
+ 161
+ 157
+ }
+ }
+}
Added: short/3D/PyLith/trunk/examples/twofaults/2d/twomaterials.odb
===================================================================
--- short/3D/PyLith/trunk/examples/twofaults/2d/twomaterials.odb 2007-09-12 23:46:09 UTC (rev 7961)
+++ short/3D/PyLith/trunk/examples/twofaults/2d/twomaterials.odb 2007-09-13 16:01:06 UTC (rev 7962)
@@ -0,0 +1,131 @@
+#!/usr/bin/env python
+#
+# ----------------------------------------------------------------------
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# <LicenseText>
+#
+# ----------------------------------------------------------------------
+#
+
+## Template for user-defined physical property container.
+##
+## Copy this file to your working directory and rename it as
+## appropriate. Note: the extension MUST rename ".odb" for PyLith to
+## find it.
+##
+## To use this container, in your .cfg file, bind this component to
+## the materials facility of the problem:
+##
+## [pylithapp.timedependent]
+## materials = MyMatBin
+##
+## You can then set the properties of the facilities in this container
+## just as you would any other Pyre component.
+##
+## For example:
+##
+## [pylithapp.timedepedent.materials.materialA]
+## label = elastic material
+## id = 1
+
+# Parent class
+from pylith.utils.ObjectBin import ObjectBin
+
+# Define new material container class
+#
+# You can change the name of this class, but the name here MUST match
+# the one in the object_bin() function at the bottom of this file.
+class MyMatBin(ObjectBin):
+ """
+ User-defined materials container.
+
+ Factory: object_bin
+ """
+
+ # INVENTORY //////////////////////////////////////////////////////////
+
+ class Inventory(ObjectBin.Inventory):
+ """
+ Python object for managing MyBC facilities and properties.
+ """
+
+ # Define the facilities in this material container.
+ #
+ # You must import any Python objects that are bound to the
+ # facilities.
+ #
+ # Synopsis:
+ #
+ # facilityName = pyre.inventory.facility("facility_name",
+ # family="material", factory=ClassNameOfComponent)
+ #
+ # where ClassNameOfComponent is the class name of the default
+ # component to bind to the facility 'facility_name'.
+
+ import pyre.inventory
+
+ from pylith.materials.ElasticIsotropic3D import ElasticIsotropic3D
+
+ material1 = pyre.inventory.facility("material_1", family="material",
+ factory=ElasticIsotropic3D)
+ material1.meta['tip'] = "Elastic material 1."
+
+ material2 = pyre.inventory.facility("material_2", family="material",
+ factory=ElasticIsotropic3D)
+ material2.meta['tip'] = "Elastic material 2."
+
+
+ # PUBLIC METHODS /////////////////////////////////////////////////////
+
+ # The 'name' argument on the next line defines the default name used
+ # to configure this component. Generally, we use the class name in
+ # lowercase.
+ def __init__(self, name="mymatbin"):
+ """
+ Constructor.
+ """
+ ObjectBin.__init__(self, name)
+ return
+
+
+ # PRIVATE METHODS ////////////////////////////////////////////////////
+
+ def _configure(self):
+ """
+ Set attributes from inventory.
+ """
+ ObjectBin._configure(self)
+
+ # Define how the components are ordered in the container.
+ #
+ # Synopsis:
+ #
+ # self.bin = [self.inventory.facilityName1,
+ # self.inventory.facilityName2]
+ #
+ # Replace the names of the facilities as desired. The names MUST
+ # match the VARIABLES in the inventory, as opposed to the names
+ # used to bind the components to the facilities, which is the
+ # first arugment in the calls to pyre.inventory.facility()).
+ #
+ # DO NOT change the name 'self.bin'.
+ self.bin = [self.inventory.material1,
+ self.inventory.material2]
+ return
+
+
+# FACTORIES ////////////////////////////////////////////////////////////
+
+def object_bin():
+ """
+ Factory associated with MyMatBin.
+ """
+ # The class name for the container used above MUST match the name
+ # used on the next line.
+ return MyMatBin()
+
+
+# End of file
More information about the cig-commits
mailing list