[cig-commits] r21475 - short/3D/PyLith/trunk/unittests/libtests/faults/data
brad at geodynamics.org
brad at geodynamics.org
Fri Mar 8 15:43:14 PST 2013
Author: brad
Date: 2013-03-08 15:43:14 -0800 (Fri, 08 Mar 2013)
New Revision: 21475
Modified:
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.hh
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py
Log:
Updated unit test data for using scales in FaultCohesiveDyn.
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.cc 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.cc 2013-03-08 23:43:14 UTC (rev 21475)
@@ -22,6 +22,10 @@
// Constructor
pylith::faults::CohesiveDynData::CohesiveDynData(void) :
meshFilename(0),
+ lengthScale(1.0e+3),
+ pressureScale(2.25e+10),
+ densityScale(1.0),
+ timeScale(2.0),
spaceDim(0),
cellDim(0),
numBasis(0),
@@ -50,6 +54,8 @@
constraintVertices(0),
numConstraintVert(0)
{ // constructor
+ const PylithScalar velScale = lengthScale / timeScale;
+ densityScale = pressureScale / (velScale*velScale);
} // constructor
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.hh 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynData.hh 2013-03-08 23:43:14 UTC (rev 21475)
@@ -44,6 +44,14 @@
char* meshFilename; ///< Filename for input mesh
+ /// @name Scales information for nondimensionalization.
+ //@{
+ PylithScalar lengthScale; ///< Length scale.
+ PylithScalar pressureScale; ///< Pressure scale.
+ PylithScalar timeScale; ///< Time scale.
+ PylithScalar densityScale; ///< Density scale.
+ //@}
+
/// @name Quadrature information
//@{
int spaceDim; ///< Number of dimensions in vertex coordinates
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataHex8.cc 2013-03-08 23:43:14 UTC (rev 21475)
@@ -1420,18 +1420,18 @@
1.200000000000, 2.200000000000, 0.200000000000,
1.300000000000, 2.300000000000, 0.300000000000,
1.400000000000, 2.400000000000, 0.400000000000,
- 1.500000000000, 3.745293503266, 1.312227205500,
- 1.600000000000, 3.294980394575, 1.386664200491,
- 1.700000000000, 3.591763265955, 1.582543631245,
- 1.800000000000, 3.703107773803, 1.671356663600,
+ 1.500000000000, 2.500001245294, 0.500000812227,
+ 1.600000000000, 2.600000694980, 0.600000786664,
+ 1.700000000000, 2.700000891763, 0.700000882544,
+ 1.800000000000, 2.800000903108, 0.800000871357,
1.900000000000, 2.900000000000, 0.900000000000,
1.000000000000, 2.000000000000, 0.000000000000,
1.100000000000, 2.100000000000, 0.100000000000,
1.200000000000, 2.200000000000, 0.200000000000,
- 1.500000000000, 1.254706496734, -0.312227205500,
- 1.600000000000, 1.905019605425, -0.186664200491,
- 1.700000000000, 1.808236734045, -0.182543631245,
- 1.800000000000, 1.896892226197, -0.071356663600,
+ 1.500000000000, 2.499998754706, 0.499999187773,
+ 1.600000000000, 2.599999305020, 0.599999213336,
+ 1.700000000000, 2.699999108237, 0.699999117456,
+ 1.800000000000, 2.799999096892, 0.799999128643,
1.400000000000, 0.328479469127, -1.239953753608,
1.600000000000, 0.293941190358, -1.262585961634,
1.800000000000, 0.259995967920, -1.286431883494,
@@ -1439,10 +1439,10 @@
};
const PylithScalar pylith::faults::CohesiveDynDataHex8::_slipSlipE[] = {
- 2.490587006532, -1.624454410999, 0.000000000000,
- 1.389960789150, -1.573328400983, 0.000000000000,
- 1.783526531910, -1.765087262491, 0.000000000000,
- 1.806215547605, -1.742713327201, 0.000000000000,
+ 0.000002490587, -0.000001624454, 0.000000000000,
+ 0.000001389961, -0.000001573328, 0.000000000000,
+ 0.000001783527, -0.000001765087, 0.000000000000,
+ 0.000001806216, -0.000001742713, 0.000000000000,
};
// ----------------------------------------------------------------------
@@ -1478,18 +1478,18 @@
1.200000000000, 2.200000000000, 0.200000000000,
1.300000000000, 2.300000000000, 0.300000000000,
1.400000000000, 2.400000000000, 0.400000000000,
- 3.473386524898, 3.450458773757, 1.061077907335,
- 3.302801176428, 2.966499592247, 1.097759351340,
- 3.627558189277, 3.252968860584, 1.264881344260,
- 3.475698668581, 3.241605816971, 1.233144951440,
+ 1.500001973387, 2.500000950459, 0.500000561078,
+ 1.600001702801, 2.600000366500, 0.600000497759,
+ 1.700001927558, 2.700000552969, 0.700000564881,
+ 1.800001675699, 2.800000441606, 0.800000433145,
1.900000000000, 2.900000000000, 0.900000000000,
1.000000000000, 2.000000000000, 0.000000000000,
1.100000000000, 2.100000000000, 0.100000000000,
1.200000000000, 2.200000000000, 0.200000000000,
- -0.473386524898, 1.549541226243, -0.061077907335,
- -0.102801176428, 2.233500407753, 0.102240648660,
- -0.227558189277, 2.147031139416, 0.135118655740,
- 0.124301331419, 2.358394183029, 0.366855048560,
+ 1.499998026613, 2.499999049541, 0.499999438922,
+ 1.599998297199, 2.599999633500, 0.599999502241,
+ 1.699998072442, 2.699999447031, 0.699999435119,
+ 1.799998324301, 2.799999558394, 0.799999566855,
-4.400000000000, -2.400000000000, -3.400000000000,
-4.600000000000, -2.600000000000, -3.600000000000,
-4.800000000000, -2.800000000000, -3.800000000000,
@@ -1497,10 +1497,10 @@
};
const PylithScalar pylith::faults::CohesiveDynDataHex8::_slipOpenE[] = {
- 1.900917547514, -1.122155814671, 3.946773049797,
- 0.732999184495, -0.995518702680, 3.405602352856,
- 1.105937721169, -1.129762688519, 3.855116378553,
- 0.883211633942, -0.866289902880, 3.351397337162,
+ 0.000001900918, -0.000001122156, 0.000003946773,
+ 0.000000732999, -0.000000995519, 0.000003405602,
+ 0.000001105938, -0.000001129763, 0.000003855116,
+ 0.000000883212, -0.000000866290, 0.000003351397,
};
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataQuad4.cc 2013-03-08 23:43:14 UTC (rev 21475)
@@ -336,19 +336,19 @@
const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrSlipE[] = {
1.100000000000, 2.100000000000,
1.200000000000, 2.200000000000,
- 1.300000000000, 2.406970297611,
- 1.400000000000, 3.369389712309,
+ 1.300000000000, 2.300106970298,
+ 1.400000000000, 2.400969389712,
1.500000000000, 2.500000000000,
1.600000000000, 2.600000000000,
- 1.300000000000, 2.193029702389,
- 1.400000000000, 1.430610287691,
+ 1.300000000000, 2.299893029702,
+ 1.400000000000, 2.399030610288,
1.800000000000, -3.440000000000,
1.000000000000, -3.600000000000,
};
const PylithScalar pylith::faults::CohesiveDynDataQuad4::_slipSlipE[] = {
- 0.213940595221, 0.000000000000,
- 1.938779424618, 0.000000000000,
+ 0.000213940595, 0.000000000000,
+ 0.001938779425, 0.000000000000,
};
// ----------------------------------------------------------------------
@@ -372,19 +372,19 @@
const PylithScalar pylith::faults::CohesiveDynDataQuad4::_fieldIncrOpenE[] = {
1.100000000000, 2.100000000000,
1.200000000000, 2.200000000000,
- 3.815834136232, 2.039404156843,
- 4.287400342924, 3.820863468454,
+ 1.302515834136, 2.299739404157,
+ 1.402887400343, 2.401420863468,
1.500000000000, 2.500000000000,
1.600000000000, 2.600000000000,
- -1.215834136232, 2.560595843157,
- -1.487400342924, 0.979136531546,
+ 1.297484165864, 2.300260595843,
+ 1.397112599657, 2.398579136532,
-8.800000000000, -9.800000000000,
-8.000000000000, -9.000000000000,
};
const PylithScalar pylith::faults::CohesiveDynDataQuad4::_slipOpenE[] = {
- -0.521191686313, 5.031668272463,
- 2.841726936907, 5.774800685848,
+ -0.000521191686, 0.005031668272,
+ 0.002841726937, 0.005774800686,
};
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTet4.cc 2013-03-08 23:43:14 UTC (rev 21475)
@@ -543,22 +543,22 @@
// Output
const PylithScalar pylith::faults::CohesiveDynDataTet4::_fieldIncrSlipE[] = {
1.100000000000, 2.100000000000, 3.100000000000,
- 1.200000000000, 2.427020189783, 3.226804829918,
- 1.300000000000, 2.281534813168, 3.292288303722,
- 1.400000000000, 2.543753403100, 3.499170314087,
+ 1.200000000000, 2.200000227020, 3.200000026805,
+ 1.300000000000, 2.299999981535, 3.299999992288,
+ 1.400000000000, 2.400000143753, 3.400000099170,
1.500000000000, 2.500000000000, 3.500000000000,
- 1.200000000000, 1.972979810217, 3.173195170082,
- 1.300000000000, 2.318465186832, 3.307711696278,
- 1.400000000000, 2.256246596900, 3.300829685913,
+ 1.200000000000, 2.199999772980, 3.199999973195,
+ 1.300000000000, 2.300000018465, 3.300000007712,
+ 1.400000000000, 2.399999856247, 3.399999900830,
9.700000000000, -1.935106067360, -1.748282570405,
9.900000000000, -1.959241090539, -1.782841275376,
9.100000000000, -1.865391385620, -1.642919108291,
};
const PylithScalar pylith::faults::CohesiveDynDataTet4::_slipSlipE[] = {
- 0.454040379566, -0.053609659837, 0.000000000000,
- -0.036930373664, 0.015423392555, 0.000000000000,
- 0.287506806199, -0.198340628174, 0.000000000000,
+ 0.000000454040, -0.000000053610, 0.000000000000,
+ -0.000000036930, 0.000000015423, 0.000000000000,
+ 0.000000287507, -0.000000198341, 0.000000000000,
};
// ----------------------------------------------------------------------
@@ -582,22 +582,22 @@
// Output
const PylithScalar pylith::faults::CohesiveDynDataTet4::_fieldIncrOpenE[] = {
1.100000000000, 2.100000000000, 3.100000000000,
- 2.478935676274, 2.200668834288, 2.866497129446,
- 2.514833997358, 1.906576121577, 2.868854721277,
- 2.460386652668, 2.373508489140, 3.258697327233,
+ 1.200001278936, 2.200000000669, 3.199999666497,
+ 1.300001214834, 2.299999606576, 3.299999568855,
+ 1.400001060387, 2.399999973508, 3.399999858697,
1.500000000000, 2.500000000000, 3.500000000000,
- -0.078935676274, 2.199331165712, 3.533502870554,
- 0.085166002642, 2.693423878423, 3.731145278723,
- 0.339613347332, 2.426491510860, 3.541302672767,
+ 1.199998721064, 2.199999999331, 3.200000333503,
+ 1.299998785166, 2.300000393424, 3.300000431145,
+ 1.399998939613, 2.400000026492, 3.400000141303,
-7.700000000000, -8.700000000000, -9.700000000000,
-7.900000000000, -8.900000000000, -9.900000000000,
-7.100000000000, -8.100000000000, -9.100000000000,
};
const PylithScalar pylith::faults::CohesiveDynDataTet4::_slipOpenE[] = {
- 0.001337668577, 0.667005741108, 2.557871352547,
- -0.786847756846, 0.862290557446, 2.429667994716,
- -0.052983021720, 0.282605345535, 2.120773305336,
+ 0.000000001338, 0.000000667006, 0.000002557871,
+ -0.000000786848, 0.000000862291, 0.000002429668,
+ -0.000000052983, 0.000000282605, 0.000002120773,
};
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3.cc 2013-03-08 23:43:14 UTC (rev 21475)
@@ -301,18 +301,18 @@
// Output
const PylithScalar pylith::faults::CohesiveDynDataTri3::_fieldIncrSlipE[] = {
9.100000000000, 7.100000000000,
- 9.200000000000, 7.390546440275,
- 9.300000000000, 8.283993111958,
+ 9.200000000000, 7.200190546440,
+ 9.300000000000, 7.300983993112,
9.400000000000, 7.400000000000,
- 9.200000000000, 7.009453559725,
- 9.300000000000, 6.316006888042,
+ 9.200000000000, 7.199809453560,
+ 9.300000000000, 7.299016006888,
1.600000000000, -3.480000000000,
1.800000000000, -3.440000000000,
};
const PylithScalar pylith::faults::CohesiveDynDataTri3::_slipSlipE[] = {
- 0.381092880550, 0.000000000000,
- 1.967986223916, 0.000000000000,
+ 0.000381092881, 0.000000000000,
+ 0.001967986224, 0.000000000000,
};
// ----------------------------------------------------------------------
@@ -333,18 +333,18 @@
// Output
const PylithScalar pylith::faults::CohesiveDynDataTri3::_fieldIncrOpenE[] = {
9.100000000000, 7.100000000000,
- 11.874337677762, 7.148344513504,
- 12.357207850137, 8.757371967576,
+ 9.202674337678, 7.199948344514,
+ 9.303057207850, 7.301457371968,
9.400000000000, 7.400000000000,
- 6.525662322238, 7.251655486496,
- 6.242792149863, 5.842628032424,
+ 9.197325662322, 7.200051655486,
+ 9.296942792150, 7.298542628032,
-8.600000000000, -9.600000000000,
-8.800000000000, -9.800000000000,
};
const PylithScalar pylith::faults::CohesiveDynDataTri3::_slipOpenE[] = {
- -0.103310972991, 5.348675355523,
- 2.914743935152, 6.114415700274,
+ -0.000103310973, 0.005348675356,
+ 0.002914743935, 0.006114415700,
};
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/CohesiveDynDataTri3d.cc 2013-03-08 23:43:14 UTC (rev 21475)
@@ -492,23 +492,23 @@
// Output
const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrSlipE[] = {
1.100000000000, 2.100000000000,
- 2.005761009464, 1.394238990536,
- 1.300000000000, 1.928356338235,
+ 1.200805761009, 2.199194238991,
+ 1.300000000000, 2.299628356338,
1.400000000000, 2.400000000000,
- 1.216364402612, 2.500000000000,
+ 1.499716364403, 2.500000000000,
1.600000000000, 2.600000000000,
- 0.394238990536, 3.005761009464,
- 1.300000000000, 2.671643661765,
- 1.783635597388, 2.500000000000,
+ 1.199194238991, 2.200805761009,
+ 1.300000000000, 2.300371643662,
+ 1.500283635597, 2.500000000000,
4.520000000000, -1.920000000000,
1.000000000000, -1.600000000000,
-0.560000000000, 0.200000000000,
};
const PylithScalar pylith::faults::CohesiveDynDataTri3d::_slipSlipE[] = {
- -2.279036295232, 0.000000000000,
- -0.743287323529, 0.000000000000,
- 0.567271194775, 0.000000000000,
+ -0.002279036295, 0.000000000000,
+ -0.000743287324, 0.000000000000,
+ 0.000567271195, 0.000000000000,
};
// ----------------------------------------------------------------------
@@ -533,23 +533,23 @@
// Output
const PylithScalar pylith::faults::CohesiveDynDataTri3d::_fieldIncrOpenE[] = {
1.100000000000, 2.100000000000,
- 9.940107961522, 3.662120348918,
- 5.688525058023, 5.314075601410,
+ 1.208740107962, 2.201462120349,
+ 1.304388525058, 2.303014075601,
1.400000000000, 2.400000000000,
- 3.622067204316, 6.167076609904,
+ 1.502122067204, 2.503667076610,
1.600000000000, 2.600000000000,
- -7.540107961522, 0.737879651082,
- -3.088525058023, -0.714075601410,
- -0.622067204316, -1.167076609904,
+ 1.191259892038, 2.198537879651,
+ 1.295611474942, 2.296985924399,
+ 1.497877932796, 2.496332923390,
3.800000000000, -4.800000000000,
-3.000000000000, -4.000000000000,
-3.200000000000, -4.200000000000,
};
const PylithScalar pylith::faults::CohesiveDynDataTri3d::_slipOpenE[] = {
- -10.292628788528, 14.428129643052,
- 6.028151202820, 8.777050116045,
- -4.244134408633, 7.334153219809,
+ -0.010292628789, 0.014428129643,
+ 0.006028151203, 0.008777050116,
+ -0.004244134409, 0.007334153220,
};
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py 2013-03-08 21:33:07 UTC (rev 21474)
+++ short/3D/PyLith/trunk/unittests/libtests/faults/data/cohesivedyn.py 2013-03-08 23:43:14 UTC (rev 21475)
@@ -1,5 +1,5 @@
-cell = "tri3d"
-dim = "2d"
+cell = "hex8"
+dim = "3d"
testCase = "open"
import numpy
@@ -9,6 +9,8 @@
numpy.set_printoptions(precision=12)
+lengthScale = 1.0e+3
+
# ----------------------------------------------------------------------
def printdata(data):
"""
@@ -265,6 +267,8 @@
# ------------------------------------------------------------------
+ lagrangeScale = lengthScale**1
+
fieldTpdt = fieldT + fieldIncr
fieldTpdt = globalToFault(fieldTpdt, C)
@@ -280,7 +284,7 @@
print "friction",friction
dlagrange0 = (friction - tractionShear) * fieldTpdt[:,0] / tractionShear
-
+
print "dlagrange0",dlagrange0
if testCase == "slip":
@@ -293,6 +297,7 @@
print "dLagrange \n", dLagrange
+ L /= lengthScale**1
RHS = numpy.dot(numpy.transpose(L),dLagrange)
print "RHS",RHS
duN = numpy.dot(inv(jacobianN),RHS)
@@ -333,6 +338,8 @@
# ----------------------------------------------------------------------
elif dim == "3d":
+ lagrangeScale = lengthScale**2
+
if cell == "tet4":
dlagrange2 = numpy.zeros(3)
@@ -595,6 +602,7 @@
print "dLagrange \n", dLagrange
+ L /= lengthScale**2
RHS = numpy.dot(numpy.transpose(L),dLagrange)
print "RHS",RHS
duN = numpy.dot(inv(jacobianN),RHS)
More information about the CIG-COMMITS
mailing list