[cig-commits] r20707 - in short/3D/PyLith/trunk: libsrc/pylith/materials libsrc/pylith/topology unittests/libtests/topology
knepley at geodynamics.org
knepley at geodynamics.org
Sat Sep 8 19:51:34 PDT 2012
Author: knepley
Date: 2012-09-08 19:51:34 -0700 (Sat, 08 Sep 2012)
New Revision: 20707
Modified:
short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc
short/3D/PyLith/trunk/libsrc/pylith/topology/Field.icc
short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc
short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc
Log:
Correction to Field, more tests
Modified: short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc 2012-09-08 23:18:15 UTC (rev 20706)
+++ short/3D/PyLith/trunk/libsrc/pylith/materials/Material.cc 2012-09-09 02:51:34 UTC (rev 20707)
@@ -408,6 +408,13 @@
Vec fieldVec = field->localVector();
bool useCurrentField = fieldSection != PETSC_NULL;
if (fieldSection) {
+ PetscInt pStart, pEnd;
+
+ err = PetscSectionGetChart(fieldSection, &pStart, &pEnd);CHECK_PETSC_ERROR(err);
+ if (pEnd < 0) {
+ err = DMComplexGetHeightStratum(dmMesh, 0, &pStart, &pEnd);CHECK_PETSC_ERROR(err);
+ err = PetscSectionSetChart(fieldSection, pStart, pEnd);CHECK_PETSC_ERROR(err);
+ }
// check fiber dimension
PetscInt totalFiberDimCurrentLocal = 0;
PetscInt totalFiberDimCurrent = 0;
Modified: short/3D/PyLith/trunk/libsrc/pylith/topology/Field.icc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/topology/Field.icc 2012-09-08 23:18:15 UTC (rev 20706)
+++ short/3D/PyLith/trunk/libsrc/pylith/topology/Field.icc 2012-09-09 02:51:34 UTC (rev 20707)
@@ -72,14 +72,6 @@
const
mesh_type&
pylith::topology::Field<mesh_type, section_type>::mesh(void) const {
- std::ostringstream msg;
-
- msg << "Sieve Section Meshes are no longer supported: " << const_cast<Field*>(this)->_metadata["default"].label << "\n"
- << " Destination section:\n"
- << " space dim: " << spaceDim() << "\n"
- << " vector field type: " << const_cast<Field*>(this)->_metadata["default"].vectorFieldType << "\n"
- << " scale: " << const_cast<Field*>(this)->_metadata["default"].scale;
- throw std::runtime_error(msg.str());
return _mesh;
}
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc 2012-09-08 23:18:15 UTC (rev 20706)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldMesh.cc 2012-09-09 02:51:34 UTC (rev 20707)
@@ -388,9 +388,9 @@
field.clear();
- CPPUNIT_ASSERT_EQUAL(PylithScalar(1.0), field._metadata.scale);
- CPPUNIT_ASSERT_EQUAL(Field<Mesh>::OTHER, field._metadata.vectorFieldType);
- CPPUNIT_ASSERT_EQUAL(false, field._metadata.dimsOkay);
+ CPPUNIT_ASSERT_EQUAL(PylithScalar(1.0), field._metadata["default"].scale);
+ CPPUNIT_ASSERT_EQUAL(Field<Mesh>::OTHER, field._metadata["default"].vectorFieldType);
+ CPPUNIT_ASSERT_EQUAL(false, field._metadata["default"].dimsOkay);
} // testClear
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc 2012-09-08 23:18:15 UTC (rev 20706)
+++ short/3D/PyLith/trunk/unittests/libtests/topology/TestFieldSubMesh.cc 2012-09-09 02:51:34 UTC (rev 20707)
@@ -296,9 +296,9 @@
field.clear();
- CPPUNIT_ASSERT_EQUAL(PylithScalar(1.0), field._metadata.scale);
- CPPUNIT_ASSERT_EQUAL(Field<SubMesh>::OTHER, field._metadata.vectorFieldType);
- CPPUNIT_ASSERT_EQUAL(false, field._metadata.dimsOkay);
+ CPPUNIT_ASSERT_EQUAL(PylithScalar(1.0), field._metadata["default"].scale);
+ CPPUNIT_ASSERT_EQUAL(Field<SubMesh>::OTHER, field._metadata["default"].vectorFieldType);
+ CPPUNIT_ASSERT_EQUAL(false, field._metadata["default"].dimsOkay);
} // testClear
// ----------------------------------------------------------------------
More information about the CIG-COMMITS
mailing list