[cig-commits] r13461 - in short/3D/PyLith/trunk: modulesrc/topology pylith/topology unittests/pytests/topology
brad at geodynamics.org
brad at geodynamics.org
Thu Dec 4 12:55:37 PST 2008
Author: brad
Date: 2008-12-04 12:55:37 -0800 (Thu, 04 Dec 2008)
New Revision: 13461
Modified:
short/3D/PyLith/trunk/modulesrc/topology/topology.pyxe.src
short/3D/PyLith/trunk/pylith/topology/FieldsManager.py
short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py
short/3D/PyLith/trunk/unittests/pytests/topology/TestMesh.py
Log:
Updated for removal of obsolete methods.
Modified: short/3D/PyLith/trunk/modulesrc/topology/topology.pyxe.src
===================================================================
--- short/3D/PyLith/trunk/modulesrc/topology/topology.pyxe.src 2008-12-04 20:25:46 UTC (rev 13460)
+++ short/3D/PyLith/trunk/modulesrc/topology/topology.pyxe.src 2008-12-04 20:55:37 UTC (rev 13461)
@@ -1081,30 +1081,6 @@
return PyCObject_FromVoidPtr(ptr, NULL)
- def createCustomAtlas(self, label, id):
- """
- Create custom atlases for fields.
- """
- # create shim for createCustomAtlas
- #embed{ void FieldsManager_createCustomAtlas(void* objVptr, char* label, int id)
- try {
- assert(0 != objVptr);
- ((pylith::topology::FieldsManager*) objVptr)->createCustomAtlas(label, id);
- } catch (const std::exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.what()));
- } catch (const ALE::Exception& err) {
- PyErr_SetString(PyExc_RuntimeError,
- const_cast<char*>(err.msg().c_str()));
- } catch (...) {
- PyErr_SetString(PyExc_RuntimeError,
- "Caught unknown C++ exception.");
- } // try/catch
- #}embed
- FieldsManager_createCustomAtlas(self.thisptr, label, id)
- return
-
-
def _createHandle(self):
"""
Wrap pointer to C++ object in PyCObject.
Modified: short/3D/PyLith/trunk/pylith/topology/FieldsManager.py
===================================================================
--- short/3D/PyLith/trunk/pylith/topology/FieldsManager.py 2008-12-04 20:25:46 UTC (rev 13460)
+++ short/3D/PyLith/trunk/pylith/topology/FieldsManager.py 2008-12-04 20:55:37 UTC (rev 13461)
@@ -132,12 +132,4 @@
return self.cppHandle.getFieldByHistory(index)
- def createCustomAtlas(self, label, id):
- """
- Calculate custom atlas for fields in FieldsManager.
- """
- assert(None != self.cppHandle)
- return self.cppHandle.createCustomAtlas(label, id)
-
-
# End of file
Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py 2008-12-04 20:25:46 UTC (rev 13460)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestFieldsManager.py 2008-12-04 20:55:37 UTC (rev 13461)
@@ -294,38 +294,6 @@
return
- def test_createCustomAtlas(self):
- """
- Test createCustomAtlas().
-
- WARNING: This is not a rigorous test of createCustomAtlas() because we
- don't verify the results.
- """
- mesh = self._initialize()
- from pylith.topology.FieldsManager import FieldsManager
- manager = FieldsManager(mesh)
-
- fields = ["field A", "field B", "field C"]
- for field in fields:
- manager.addReal(field)
-
- manager.setFiberDimension("field A", 3, "vertices")
- manager.allocate("field A")
-
- manager.setFiberDimension("field B", 4, "vertices")
- manager.allocate("field B")
-
- manager.setFiberDimension("field C", 5, "vertices")
- manager.allocate("field C")
-
- manager.createCustomAtlas("material-id", 4)
- manager.createCustomAtlas("material-id", 3)
-
- # We should really add something here to check to make sure things
- # actually initialized correctly.
- return
-
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _initialize(self):
@@ -336,11 +304,15 @@
cs = CSCart()
cs.spaceDim = 2
+ from spatialdata.units.Nondimensional import Nondimensional
+ normalizer = Nondimensional()
+ normalizer.initialize()
+
from pylith.meshio.MeshIOAscii import MeshIOAscii
importer = MeshIOAscii()
importer.filename = "data/tri3.mesh"
importer.coordsys = cs
- mesh = importer.read(debug=False, interpolate=False)
+ mesh = importer.read(normalizer, debug=False, interpolate=False)
return mesh
Modified: short/3D/PyLith/trunk/unittests/pytests/topology/TestMesh.py
===================================================================
--- short/3D/PyLith/trunk/unittests/pytests/topology/TestMesh.py 2008-12-04 20:25:46 UTC (rev 13460)
+++ short/3D/PyLith/trunk/unittests/pytests/topology/TestMesh.py 2008-12-04 20:55:37 UTC (rev 13461)
@@ -147,11 +147,15 @@
cs = CSCart()
cs.spaceDim = 2
+ from spatialdata.units.Nondimensional import Nondimensional
+ normalizer = Nondimensional()
+ normalizer.initialize()
+
from pylith.meshio.MeshIOAscii import MeshIOAscii
importer = MeshIOAscii()
importer.filename = "data/tri3.mesh"
importer.coordsys = cs
- mesh = importer.read(debug=False, interpolate=False)
+ mesh = importer.read(normalizer, debug=False, interpolate=False)
return mesh
More information about the CIG-COMMITS
mailing list