[cig-commits] r20032 - in short/3D/PyLith/branches/v1.7-trunk: libsrc/pylith/faults pylith/problems
brad at geodynamics.org
brad at geodynamics.org
Thu May 3 13:05:14 PDT 2012
Author: brad
Date: 2012-05-03 13:05:13 -0700 (Thu, 03 May 2012)
New Revision: 20032
Modified:
short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py
Log:
Fixes to GreensFns.
Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2012-05-03 20:02:58 UTC (rev 20031)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2012-05-03 20:05:13 UTC (rev 20032)
@@ -406,18 +406,20 @@
const int impulse = ncomps*offset + icomp;
impulseInfo.indexDOF = _impulseDOF[icomp];
_impulsePoints[impulse] = impulseInfo;
- std::cout << "Adding impulse " << impulse << ", iCohesive: " << impulseInfo.indexCohesive << ", offset: " << offset << ", icomp: " << impulseInfo.indexDOF << std::endl;
} // for
} // for
#if 0 // DEBUGGING
+ const ALE::Obj<RealSection>& amplitudeSection = _fields->get("impulse amplitude").section();
+ assert(!amplitudeSection.isNull());
int impulse = 0;
for (int irank=0; irank < commSize; ++irank) {
MPI_Barrier(comm);
if (commRank == irank) {
for (int i=0; i < _impulsePoints.size(); ++i, ++impulse) {
const ImpulseInfoStruct& info = _impulsePoints[impulse];
- std::cout << "["<<irank<<"]: " << impulse << " -> (" << info.indexCohesive << "," << info.indexDOF << ")" << std::endl;
+ const PylithScalar* amplitudeVertex = amplitudeSection->restrictPoint(_cohesiveVertices[info.indexCohesive].fault);
+ std::cout << "["<<irank<<"]: " << impulse << " -> (" << info.indexCohesive << "," << info.indexDOF << "), v_fault: " << _cohesiveVertices[info.indexCohesive].fault << ", amplitude: " << amplitudeVertex[0] << std::endl;
} // for
} // if
} // for
@@ -469,7 +471,10 @@
dispRelSection->updatePoint(v_fault, &dispRelVertex[0]);
} // if
- //dispRel.view("DISP RELATIVE"); // DEBUGGING
+#if 0 // DEBUGGING
+ std::cout << "impulse: " << impulse << std::endl;
+ dispRel.view("DISP RELATIVE"); // DEBUGGING
+#endif
} // _setRelativeDisp
Modified: short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py 2012-05-03 20:02:58 UTC (rev 20031)
+++ short/3D/PyLith/branches/v1.7-trunk/pylith/problems/GreensFns.py 2012-05-03 20:05:13 UTC (rev 20032)
@@ -147,6 +147,10 @@
self._info.log("Computing Green's functions.")
self.checkpointTimer.toplevel = app # Set handle for saving state
+ # Limit material behavior to linear regime
+ for material in self.materials.components():
+ material.useLinearBehavior(True)
+
nimpulses = self.source.numImpulses()*self.source.numComponents()
ipulse = 0;
dt = 1.0
@@ -155,7 +159,9 @@
if 0 == comm.rank:
self._info.log("Main loop, impulse %d of %d." % (ipulse+1, nimpulses))
- t = float(ipulse)
+ # Implicit time stepping computes solution at t+dt, so set
+ # t=ipulse-dt, so that t+dt corresponds to the impulse
+ t = float(ipulse)-dt
# Checkpoint if necessary
self.checkpointTimer.update(t)
More information about the CIG-COMMITS
mailing list