[cig-commits] r14403 - in short/3D/PyLith/branches/pylith-swig: libsrc/topology unittests/libtests/topology
brad at geodynamics.org
brad at geodynamics.org
Fri Mar 20 09:45:49 PDT 2009
Author: brad
Date: 2009-03-20 09:45:48 -0700 (Fri, 20 Mar 2009)
New Revision: 14403
Modified:
short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc
Log:
Fixed one error, others persist.
Modified: short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc 2009-03-20 13:49:27 UTC (rev 14402)
+++ short/3D/PyLith/branches/pylith-swig/libsrc/topology/Field.cc 2009-03-20 16:45:48 UTC (rev 14403)
@@ -158,6 +158,7 @@
newSection();
if (!_section.isNull()) {
+ // ERROR? ARE THESE LINES CORRECT?
_section->setAtlas(srcSection->getAtlas());
_section->allocateStorage();
_section->setBC(srcSection->getBC());
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc 2009-03-20 13:49:27 UTC (rev 14402)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldMesh.cc 2009-03-20 16:45:48 UTC (rev 14403)
@@ -166,7 +166,7 @@
const int nconstraints[] = { 0, 2, 1, 3 };
const int constraints[] = {
// 0
- 0, 3, // 1
+ 0, 2, // 1
2, // 2
0, 1, 2, // 3
};
@@ -205,7 +205,7 @@
const int nconstraints[] = { 0, 2, 1, 3 };
const int constraints[] = {
// 0
- 0, 3, // 1
+ 0, 2, // 1
2, // 2
0, 1, 2, // 3
};
@@ -239,12 +239,12 @@
++v_iter, index += nconstraints[i++])
section->setConstraintDof(*v_iter, &constraints[index]);
fieldSrc.zero();
- //fieldSrc.view("ZERO FIELD"); // TEMPORARY
- fieldSrc.createScatter();
+ fieldSrc.view("ZERO FIELD"); // TEMPORARY
+ fieldSrc.createScatter(); // ERROR (including this line causes error)
} // Setup source field
Field<Mesh> field(mesh);
- field.newSection(fieldSrc);
+ field.newSection(fieldSrc); // ERROR REALLY HERE?
const ALE::Obj<Mesh::RealSection>& section = field.section();
CPPUNIT_ASSERT(!section.isNull());
int iV = 0;
Modified: short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc 2009-03-20 13:49:27 UTC (rev 14402)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/topology/TestFieldSubMesh.cc 2009-03-20 16:45:48 UTC (rev 14403)
@@ -184,13 +184,6 @@
pylith::topology::TestFieldSubMesh::testNewSectionChart(void)
{ // testNewSectionChart
const int fiberDim = 3;
- const int nconstraints[] = { 0, 2, 1, 3 };
- const int constraints[] = {
- // 0
- 0, 3, // 1
- 2, // 2
- 0, 1, 2, // 3
- };
Mesh mesh;
SubMesh submesh;
@@ -227,7 +220,7 @@
const int nconstraints[] = { 0, 2, 1, 3 };
const int constraints[] = {
// 0
- 0, 3, // 1
+ 0, 2, // 1
2, // 2
0, 1, 2, // 3
};
@@ -849,12 +842,12 @@
CPPUNIT_ASSERT(0 != vec);
int size = 0;
VecGetSize(vec, &size);
- double* valuesVec = 0;
- VecGetArray(vec, &valuesVec);
+ const int sizeE = vertices->size() * fiberDim;
+ CPPUNIT_ASSERT_EQUAL(sizeE, size); // ERROR: sizeE=9, size=12
const double tolerance = 1.0e-06;
- const int sizeE = vertices->size() * fiberDim;
- CPPUNIT_ASSERT_EQUAL(sizeE, size);
+ double* valuesVec = 0;
+ VecGetArray(vec, &valuesVec);
for (int i=0; i < sizeE; ++i)
valuesVec[i] = valuesE[i];
VecRestoreArray(vec, &valuesVec);
@@ -871,7 +864,6 @@
for (int iDim=0; iDim < fiberDim; ++iDim)
CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesE[i++], values[iDim], tolerance);
} // for
-
} // testScatterVectorToSection
// ----------------------------------------------------------------------
More information about the CIG-COMMITS
mailing list