[cig-commits] r15189 - in short/3D/PyLith/trunk: . pylith/bc pylith/faults pylith/feassemble pylith/materials pylith/meshio pylith/problems pylith/topology pylith/utils unittests/libtests/topology unittests/pytests/meshio
brad at geodynamics.org
brad at geodynamics.org
Wed Jun 10 16:54:21 PDT 2009
Author: brad
Date: 2009-06-10 16:54:19 -0700 (Wed, 10 Jun 2009)
New Revision: 15189
Added:
short/3D/PyLith/trunk/unittests/pytests/meshio/TestSingleOutput.py
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py
short/3D/PyLith/trunk/pylith/bc/TimeDependent.py
short/3D/PyLith/trunk/pylith/faults/SlipTimeFn.py
short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
short/3D/PyLith/trunk/pylith/feassemble/ReferenceCell.py
short/3D/PyLith/trunk/pylith/materials/Homogeneous.py
short/3D/PyLith/trunk/pylith/materials/Material.py
short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py
short/3D/PyLith/trunk/pylith/meshio/SingleOutput.py
short/3D/PyLith/trunk/pylith/problems/TimeStep.py
short/3D/PyLith/trunk/pylith/topology/JacobianViewer.py
short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
short/3D/PyLith/trunk/pylith/topology/MeshRefiner.py
short/3D/PyLith/trunk/pylith/utils/CheckpointTimer.py
short/3D/PyLith/trunk/pylith/utils/EmptyBin.py
short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc
short/3D/PyLith/trunk/unittests/pytests/meshio/testmeshio.py
Log:
Switched Components to PetscComponents.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/TODO 2009-06-10 23:54:19 UTC (rev 15189)
@@ -50,8 +50,6 @@
Add _cleanup() to components to deallocate local data structures.
Add cleanup() to non-components to deallocate local data structures.
- recursive output of parameters in playpen
-
Add check before calling newSection() when want to enforce at
least 1 value.
Modified: short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py
===================================================================
--- short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/bc/BoundaryCondition.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -22,7 +22,7 @@
##
## Factory: boundary_condition
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
from bc import BoundaryCondition as ModuleBoundaryCondition
# Validator for direction
@@ -43,7 +43,7 @@
# BoundaryCondition class
-class BoundaryCondition(Component, ModuleBoundaryCondition):
+class BoundaryCondition(PetscComponent, ModuleBoundaryCondition):
"""
Python abstract base class for managing a boundary condition.
@@ -55,7 +55,7 @@
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing BoundaryCondition facilities and properties.
"""
@@ -86,7 +86,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="boundary_condition")
+ PetscComponent.__init__(self, name, facility="boundary_condition")
self._createModuleObj()
return
@@ -113,7 +113,7 @@
"""
Setup members using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
ModuleBoundaryCondition.label(self, self.inventory.label)
self.upDir = map(float, self.inventory.upDir)
return
Modified: short/3D/PyLith/trunk/pylith/bc/TimeDependent.py
===================================================================
--- short/3D/PyLith/trunk/pylith/bc/TimeDependent.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/bc/TimeDependent.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -26,7 +26,7 @@
## tu(x) is the start time for the change in value given by a spatial datasse,
## a(t) is a time history given by a temporal database.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
from bc import TimeDependent as ModuleTimeDependent
from pylith.utils.NullComponent import NullComponent
@@ -50,7 +50,7 @@
# TimeDependent class
-class TimeDependent(Component, ModuleTimeDependent):
+class TimeDependent(PetscComponent, ModuleTimeDependent):
"""
Python abstract base class for managing a boundary condition with
time dependent paramters.
@@ -104,7 +104,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="time_dependent")
+ PetscComponent.__init__(self, name, facility="time_dependent")
return
@@ -114,7 +114,7 @@
"""
Setup members using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
import numpy
bcDOF = numpy.array(self.inventory.bcDOF, dtype=numpy.int32)
Modified: short/3D/PyLith/trunk/pylith/faults/SlipTimeFn.py
===================================================================
--- short/3D/PyLith/trunk/pylith/faults/SlipTimeFn.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/faults/SlipTimeFn.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -17,10 +17,10 @@
##
## Factory: slip_time_fn
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# SlipTimeFn class
-class SlipTimeFn(Component):
+class SlipTimeFn(PetscComponent):
"""
Python abstract base class for kinematic slip time function.
@@ -33,7 +33,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="sliptimefn")
+ PetscComponent.__init__(self, name, facility="sliptimefn")
return
@@ -73,7 +73,7 @@
"""
Setup members using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
return
Modified: short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/feassemble/Quadrature.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -17,11 +17,11 @@
##
## Factory: quadrature.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# ----------------------------------------------------------------------
# QuadratureBase class
-class QuadratureBase(Component):
+class QuadratureBase(PetscComponent):
"""
Python abstract base class for integrating over finite-elements
using quadrature.
@@ -31,7 +31,7 @@
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""Python object for managing Quadrature facilities and properties."""
## @class Inventory
@@ -67,7 +67,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="quadrature")
+ PetscComponent.__init__(self, name, facility="quadrature")
return
@@ -98,7 +98,7 @@
"""
Set members based using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
self.minJacobian(self.inventory.minJacobian)
self.checkConditioning(self.inventory.checkConditioning)
self.cell = self.inventory.cell
Modified: short/3D/PyLith/trunk/pylith/feassemble/ReferenceCell.py
===================================================================
--- short/3D/PyLith/trunk/pylith/feassemble/ReferenceCell.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/feassemble/ReferenceCell.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -17,10 +17,10 @@
##
## Factory: reference_cell.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# ReferenceCell class
-class ReferenceCell(Component):
+class ReferenceCell(PetscComponent):
"""
Python abstract base class for managing basis functions and
quadrature rules of a reference finite-element cell.
@@ -34,7 +34,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="reference_cell")
+ PetscComponent.__init__(self, name, facility="reference_cell")
self.geometry = None # Geometry of reference cell
Modified: short/3D/PyLith/trunk/pylith/materials/Homogeneous.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/Homogeneous.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/materials/Homogeneous.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -14,17 +14,17 @@
##
## @brief Python materials container with one material.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# Homogeneous class
-class Homogeneous(Component):
+class Homogeneous(PetscComponent):
"""
Python materials container with one material.
"""
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing Homogeneous facilities and properties.
"""
@@ -52,7 +52,7 @@
"""
Constructor.
"""
- Component.__init__(self, name)
+ PetscComponent.__init__(self, name, facility="material")
return
Modified: short/3D/PyLith/trunk/pylith/materials/Material.py
===================================================================
--- short/3D/PyLith/trunk/pylith/materials/Material.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/materials/Material.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -24,10 +24,10 @@
##
## Factory: material
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# Material class
-class Material(Component):
+class Material(PetscComponent):
"""
Python material property manager.
@@ -40,7 +40,7 @@
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing Material facilities and properties.
"""
@@ -88,7 +88,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="material")
+ PetscComponent.__init__(self, name, facility="material")
self._createModuleObj()
self.output = None
return
@@ -142,7 +142,7 @@
"""
Setup members using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
self.id(self.inventory.id)
self.label(self.inventory.label)
self.dbProperties(self.inventory.dbProperties)
Modified: short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/meshio/MeshIOObj.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -16,11 +16,11 @@
##
## Factory: mesh_io
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
from meshio import MeshIO as ModuleMeshIO
# MeshIOObj class
-class MeshIOObj(Component, ModuleMeshIO):
+class MeshIOObj(PetscComponent, ModuleMeshIO):
"""
Python abstract base class for finite-element mesh I/O.
"""
@@ -31,7 +31,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="mesh_io")
+ PetscComponent.__init__(self, name, facility="mesh_io")
self.coordsys = None
self._createModuleObj()
return
@@ -81,7 +81,7 @@
"""
Set members based using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
return
Modified: short/3D/PyLith/trunk/pylith/meshio/SingleOutput.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/SingleOutput.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/meshio/SingleOutput.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -14,10 +14,10 @@
##
## @brief Python container with one output manager.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# SingleOutput class
-class SingleOutput(Component):
+class SingleOutput(PetscComponent):
"""
Python container with one output manager.
@@ -26,7 +26,7 @@
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing SingleOutput facilities and properties.
"""
@@ -54,7 +54,7 @@
"""
Constructor.
"""
- Component.__init__(self, name)
+ PetscComponent.__init__(self, name, facility="output")
return
Modified: short/3D/PyLith/trunk/pylith/problems/TimeStep.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/TimeStep.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/problems/TimeStep.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -16,12 +16,11 @@
##
## Factory: time_step
-from pyre.components.Component import Component
-
+from pylith.utils.PetscComponent import PetscComponent
from pylith.utils.profiling import resourceUsageString
# TimeStep class
-class TimeStep(Component):
+class TimeStep(PetscComponent):
"""
Python abstract base class for managing the time step size.
@@ -34,7 +33,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="time_step")
+ PetscComponent.__init__(self, name, facility="time_step")
from pyre.units.time import second
self.totalTime = 0.0*second
self.dt = 0.0*second
@@ -111,7 +110,7 @@
"""
Set members based using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
return
Modified: short/3D/PyLith/trunk/pylith/topology/JacobianViewer.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/JacobianViewer.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/topology/JacobianViewer.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -17,10 +17,10 @@
##
## Factory: jacobian_viewer
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# JacobianViewer class
-class JacobianViewer(Component):
+class JacobianViewer(PetscComponent):
"""
Python abstract base class for formulations of solving equations.
@@ -32,7 +32,7 @@
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing JacobianViewer facilities and properties.
"""
@@ -70,7 +70,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="jacobian_viewer")
+ PetscComponent.__init__(self, name, facility="jacobian_viewer")
return
@@ -88,7 +88,7 @@
"""
Set members based using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
self.filename = self.inventory.filename
self.timeFormat = self.inventory.timeFormat
self.timeConstant = self.inventory.timeConstant
Modified: short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/topology/MeshGenerator.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -16,10 +16,10 @@
##
## Factory: mesh_generator.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# MeshGenerator class
-class MeshGenerator(Component):
+class MeshGenerator(PetscComponent):
"""
Python abstract base class for mesh generator.
@@ -28,7 +28,7 @@
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing MeshGenerator facilities and properties.
"""
@@ -58,7 +58,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="mesh_generator")
+ PetscComponent.__init__(self, name, facility="mesh_generator")
self.debug = False
self.interpolate = False
return
@@ -78,7 +78,7 @@
"""
Set members based using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
self.debug = self.inventory.debug
self.interpolate = self.inventory.interpolate
return
Modified: short/3D/PyLith/trunk/pylith/topology/MeshRefiner.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/MeshRefiner.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/topology/MeshRefiner.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -16,17 +16,17 @@
##
## Factory: mesh_refiner.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# MeshRefiner class
-class MeshRefiner(Component):
+class MeshRefiner(PetscComponent):
"""
Python manager for refining mesh in parallel.
Factory: mesh_refiner
"""
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing RefineUniform facilities and properties.
"""
@@ -56,7 +56,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="refiner")
+ PetscComponent.__init__(self, name, facility="refiner")
self.cppHandle = None
return
@@ -74,7 +74,7 @@
"""
Set members based using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
self.debug = self.inventory.debug
self.dataWriter = self.inventory.dataWriter
return
Modified: short/3D/PyLith/trunk/pylith/utils/CheckpointTimer.py
===================================================================
--- short/3D/PyLith/trunk/pylith/utils/CheckpointTimer.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/utils/CheckpointTimer.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -23,10 +23,10 @@
##
## Factory: checkpointer.
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# CheckpointTimer class
-class CheckpointTimer(Component):
+class CheckpointTimer(PetscComponent):
"""
Python CheckpointTimer object for managing checkpointing.
@@ -42,7 +42,7 @@
# INVENTORY //////////////////////////////////////////////////////////
- class Inventory(Component.Inventory):
+ class Inventory(PetscComponent.Inventory):
"""
Python object for managing CheckpointTimer facilities and properties.
"""
@@ -70,7 +70,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="checkpointer")
+ PetscComponent.__init__(self, name, facility="checkpointer")
from pyre.units.time import second
self.t = -8.9e+99*second
@@ -109,7 +109,7 @@
"""
Setup members using inventory.
"""
- Component._configure(self)
+ PetscComponent._configure(self)
self.dt = self.inventory.dt
return
Modified: short/3D/PyLith/trunk/pylith/utils/EmptyBin.py
===================================================================
--- short/3D/PyLith/trunk/pylith/utils/EmptyBin.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/pylith/utils/EmptyBin.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -16,10 +16,10 @@
##
## Factory: object_bin
-from pyre.components.Component import Component
+from pylith.utils.PetscComponent import PetscComponent
# EmptyBin class
-class EmptyBin(Component):
+class EmptyBin(PetscComponent):
"""
Python container for a collection of objects.
"""
@@ -30,7 +30,7 @@
"""
Constructor.
"""
- Component.__init__(self, name, facility="empty_bin")
+ PetscComponent.__init__(self, name, facility="empty_bin")
return
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc 2009-06-10 23:54:19 UTC (rev 15189)
@@ -1073,8 +1073,6 @@
CPPUNIT_ASSERT_EQUAL(numFibrations, section->getNumSpaces());
const ALE::Obj<Mesh::RealSection>& sectionSplit = section->getFibration(0);
CPPUNIT_ASSERT(!sectionSplit.isNull());
- section->view("FULL FIELD"); // TEMPORARY
- sectionSplit->view("FIBRATION 0"); // TEMPORARY
int iV = 0;
for (Mesh::SieveMesh::label_sequence::iterator v_iter=vertices->begin();
Added: short/3D/PyLith/trunk/unittests/pytests/meshio/TestSingleOutput.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/meshio/TestSingleOutput.py (rev 0)
+++ short/3D/PyLith/trunk/unittests/pytests/meshio/TestSingleOutput.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# ======================================================================
+#
+# Brad T. Aagaard
+# U.S. Geological Survey
+#
+# {LicenseText}
+#
+# ======================================================================
+#
+
+## @file unittests/pytests/meshio/TestSingleOutput.py
+
+## @brief Unit testing of Homogenous object.
+
+import unittest
+
+# ----------------------------------------------------------------------
+class TestSingleOutput(unittest.TestCase):
+ """
+ Unit testing of SingleOutput object.
+ """
+
+ def test_constructor(self):
+ """
+ Test constructor.
+ """
+ from pylith.meshio.SingleOutput import SingleOutput
+ outputs = SingleOutput()
+ return
+
+
+ def test_configure(self):
+ """
+ Test _configure().
+ """
+ from pylith.meshio.SingleOutput import SingleOutput
+ outputs = SingleOutput()
+ from pylith.meshio.OutputSoln import OutputSoln
+ outputs.inventory.output = OutputSoln()
+ outputs._configure()
+ self.assertEqual(1, len(outputs.components()))
+ return
+
+
+# End of file
Modified: short/3D/PyLith/trunk/unittests/pytests/meshio/testmeshio.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/meshio/testmeshio.py 2009-06-10 22:57:12 UTC (rev 15188)
+++ short/3D/PyLith/trunk/unittests/pytests/meshio/testmeshio.py 2009-06-10 23:54:19 UTC (rev 15189)
@@ -92,6 +92,9 @@
from TestOutputSolnSubset import TestOutputSolnSubset
suite.addTest(unittest.makeSuite(TestOutputSolnSubset))
+ from TestSingleOutput import TestSingleOutput
+ suite.addTest(unittest.makeSuite(TestSingleOutput))
+
#TestOutputNeumann
#TestOutputFaultKin
More information about the CIG-COMMITS
mailing list