[cig-commits] r22206 - in short/3D/PyLith/trunk: libsrc/pylith/faults pylith/problems
brad at geodynamics.org
brad at geodynamics.org
Mon Jun 10 17:53:26 PDT 2013
Author: brad
Date: 2013-06-10 17:53:25 -0700 (Mon, 10 Jun 2013)
New Revision: 22206
Modified:
short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
short/3D/PyLith/trunk/pylith/problems/GreensFns.py
Log:
Fixed a couple small Green's function bugs (fixes that hadn't gotten merged in from stable).
Modified: short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2013-06-10 15:53:32 UTC (rev 22205)
+++ short/3D/PyLith/trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2013-06-11 00:53:25 UTC (rev 22206)
@@ -120,7 +120,12 @@
int
pylith::faults::FaultCohesiveImpulses::numImpulses(void) const
{ // numImpulses
- return _impulsePoints.size();
+ MPI_Comm comm = _faultMesh->comm();
+ int numImpulsesLocal = _impulsePoints.size();
+ int numImpulses = 0;
+ MPI_Allreduce(&numImpulsesLocal, &numImpulses, 1, MPI_INT, MPI_SUM, comm);
+
+ return numImpulses;
} // numImpulses
// ----------------------------------------------------------------------
@@ -334,6 +339,9 @@
const int v_fault = _cohesiveVertices[iVertex].fault;
PetscInt goff;
+ // :BUG: MATT This doesn't work. The offsets are all positive. I
+ // expected negative offsets for nonlocal values. Is the SF not
+ // setup properly for a section over the fault?
err = PetscSectionGetOffset(amplitudeGlobalSection, v_fault, &goff);PYLITH_CHECK_ERROR(err);
if (goff < 0) {
continue;
@@ -397,14 +405,14 @@
PetscDM faultDMMesh = _faultMesh->dmMesh();assert(faultDMMesh);
// Gather number of points on each processor.
- const int numImpulsesLocal = pointOrder.size();
+ int numImpulsesLocal = pointOrder.size();
MPI_Comm comm = _faultMesh->comm();
PetscMPIInt commSize, commRank;
PetscErrorCode err;
err = MPI_Comm_size(comm, &commSize);PYLITH_CHECK_ERROR(err);
err = MPI_Comm_rank(comm, &commRank);PYLITH_CHECK_ERROR(err);
int_array numImpulsesAll(commSize);
- err = MPI_Allgather((void *) &numImpulsesLocal, 1, MPI_INT, (void *) &numImpulsesAll[0], commSize, MPI_INT, comm);PYLITH_CHECK_ERROR(err);
+ err = MPI_Allgather((void*) &numImpulsesLocal, 1, MPI_INT, (void*) &numImpulsesAll[0], 1, MPI_INT, comm);PYLITH_CHECK_ERROR(err);
int localOffset = 0;
for (int i=0; i < commRank; ++i) {
Modified: short/3D/PyLith/trunk/pylith/problems/GreensFns.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/GreensFns.py 2013-06-10 15:53:32 UTC (rev 22205)
+++ short/3D/PyLith/trunk/pylith/problems/GreensFns.py 2013-06-11 00:53:25 UTC (rev 22206)
@@ -151,7 +151,7 @@
for material in self.materials.components():
material.useElasticBehavior(True)
- nimpulses = self.source.numImpulses()*self.source.numComponents()
+ nimpulses = self.source.numImpulses()
ipulse = 0;
dt = 1.0
while ipulse < nimpulses:
More information about the CIG-COMMITS
mailing list