[cig-commits] [commit] master: Ensure stress drop for all blocks is communicated (c9efa61)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Dec 10 10:00:54 PST 2014


Repository : https://github.com/geodynamics/vq

On branch  : master
Link       : https://github.com/geodynamics/vq/compare/4d339b3a383b69e1552cfeef4ca20868a1377289...d0edc6ddd56f9105f6d2488db4a9f36368529695

>---------------------------------------------------------------

commit c9efa613220bde866ef2366e37ae64658e4eafec
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Fri Dec 5 17:03:50 2014 -0800

    Ensure stress drop for all blocks is communicated


>---------------------------------------------------------------

c9efa613220bde866ef2366e37ae64658e4eafec
 src/core/Simulation.cpp              |  0
 src/simulation/UpdateBlockStress.cpp | 30 +++++++++++++++++++++++++++---
 2 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/src/simulation/UpdateBlockStress.cpp b/src/simulation/UpdateBlockStress.cpp
index 7d2b3c0..d362e03 100644
--- a/src/simulation/UpdateBlockStress.cpp
+++ b/src/simulation/UpdateBlockStress.cpp
@@ -33,14 +33,18 @@ void UpdateBlockStress::init(SimFramework *_sim) {
     sim = static_cast<Simulation *>(_sim);
     tmpBuffer = new double[sim->numGlobalBlocks()];
 
-    for (lid=0; lid<sim->numLocalBlocks(); ++lid) {
-        gid = sim->getGlobalBID(lid);
-
+    // All processes need the friction values for all blocks, so we set rhogd here
+    // and transfer stress drop values between nodes later
+    for (gid=0; gid<sim->numGlobalBlocks(); ++gid) {
         double rho = 5.515e3;      // density of rock in kg m^-3
         double g = 9.81;           // force of gravity in m s^-2
         double depth = -sim->getBlock(gid).center()[2];  // depth of block center in m
 
         sim->setRhogd(gid, rho*g*depth);       // kg m^-3 * m s^-2 * m = kg m^-1 * s^-2 = Pa
+    }
+
+    for (lid=0; lid<sim->numLocalBlocks(); ++lid) {
+        gid = sim->getGlobalBID(lid);
 
         // Set stresses to their specified initial values
         sim->setShearStress(gid, sim->getBlock(gid).getInitShearStress());
@@ -66,6 +70,26 @@ void UpdateBlockStress::init(SimFramework *_sim) {
         }
     }
 
+#ifdef MPI_C_FOUND
+
+    // Transfer stress drop values between nodes
+    // This is needed for normal stress Green's calculations
+    for (gid=0; gid<sim->numGlobalBlocks(); ++gid) {
+        double     stress_drop;
+
+        if (sim->isLocalBlockID(gid)) {
+            stress_drop = sim->getStressDrop(gid);
+        }
+
+        MPI_Bcast(&stress_drop, 1, MPI_DOUBLE, sim->getBlockNode(gid), MPI_COMM_WORLD);
+
+        if (!sim->isLocalBlockID(gid)) {
+            sim->setStressDrop(gid, stress_drop);
+        }
+    }
+
+#endif
+
     // Compute initial stress on all blocks
     stressRecompute();
 }



More information about the CIG-COMMITS mailing list