[cig-commits] [commit] knepley/upgrade-petsc-interface: TopologyTests: Fixed label check (fa51e99)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Oct 29 12:35:31 PDT 2013
Repository : ssh://geoshell/pylith
On branch : knepley/upgrade-petsc-interface
Link : https://github.com/geodynamics/pylith/compare/bdcd276300d9bfb60c6eb1bf5ab7622d170ed3c3...fa51e996b6e488bee3553868d0bcf40e778caa3b
>---------------------------------------------------------------
commit fa51e996b6e488bee3553868d0bcf40e778caa3b
Author: Matthew G. Knepley <knepley at gmail.com>
Date: Tue Oct 29 14:37:40 2013 -0500
TopologyTests: Fixed label check
>---------------------------------------------------------------
fa51e996b6e488bee3553868d0bcf40e778caa3b
unittests/libtests/topology/TestRefineUniform.cc | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/unittests/libtests/topology/TestRefineUniform.cc b/unittests/libtests/topology/TestRefineUniform.cc
index 3e6333a..71a2edf 100644
--- a/unittests/libtests/topology/TestRefineUniform.cc
+++ b/unittests/libtests/topology/TestRefineUniform.cc
@@ -314,21 +314,22 @@ pylith::topology::TestRefineUniform::_testRefine(const MeshDataCohesive& data,
PetscInt numGroups, pStart, pEnd;
err = DMPlexGetChart(dmMesh, &pStart, &pEnd);PYLITH_CHECK_ERROR(err);
err = DMPlexGetNumLabels(dmMesh, &numGroups);PYLITH_CHECK_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(data.numGroups, numGroups-2); // Omit depth and material labels
PetscInt index = 0;
for(PetscInt iGroup = 0; iGroup < data.numGroups; ++iGroup) {
+ // Omit depth, vtk, ghost and material-id labels
// Don't know order of labels, so do brute force linear search
bool foundLabel = false;
int iLabel = 0;
const char *name = NULL;
PetscInt firstPoint = 0;
+
while (iLabel < numGroups) {
err = DMPlexGetLabelName(dmMesh, iLabel, &name);PYLITH_CHECK_ERROR(err);
if (0 == strcmp(data.groupNames[iGroup], name)) {
- foundLabel = true;
- break;
+ foundLabel = true;
+ break;
} else {
- ++iLabel;
+ ++iLabel;
} // if/else
} // while
CPPUNIT_ASSERT(foundLabel);
More information about the CIG-COMMITS
mailing list