[cig-commits] [commit] knepley/fix-faults-parallel: Faults: Provide the label marking fault halo vertices to DMPlexLabelCohesiveComplete() (96a97b5)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Mon Apr 28 09:22:59 PDT 2014
Repository : ssh://geoshell/pylith
On branch : knepley/fix-faults-parallel
Link : https://github.com/geodynamics/pylith/compare/71bd4cb87f8874ee77abbb30bdf6986afa62349f...96a97b54c2e3426d62617703be018cb08f5f4dbb
>---------------------------------------------------------------
commit 96a97b54c2e3426d62617703be018cb08f5f4dbb
Author: Matthew G. Knepley <knepley at gmail.com>
Date: Mon Apr 28 11:22:51 2014 -0500
Faults: Provide the label marking fault halo vertices to DMPlexLabelCohesiveComplete()
>---------------------------------------------------------------
96a97b54c2e3426d62617703be018cb08f5f4dbb
libsrc/pylith/faults/CohesiveTopology.cc | 4 +++-
libsrc/pylith/faults/CohesiveTopology.hh | 3 ++-
libsrc/pylith/faults/FaultCohesive.cc | 5 ++++-
unittests/libtests/faults/TestFaultMesh.cc | 2 +-
4 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/libsrc/pylith/faults/CohesiveTopology.cc b/libsrc/pylith/faults/CohesiveTopology.cc
index 748694b..4930d0b 100644
--- a/libsrc/pylith/faults/CohesiveTopology.cc
+++ b/libsrc/pylith/faults/CohesiveTopology.cc
@@ -60,6 +60,7 @@ pylith::faults::CohesiveTopology::createFault(topology::Mesh* faultMesh,
err = DMPlexCreateLabel(subdm, labelName);PYLITH_CHECK_ERROR(err);
err = DMPlexGetLabel(subdm, labelName, &label);PYLITH_CHECK_ERROR(err);
err = DMPlexMarkBoundaryFaces(subdm, label);PYLITH_CHECK_ERROR(err);
+ err = DMPlexLabelComplete(subdm, label);PYLITH_CHECK_ERROR(err);
err = DMPlexCreateSubmesh(subdm, label, 1, &faultBoundary);PYLITH_CHECK_ERROR(err);
std::string submeshLabel = "fault_" + std::string(groupName);
faultMesh->dmMesh(subdm, submeshLabel.c_str());
@@ -610,6 +611,7 @@ void
pylith::faults::CohesiveTopology::createInterpolated(topology::Mesh* mesh,
const topology::Mesh& faultMesh,
PetscDM faultBoundary,
+ PetscDMLabel faultBdLabel,
const int materialId,
int& firstFaultVertex,
int& firstLagrangeVertex,
@@ -634,7 +636,7 @@ pylith::faults::CohesiveTopology::createInterpolated(topology::Mesh* mesh,
err = DMLabelClearStratum(label, mesh->dimension());PYLITH_CHECK_ERROR(err);
// Completes the set of cells scheduled to be replaced
// Have to do internal fault vertices before fault boundary vertices, and this is the only thing I use faultBoundary for
- err = DMPlexLabelCohesiveComplete(dm, label, PETSC_FALSE, faultMesh.dmMesh());PYLITH_CHECK_ERROR(err);
+ err = DMPlexLabelCohesiveComplete(dm, label, faultBdLabel, PETSC_FALSE, faultMesh.dmMesh());PYLITH_CHECK_ERROR(err);
err = DMPlexConstructCohesiveCells(dm, label, &sdm);PYLITH_CHECK_ERROR(err);
err = DMPlexGetDimension(dm, &dim);PYLITH_CHECK_ERROR(err);
diff --git a/libsrc/pylith/faults/CohesiveTopology.hh b/libsrc/pylith/faults/CohesiveTopology.hh
index 4b2d7fc..9c7c47d 100644
--- a/libsrc/pylith/faults/CohesiveTopology.hh
+++ b/libsrc/pylith/faults/CohesiveTopology.hh
@@ -98,7 +98,8 @@ public :
static
void createInterpolated(topology::Mesh* mesh,
const topology::Mesh& faultMesh,
- DM faultBoundary,
+ PetscDM faultBoundary,
+ PetscDMLabel faultBdLabel,
const int materialId,
int& firstFaultVertex,
int& firstLagrangeVertex,
diff --git a/libsrc/pylith/faults/FaultCohesive.cc b/libsrc/pylith/faults/FaultCohesive.cc
index 65b1548..140944b 100644
--- a/libsrc/pylith/faults/FaultCohesive.cc
+++ b/libsrc/pylith/faults/FaultCohesive.cc
@@ -148,7 +148,10 @@ pylith::faults::FaultCohesive::adjustTopology(topology::Mesh* const mesh,
CohesiveTopology::createFault(&faultMesh, faultBoundary, *mesh, groupField);
if (dim > 1 && dim == gdepth) {
- CohesiveTopology::createInterpolated(mesh, faultMesh, faultBoundary, id(), *firstFaultVertex, *firstLagrangeVertex, *firstFaultCell, useLagrangeConstraints());
+ PetscDMLabel faultBdLabel = NULL;
+
+ if (edge()) {err = DMPlexGetLabel(dmMesh, edge(), &faultBdLabel);PYLITH_CHECK_ERROR(err);}
+ CohesiveTopology::createInterpolated(mesh, faultMesh, faultBoundary, faultBdLabel, id(), *firstFaultVertex, *firstLagrangeVertex, *firstFaultCell, useLagrangeConstraints());
} else {
CohesiveTopology::create(mesh, faultMesh, faultBoundary, groupField, id(), *firstFaultVertex, *firstLagrangeVertex, *firstFaultCell, useLagrangeConstraints());
}
diff --git a/unittests/libtests/faults/TestFaultMesh.cc b/unittests/libtests/faults/TestFaultMesh.cc
index 28257fe..a709255 100644
--- a/unittests/libtests/faults/TestFaultMesh.cc
+++ b/unittests/libtests/faults/TestFaultMesh.cc
@@ -54,7 +54,7 @@ pylith::faults::TestFaultMesh::createFaultMesh(topology::Mesh* faultMesh,
CPPUNIT_ASSERT(groupField);
CohesiveTopology::createFault(faultMesh, faultBoundary, *mesh, groupField);
if (mesh->dimension() > 1 && mesh->dimension() == depth) {
- CohesiveTopology::createInterpolated(mesh, *faultMesh, faultBoundary, faultId, firstFaultVertex, firstLagrangeVertex, firstFaultCell, useLagrangeConstraints);
+ CohesiveTopology::createInterpolated(mesh, *faultMesh, faultBoundary, NULL, faultId, firstFaultVertex, firstLagrangeVertex, firstFaultCell, useLagrangeConstraints);
} else {
CohesiveTopology::create(mesh, *faultMesh, faultBoundary, groupField, faultId, firstFaultVertex, firstLagrangeVertex, firstFaultCell, useLagrangeConstraints);
}
More information about the CIG-COMMITS
mailing list