[cig-commits] r11814 - cs/benchmark/cigma/trunk/src
luis at geodynamics.org
luis at geodynamics.org
Tue Apr 15 08:10:01 PDT 2008
Author: luis
Date: 2008-04-15 08:10:01 -0700 (Tue, 15 Apr 2008)
New Revision: 11814
Modified:
cs/benchmark/cigma/trunk/src/OkadaBenchmarkFields.cpp
Log:
Avoid unecessary calls to getM() in Disloc3d::eval()
Modified: cs/benchmark/cigma/trunk/src/OkadaBenchmarkFields.cpp
===================================================================
--- cs/benchmark/cigma/trunk/src/OkadaBenchmarkFields.cpp 2008-04-15 15:09:59 UTC (rev 11813)
+++ cs/benchmark/cigma/trunk/src/OkadaBenchmarkFields.cpp 2008-04-15 15:10:01 UTC (rev 11814)
@@ -1,5 +1,6 @@
#include "OkadaBenchmarkFields.h"
#include "okada/cervelli.h"
+#include "okada/disloc3d.h"
#include "Misc.h"
using namespace cigma;
@@ -21,7 +22,7 @@
flag2 = new double[nsubfaults];
//
- // define strike slip fault
+ // define a strike-slip fault
//
int i;
double *n;
@@ -66,8 +67,12 @@
fi[9] = ds;
fi[10] = ts;
}
+ delete [] n;
- delete [] n;
+ // get the "model matrix" with
+ // fault patch info in the form
+ // for cervelli calcs
+ getM(subfaults, nsubfaults, mu, models);
}
strike_slip::Disloc3d::~Disloc3d()
@@ -82,20 +87,17 @@
bool strike_slip::Disloc3d::eval(double *station, double *disloc)
{
//
- // XXX: deconstruct the following call.
- // Specifically, move the call to getM() into the constructor,
- // and then, instead, call disloc3d() with the appropriate arguments
+ // call the disloc3d wrapper
//
- calc_disp_cervelli(
- mu, nu,
- models, subfaults, nsubfaults,
- station, 1,
- displacement, derivatives, stress,
- flag, flag2);
+ disloc3d(models, nsubfaults,
+ station, 1,
+ mu, nu,
+ displacement, derivatives, stress,
+ flag, flag2);
//
// copy the answer into the output array
- // XXX: add a selection method which defaults to displacements?
+ // XXX: add a selector boolean?
//
disloc[0] = displacement[0];
disloc[1] = displacement[1];
More information about the cig-commits
mailing list