[cig-commits] [commit] master: Rename variables (d55416b)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Dec 2 13:56:05 PST 2014
Repository : https://github.com/geodynamics/vq
On branch : master
Link : https://github.com/geodynamics/vq/compare/06902a05cf4d70bc94c85d1c195c073d4e74cdad...c935dfd33f870a081b6c01cce97a060ad1cbdbda
>---------------------------------------------------------------
commit d55416bcf6823c15150426fbf679364ee0fab9ed
Author: Eric Heien <emheien at ucdavis.edu>
Date: Sat Nov 22 00:30:21 2014 -0800
Rename variables
>---------------------------------------------------------------
d55416bcf6823c15150426fbf679364ee0fab9ed
src/core/Block.cpp | 20 ++++++++++----------
src/core/Block.h | 26 +++++++++++---------------
2 files changed, 21 insertions(+), 25 deletions(-)
diff --git a/src/core/Block.cpp b/src/core/Block.cpp
index 4c5c57a..f66994a 100644
--- a/src/core/Block.cpp
+++ b/src/core/Block.cpp
@@ -146,12 +146,12 @@ bool Block::dynamicFailure(const FaultID &event_fault) const {
}
void Block::calcCFF(void) {
- state.cff = fabs(state.stressS[0]) - fabs(friction()*state.stressN[0]);
+ state.cff = fabs(state.shear_stress[0]) - fabs(friction()*state.normal_stress[0]);
}
-void Block::setStatePtrs(double *stressS, double *stressN, double *update_field) {
- state.stressS = stressS;
- state.stressN = stressN;
+void Block::setStatePtrs(double *shear_stress, double *normal_stress, double *update_field) {
+ state.shear_stress = shear_stress;
+ state.normal_stress = normal_stress;
state.updateField = update_field;
}
@@ -160,8 +160,8 @@ StateCheckpointData State::readCheckpointData(void) const {
ckpt_data.slipDeficit = slipDeficit;
ckpt_data.cff = cff;
- ckpt_data.stressS = *stressS;
- ckpt_data.stressN = *stressN;
+ ckpt_data.shear_stress = *shear_stress;
+ ckpt_data.normal_stress = *normal_stress;
ckpt_data.updateField = *updateField;
return ckpt_data;
@@ -170,16 +170,16 @@ StateCheckpointData State::readCheckpointData(void) const {
void State::storeCheckpointData(const StateCheckpointData &ckpt_data) {
slipDeficit = ckpt_data.slipDeficit;
cff = ckpt_data.cff;
- *stressS = ckpt_data.stressS;
- *stressN = ckpt_data.stressN;
+ *shear_stress = ckpt_data.shear_stress;
+ *normal_stress = ckpt_data.normal_stress;
*updateField = ckpt_data.updateField;
}
std::ostream &operator<<(std::ostream &os, const State &s) {
os << std::setw(10) << s.cff
<< std::setw(12) << s.updateField[0]
- << std::setw(10) << s.stressS[0]
- << std::setw(10) << s.stressN[0];
+ << std::setw(10) << s.shear_stress[0]
+ << std::setw(10) << s.normal_stress[0];
return os;
}
diff --git a/src/core/Block.h b/src/core/Block.h
index 07621bf..4ec370a 100644
--- a/src/core/Block.h
+++ b/src/core/Block.h
@@ -38,8 +38,8 @@ typedef unsigned int SectionID;
struct StateCheckpointData {
double slipDeficit;
double cff;
- double stressS;
- double stressN;
+ double shear_stress;
+ double normal_stress;
double updateField;
};
@@ -77,7 +77,7 @@ std::ostream &operator<<(std::ostream &os, const BlockVal &bv);
*/
class State {
public:
- State(void) : slipDeficit(0), cff(0), cff0(0), stressS0(0), stressN0(0), stressS(NULL), stressN(NULL), updateField(NULL) {};
+ State(void) : slipDeficit(0), cff(0), cff0(0), stressS0(0), stressN0(0), shear_stress(NULL), normal_stress(NULL), updateField(NULL) {};
//! slip - Vt
double slipDeficit;
//! coulomb failure function
@@ -88,12 +88,10 @@ class State {
double stressS0;
//! normal stress before an event
double stressN0;
- //! slip deficit before an event
- double slipDeficit0;
//! ptr to shear stress in simulation
- double *stressS;
+ double *shear_stress;
//! ptr to normal stress in simulation
- double *stressN;
+ double *normal_stress;
//! ptr to update_field in simulation
double *updateField;
@@ -169,21 +167,19 @@ class Block : public quakelib::SimElement {
};
//! Returns the slip deficit of this block.
double getShearStress(void) const {
- return state.stressS[0];
+ return state.shear_stress[0];
};
//! Returns the slip deficit of this block.
double getNormalStress(void) const {
- return state.stressN[0];
+ return state.normal_stress[0];
};
//! Calculates and stores the CFF of this block.
void calcCFF(void);
//! Record the current stresses and CFF.
void saveStresses(void) {
- state.stressS0 = state.stressS[0];
- state.stressN0 = state.stressN[0];
+ state.stressS0 = state.shear_stress[0];
+ state.stressN0 = state.normal_stress[0];
state.cff0 = state.cff;
- state.slipDeficit0 = state.slipDeficit;
- };
};
//! Get the recorded shear stress.
double getStressS0(void) const {
@@ -198,7 +194,7 @@ class Block : public quakelib::SimElement {
return state.cff0;
};
//! Set pointers into arrays for the stress values of this block
- void setStatePtrs(double *stressS, double *stressN, double *update_field);
+ void setStatePtrs(double *shear_stress, double *normal_stress, double *update_field);
// Functions for manipulation of block parameters
//! Set the block ID of this block.
@@ -288,7 +284,7 @@ class Block : public quakelib::SimElement {
//! Get the string header for state files.
static std::string getStateHeader(void) {
- return " cff updateField stressS stressN";
+ return " cff updateField shear_stress normal_stress";
};
};
More information about the CIG-COMMITS
mailing list