[cig-commits] [commit] knepley/upgrade-petsc-interface: Faults: Exclude cohesive cells with unsplit edges/vertices from the calculation (53819bd)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Mar 4 19:07:42 PST 2014
Repository : ssh://geoshell/pylith
On branch : knepley/upgrade-petsc-interface
Link : https://github.com/geodynamics/pylith/compare/69d1381cfee5ae37c85808aee9eaaeeab995e8e7...d5cd09cc75d5998a65749ad45611f1985520f663
>---------------------------------------------------------------
commit 53819bd2dc8d359b73c8d4dbcc3449cff084a6b8
Author: Matthew G. Knepley <knepley at gmail.com>
Date: Tue Mar 4 21:07:07 2014 -0600
Faults: Exclude cohesive cells with unsplit edges/vertices from the calculation
>---------------------------------------------------------------
53819bd2dc8d359b73c8d4dbcc3449cff084a6b8
libsrc/pylith/faults/CohesiveTopology.cc | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/libsrc/pylith/faults/CohesiveTopology.cc b/libsrc/pylith/faults/CohesiveTopology.cc
index fc431f5..37143d2 100644
--- a/libsrc/pylith/faults/CohesiveTopology.cc
+++ b/libsrc/pylith/faults/CohesiveTopology.cc
@@ -621,7 +621,7 @@ pylith::faults::CohesiveTopology::createInterpolated(topology::Mesh* mesh,
PetscDM sdm = NULL;
PetscDM dm = mesh->dmMesh();assert(dm);
PetscDMLabel subpointMap = NULL, label = NULL, mlabel = NULL;
- PetscInt cMax, cEnd, numCohesiveCellsOld;
+ PetscInt dim, cMax, cEnd, numCohesiveCellsOld;
PetscErrorCode err;
// Have to remember the old number of cohesive cells
@@ -636,17 +636,25 @@ pylith::faults::CohesiveTopology::createInterpolated(topology::Mesh* mesh,
// 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 = DMPlexConstructCohesiveCells(dm, label, &sdm);PYLITH_CHECK_ERROR(err);
- err = DMLabelDestroy(&label);PYLITH_CHECK_ERROR(err);
+ /* TODO: Eliminate Lagrange dofs from lopback edges */
+ err = DMPlexGetDimension(dm, &dim);PYLITH_CHECK_ERROR(err);
err = DMPlexGetLabel(sdm, "material-id", &mlabel);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);
assert(cEnd > cMax + numCohesiveCellsOld);
for (PetscInt cell = cMax; cell < cEnd - numCohesiveCellsOld; ++cell) {
+ PetscInt onBd;
+
+ /* Eliminate hybrid cells on the boundary of the split from cohesive label,
+ they are marked with -(cell number) since the hybrid cell number aliases vertices in the old mesh */
+ err = DMLabelGetValue(label, -cell, &onBd);PYLITH_CHECK_ERROR(err);
+ if (onBd == dim) continue;
err = DMLabelSetValue(mlabel, cell, materialId);PYLITH_CHECK_ERROR(err);
}
}
+ err = DMLabelDestroy(&label);PYLITH_CHECK_ERROR(err);
PetscReal lengthScale = 1.0;
err = DMPlexGetScale(dm, PETSC_UNIT_LENGTH, &lengthScale);PYLITH_CHECK_ERROR(err);
More information about the CIG-COMMITS
mailing list