[cig-commits] [commit] master: Add aftershock log and accessor functions (e59a275)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Oct 8 17:04:37 PDT 2014


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

On branch  : master
Link       : https://github.com/geodynamics/vc/compare/23464fca3efa2b6ad7ee0ce8f60c225b18b49741...e4325192ad1118379f46ba66899cb98143d09e04

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

commit e59a27503bb446e00d54d82cf8bc425a7c881699
Author: Eric Heien <emheien at ucdavis.edu>
Date:   Wed Sep 17 11:50:07 2014 -0700

    Add aftershock log and accessor functions


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

e59a27503bb446e00d54d82cf8bc425a7c881699
 src/core/VCSimDataEvents.h | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/core/VCSimDataEvents.h b/src/core/VCSimDataEvents.h
index 1ffc23a..9437934 100644
--- a/src/core/VCSimDataEvents.h
+++ b/src/core/VCSimDataEvents.h
@@ -29,6 +29,9 @@ class VCSimDataEvents {
         //! Current event in the simulation (older events are discarded)
         VCEvent                     cur_event;
 
+        //! Current set of aftershocks to be processed
+        AftershockSet               cur_aftershocks;
+    
         //! Current count of events
         unsigned int                event_cnt;
 
@@ -45,6 +48,19 @@ class VCSimDataEvents {
             cur_event = new_event;
             event_cnt++;
         };
+        void addAftershock(const VCEventAftershock &new_aftershock) {
+            cur_aftershocks.insert(new_aftershock);
+        };
+        double nextAftershockTime(void) {
+            if (cur_aftershocks.size() > 0) {
+                return cur_aftershocks.begin()->t;
+            } else {
+                return DBL_MAX;
+            }
+        };
+        unsigned int numAftershocksToProcess(void) {
+            return cur_aftershocks.size();
+        };
 };
 
 #endif



More information about the CIG-COMMITS mailing list