[cig-commits] r9238 - short/3D/PyLith/trunk/unittests/pytests/bc
brad at geodynamics.org
brad at geodynamics.org
Tue Feb 5 13:14:13 PST 2008
Author: brad
Date: 2008-02-05 13:14:13 -0800 (Tue, 05 Feb 2008)
New Revision: 9238
Modified:
short/3D/PyLith/trunk/unittests/pytests/bc/TestDirichletPoints.py
Log:
Switched to using fields manager for managing sections.
Modified: short/3D/PyLith/trunk/unittests/pytests/bc/TestDirichletPoints.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/bc/TestDirichletPoints.py 2008-02-05 20:25:54 UTC (rev 9237)
+++ short/3D/PyLith/trunk/unittests/pytests/bc/TestDirichletPoints.py 2008-02-05 21:14:13 UTC (rev 9238)
@@ -51,7 +51,7 @@
don't verify the results.
"""
- (mesh, bc) = self._initialize()
+ (mesh, bc, fields) = self._initialize()
self.assertNotEqual(None, bc.cppHandle)
@@ -68,8 +68,8 @@
don't verify the results.
"""
- (mesh, bc) = self._initialize()
- field = mesh.createRealSection("field", mesh.dimension())
+ (mesh, bc, fields) = self._initialize()
+ field = fields.getReal("field")
bc.setConstraintSizes(field)
# We should really add something here to check to make sure things
@@ -85,8 +85,8 @@
don't verify the results.
"""
- (mesh, bc) = self._initialize()
- field = mesh.createRealSection("field", mesh.dimension())
+ (mesh, bc, fields) = self._initialize()
+ field = fields.getReal("field")
bc.setConstraintSizes(field)
mesh.allocateRealSection(field)
bc.setConstraints(field)
@@ -100,7 +100,7 @@
"""
Test useSolnIncr().
"""
- (mesh, bc) = self._initialize()
+ (mesh, bc, fields) = self._initialize()
bc.useSolnIncr(True)
return
@@ -113,14 +113,14 @@
don't verify the results.
"""
- (mesh, bc) = self._initialize()
- field = mesh.createRealSection("field", mesh.dimension())
+ (mesh, bc, fields) = self._initialize()
+ field = fields.getReal("field")
bc.setConstraintSizes(field)
mesh.allocateRealSection(field)
bc.setConstraints(field)
from pyre.units.time import second
t = 1.0*second
- #bc.setField(t, field)
+ bc.setField(t, field)
# We should really add something here to check to make sure things
# actually initialized correctly
@@ -134,7 +134,7 @@
WARNING: This is not a rigorous test of finalize() because we
neither set the input fields or verify the results.
"""
- (mesh, bc) = self._initialize()
+ (mesh, bc, fields) = self._initialize()
bc.finalize()
# We should really add something here to check to make sure things
@@ -183,7 +183,18 @@
bc.preinitialize(mesh)
from pyre.units.time import second
bc.initialize(totalTime=0.0*second, numTimeSteps=1)
- return (mesh, bc)
+ # Setup fields
+ from pylith.topology.FieldsManager import FieldsManager
+ fields = FieldsManager(mesh)
+ fields.addReal("field")
+ fields.setFiberDimension("field", cs.spaceDim)
+ fields.allocate("field")
+ import pylith.topology.topology as bindings
+ bindings.zeroRealSection(fields.getReal("field"))
+
+ return (mesh, bc, fields)
+
+
# End of file
More information about the cig-commits
mailing list