[cig-commits] [commit] knepley/upgrade-petsc-interface: Topology: Check for empty material-id label (14e3c72)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Nov 21 08:37:12 PST 2013
Repository : ssh://geoshell/pylith
On branch : knepley/upgrade-petsc-interface
Link : https://github.com/geodynamics/pylith/compare/98809641a2f06d95f29257aaa275c3523f4eb303...14e3c7218d29e16d44beae10754c16e527273126
>---------------------------------------------------------------
commit 14e3c7218d29e16d44beae10754c16e527273126
Author: Matthew G. Knepley <knepley at gmail.com>
Date: Thu Nov 21 10:39:54 2013 -0600
Topology: Check for empty material-id label
>---------------------------------------------------------------
14e3c7218d29e16d44beae10754c16e527273126
libsrc/pylith/faults/CohesiveTopology.cc | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/libsrc/pylith/faults/CohesiveTopology.cc b/libsrc/pylith/faults/CohesiveTopology.cc
index 690f498..1fe9ac0 100644
--- a/libsrc/pylith/faults/CohesiveTopology.cc
+++ b/libsrc/pylith/faults/CohesiveTopology.cc
@@ -636,10 +636,12 @@ pylith::faults::CohesiveTopology::createInterpolated(topology::Mesh* mesh,
PetscInt cMax, cEnd;
err = DMPlexGetLabel(sdm, "material-id", &mlabel);PYLITH_CHECK_ERROR(err);
- err = DMPlexGetHeightStratum(sdm, 0, NULL, &cEnd);PYLITH_CHECK_ERROR(err);
- err = DMPlexGetHybridBounds(sdm, &cMax, NULL, NULL, NULL);PYLITH_CHECK_ERROR(err);
- for (PetscInt cell = cMax; cell < cEnd; ++cell) {
- err = DMLabelSetValue(mlabel, cell, materialId);PYLITH_CHECK_ERROR(err);
+ if (mlabel) {
+ err = DMPlexGetHeightStratum(sdm, 0, NULL, &cEnd);PYLITH_CHECK_ERROR(err);
+ err = DMPlexGetHybridBounds(sdm, &cMax, NULL, NULL, NULL);PYLITH_CHECK_ERROR(err);
+ for (PetscInt cell = cMax; cell < cEnd; ++cell) {
+ err = DMLabelSetValue(mlabel, cell, materialId);PYLITH_CHECK_ERROR(err);
+ }
}
PetscReal lengthScale = 1.0;
More information about the CIG-COMMITS
mailing list