[CIG-SHORT] PyLith cfg/odb files
Brad Aagaard
baagaard at usgs.gov
Fri Feb 8 14:48:13 PST 2008
Tabrez Ali wrote:
> PyLith users/developers
>
> I need to come to speed with the way BC's and material props are
> defined in PyLith 1.0 and I dont know python so a few quick questions
> (in the context of benchmark problems):
The cfg and odb files are a result of using Pyre
(http://www.cacr.caltech.edu/projects/pyre/) which is written in Python.
As a result, knowing Python is useful for understanding the syntax of
the odb files, but not necessarily the contents. The files are very
simple and some templates are include in /examples/templates/containers.
> 1. If I use X number of faults (X>1) then do I need to create a
> separate odb file where I define all the X faults
Yes. The odb files essentially define a container with names for each of
the faults, boundary conditions, or materials, so that you can refer to
them in the cfg files. If you need a container with a different size
than one of the ones provided (see the manual), then you must create an
odb file.
> 2. Is the sole purpose of these odb files simply to create labels
The odb files permit definition of containers of objects at run time.
This provides flexibility in that the number of materials, faults, or
boundary conditions is not predetermined. As mentioned above, it also
provides a name for each of the objects in a container so that we can
refer to them in cfg files where we can change the parameters from their
default values.
>
> 3. Is it necessary to repeat the quadrature parameters for each block
Yes! Every object is "configured" separately. Pyre does not currently
support setting a parameter across a group of objects.
> 4. Whats the deal with factory/container terminology. Are they
> related to oops. If so then can you please explain in the context of
> Fortran (if possible)
See #2 for an explanation of the containers.
A Pyre "facility" gives a name to an object that has some functionality.
It might be a reader for some type of file, a material, a fault, etc.
elastic = pyre.inventory.facility("elastic", family="material",
factory=ElasticIsotropic3D)
The line above creates a facility called "elastic" and assigns it to a
variable elastic (elastic =). This facility has the functionality of a
"material" (family=material) and the default value for this facility is
an ElasticIsotropic3D object.
The easiest way to understand how this works is to look at the examples
and use the --help, --help-properties, and --help-components command
line arguments.
For example, if you run pylith in examples/twocells/
pylith dislocation.cfg --help
you get a list of the top-level facilities and properties. To list the
values for the top-level components, use pylith --help-components and
for the top-level properties, use pylith --help-properties.
To list lower-level properties and components simply prepend the name of
the facilities. For example,
pylith dislocation.cfg --problem.interfaces.fault.help-properties
lists the default and current values of the properties for the fault
object which is a facility in interfaces which is a facility in problem.
Think of this as walking down the branches of a tree structure.
Brad
More information about the CIG-SHORT
mailing list