[cig-commits] [commit] master: Fix ordering of sweep recording (a49227b)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Oct 8 17:06:08 PDT 2014
Repository : https://github.com/geodynamics/vc
On branch : master
Link : https://github.com/geodynamics/vc/compare/23464fca3efa2b6ad7ee0ce8f60c225b18b49741...e4325192ad1118379f46ba66899cb98143d09e04
>---------------------------------------------------------------
commit a49227bc78f29f1c0e87761af482638fa01e5f60
Author: Eric Heien <emheien at ucdavis.edu>
Date: Thu Sep 25 14:28:35 2014 -0700
Fix ordering of sweep recording
>---------------------------------------------------------------
a49227bc78f29f1c0e87761af482638fa01e5f60
src/core/VCSimulation.cpp | 12 ++++++------
src/simulation/RunEvent.cpp | 36 +++++++++++++++++++++++++++---------
2 files changed, 33 insertions(+), 15 deletions(-)
diff --git a/src/core/VCSimulation.cpp b/src/core/VCSimulation.cpp
index 97daddf..26457b9 100644
--- a/src/core/VCSimulation.cpp
+++ b/src/core/VCSimulation.cpp
@@ -656,17 +656,17 @@ void VCSimulation::collectEventSweep(quakelib::ModelSweeps &sweeps) {
for (i=0; i<total_sweep_count; ++i) {
BlockID bid = all_sweeps[i].element_id;
unsigned int sweep_num = all_sweeps[i].sweep_num;
- sweeps.setSlipAndArea(bid,
- sweep_num,
+ sweeps.setSlipAndArea(sweep_num,
+ bid,
all_sweeps[i].slip,
getBlock(bid).area(),
getBlock(bid).lame_mu());
- sweeps.setInitStresses(bid,
- sweep_num,
+ sweeps.setInitStresses(sweep_num,
+ bid,
all_sweeps[i].init_shear,
all_sweeps[i].init_normal);
- sweeps.setFinalStresses(bid,
- sweep_num,
+ sweeps.setFinalStresses(sweep_num,
+ bid,
all_sweeps[i].final_shear,
all_sweeps[i].final_normal);
}
diff --git a/src/simulation/RunEvent.cpp b/src/simulation/RunEvent.cpp
index a29727c..7d775fc 100644
--- a/src/simulation/RunEvent.cpp
+++ b/src/simulation/RunEvent.cpp
@@ -76,8 +76,15 @@ void RunEvent::processBlocksOrigFail(VCSimulation *sim, quakelib::ModelSweeps &s
if (slip > -b.state.slipDeficit) slip = -b.state.slipDeficit;
// Record how much the block slipped in this sweep and initial stresses
- sweeps.setSlipAndArea(b.getBlockID(), sweep_num, slip, b.area(), b.lame_mu());
- sweeps.setInitStresses(b.getBlockID(), sweep_num, b.getShearStress(), b.getNormalStress());
+ sweeps.setSlipAndArea(sweep_num,
+ b.getBlockID(),
+ slip,
+ b.area(),
+ b.lame_mu());
+ sweeps.setInitStresses(sweep_num,
+ b.getBlockID(),
+ b.getShearStress(),
+ b.getNormalStress());
b.state.slipDeficit += slip;
}
@@ -209,8 +216,15 @@ void RunEvent::processBlocksSecondaryFailures(VCSimulation *sim, quakelib::Model
if (slip > 0) {
// Record how much the block slipped in this sweep and initial stresses
- sweeps.setSlipAndArea(block.getBlockID(), sweep_num, slip, block.area(), block.lame_mu());
- sweeps.setInitStresses(block.getBlockID(), sweep_num, block.getShearStress(), block.getNormalStress());
+ sweeps.setSlipAndArea(sweep_num,
+ block.getBlockID(),
+ slip,
+ block.area(),
+ block.lame_mu());
+ sweeps.setInitStresses(sweep_num,
+ block.getBlockID(),
+ block.getShearStress(),
+ block.getNormalStress());
block.state.slipDeficit += slip;
}
@@ -336,8 +350,8 @@ void RunEvent::processStaticFailure(VCSimulation *sim) {
for (fit=global_failed_elements.begin(); fit!=global_failed_elements.end(); ++fit) {
if (sim->isLocalBlockID(fit->first)) {
Block &b = sim->getBlock(fit->first);
- event_sweeps.setFinalStresses(fit->first,
- sweep_num,
+ event_sweeps.setFinalStresses(sweep_num,
+ fit->first,
b.getShearStress(),
b.getNormalStress());
}
@@ -420,13 +434,17 @@ void RunEvent::processAftershock(VCSimulation *sim) {
// Create the sweep describing this aftershock
// Since we don't distinguish sweeps, every slip occurs in sweep 0
- event_sweeps.setSlipAndArea(*bit, 0, element_slip, b.area(), b.lame_mu());
- event_sweeps.setInitStresses(*bit, 0, b.getShearStress(), b.getNormalStress());
+ event_sweeps.setSlipAndArea(0, *bit, element_slip, b.area(), b.lame_mu());
+ event_sweeps.setInitStresses(0, *bit, b.getShearStress(), b.getNormalStress());
}
// Recalculate stresses
- //current_sweep.setFinalStresses(fit->first, b.getShearStress(), b.getNormalStress());
+ // Record final stresses on each block involved in the aftershock
+ for (bit=id_set.begin(); bit!=id_set.end(); ++bit) {
+ Block &b=sim->getBlock(*bit);
+ event_sweeps.setFinalStresses(0, *bit, b.getShearStress(), b.getNormalStress());
+ }
// Add sweeps to list
sim->getCurrentEvent().setSweeps(event_sweeps);
More information about the CIG-COMMITS
mailing list