[cig-commits] [commit] knepley/fix-faults-parallel: Faults: Create a "clamped" label in the fault mesh that contains unsplit vertices (3024a26)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu Apr 17 15:13:17 PDT 2014
Repository : ssh://geoshell/pylith
On branch : knepley/fix-faults-parallel
Link : https://github.com/geodynamics/pylith/compare/00789904641d4e7624704b12d090a37853fe558d...3024a26c49e046806d7236baad593c56fae56062
>---------------------------------------------------------------
commit 3024a26c49e046806d7236baad593c56fae56062
Author: Matthew G. Knepley <knepley at gmail.com>
Date: Thu Apr 17 17:13:08 2014 -0500
Faults: Create a "clamped" label in the fault mesh that contains unsplit vertices
>---------------------------------------------------------------
3024a26c49e046806d7236baad593c56fae56062
libsrc/pylith/faults/BruneSlipFn.cc | 17 ++++++++++++++++-
libsrc/pylith/faults/FaultCohesiveLagrange.cc | 1 +
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/libsrc/pylith/faults/BruneSlipFn.cc b/libsrc/pylith/faults/BruneSlipFn.cc
index 4d5597b..3da6e6e 100644
--- a/libsrc/pylith/faults/BruneSlipFn.cc
+++ b/libsrc/pylith/faults/BruneSlipFn.cc
@@ -160,9 +160,17 @@ pylith::faults::BruneSlipFn::initialize(const topology::Mesh& faultMesh,
scalar_array vCoordsGlobal(spaceDim);
topology::CoordsVisitor coordsVisitor(dmMesh);
PetscScalar* coordsArray = coordsVisitor.localArray();
+ PetscDM faultDMMesh = faultMesh.dmMesh();assert(faultDMMesh);
+ DMLabel clamped;
+ PetscErrorCode err;
+ err = DMPlexGetLabel(faultDMMesh, "clamped", &clamped);PYLITH_CHECK_ERROR(err);
_slipVertex.resize(spaceDim);
for(PetscInt v = vStart; v < vEnd; ++v) {
+ PetscInt value = 0;
+
+ if (clamped) {err = DMLabelGetValue(clamped, v, &value);PYLITH_CHECK_ERROR(err);}
+ if (value >= 0) continue;
// Dimensionalize coordinates
const PetscInt coff = coordsVisitor.sectionOffset(v);
assert(spaceDim == coordsVisitor.sectionDof(v));
@@ -174,7 +182,7 @@ pylith::faults::BruneSlipFn::initialize(const topology::Mesh& faultMesh,
// Final slip
const PetscInt fsoff = finalSlipVisitor.sectionOffset(v);
assert(spaceDim == finalSlipVisitor.sectionDof(v));
- int err = _dbFinalSlip->query(&_slipVertex[0], _slipVertex.size(), &vCoordsGlobal[0], vCoordsGlobal.size(), cs);
+ err = _dbFinalSlip->query(&_slipVertex[0], _slipVertex.size(), &vCoordsGlobal[0], vCoordsGlobal.size(), cs);
if (err) {
std::ostringstream msg;
msg << "Could not find slip rate at (";
@@ -262,9 +270,16 @@ pylith::faults::BruneSlipFn::slip(topology::Field* slip,
topology::VecVisitorMesh slipVisitor(*slip);
PetscScalar* slipArray = slipVisitor.localArray();
+ DMLabel clamped;
+ PetscErrorCode err;
+ err = DMPlexGetLabel(dmMesh, "clamped", &clamped);PYLITH_CHECK_ERROR(err);
const int spaceDim = _slipVertex.size();
for(PetscInt v = vStart; v < vEnd; ++v) {
+ PetscInt value = 0;
+
+ if (clamped) {err = DMLabelGetValue(clamped, v, &value);PYLITH_CHECK_ERROR(err);}
+ if (value >= 0) continue;
const PetscInt fsoff = finalSlipVisitor.sectionOffset(v);
const PetscInt stoff = slipTimeVisitor.sectionOffset(v);
const PetscInt rtoff = riseTimeVisitor.sectionOffset(v);
diff --git a/libsrc/pylith/faults/FaultCohesiveLagrange.cc b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
index b91949a..e5cdd7a 100644
--- a/libsrc/pylith/faults/FaultCohesiveLagrange.cc
+++ b/libsrc/pylith/faults/FaultCohesiveLagrange.cc
@@ -1130,6 +1130,7 @@ void pylith::faults::FaultCohesiveLagrange::_initializeCohesiveInfo(const topolo
indexMap[e_lagrange] = index; // add index to map
++index;
} // if
+ err = DMPlexSetLabelValue(faultDMMesh, "clamped", v_fault, 1);PYLITH_CHECK_ERROR(err);
continue;
}
const PetscInt v_negative = cone[0];
More information about the CIG-COMMITS
mailing list