[cig-commits] r20993 - in short/3D/PyLith/branches/v1.8-stable: libsrc/pylith/faults pylith/problems
brad at geodynamics.org
brad at geodynamics.org
Tue Nov 6 01:13:17 PST 2012
Author: brad
Date: 2012-11-06 01:13:16 -0800 (Tue, 06 Nov 2012)
New Revision: 20993
Modified:
short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveImpulses.cc
short/3D/PyLith/branches/v1.8-stable/pylith/problems/GreensFns.py
Log:
Fixed two bugs in computing Green's functions. Must account for number of impulses on each processor. Fixed how number of impulses was calculated.
Modified: short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveImpulses.cc
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2012-11-06 08:38:51 UTC (rev 20992)
+++ short/3D/PyLith/branches/v1.8-stable/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2012-11-06 09:13:16 UTC (rev 20993)
@@ -118,7 +118,15 @@
int
pylith::faults::FaultCohesiveImpulses::numImpulses(void) const
{ // numImpulses
- return _impulsePoints.size();
+ assert(_faultMesh);
+ const ALE::Obj<SieveSubMesh>& faultSieveMesh = _faultMesh->sieveMesh();
+ assert(!faultSieveMesh.isNull());
+ MPI_Comm comm = faultSieveMesh->comm();
+ int numImpulsesLocal = _impulsePoints.size();
+ int numImpulses = 0;
+ MPI_Allreduce(&numImpulsesLocal, &numImpulses, 1, MPI_INT, MPI_SUM, comm);
+
+ return numImpulses;
} // numImpulses
// ----------------------------------------------------------------------
@@ -416,7 +424,7 @@
} // for
} // for
-#if 0 // DEBUGGING
+#if 1 // DEBUGGING
const ALE::Obj<RealSection>& amplitudeSection = _fields->get("impulse amplitude").section();
assert(!amplitudeSection.isNull());
int impulse = 0;
Modified: short/3D/PyLith/branches/v1.8-stable/pylith/problems/GreensFns.py
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/pylith/problems/GreensFns.py 2012-11-06 08:38:51 UTC (rev 20992)
+++ short/3D/PyLith/branches/v1.8-stable/pylith/problems/GreensFns.py 2012-11-06 09:13:16 UTC (rev 20993)
@@ -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