[cig-commits] r17040 - in short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials: . data
brad at geodynamics.org
brad at geodynamics.org
Tue Jul 13 12:02:45 PDT 2010
Author: brad
Date: 2010-07-13 12:02:45 -0700 (Tue, 13 Jul 2010)
New Revision: 17040
Modified:
short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/TestMaterial.cc
short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc
short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc
short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/PowerLaw3DElasticData.cc
Log:
Added testing of db property and state variable names in data files (consistency check only).
Modified: short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/TestMaterial.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/TestMaterial.cc 2010-07-13 17:08:53 UTC (rev 17039)
+++ short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/TestMaterial.cc 2010-07-13 19:02:45 UTC (rev 17040)
@@ -337,8 +337,18 @@
CPPUNIT_ASSERT(0 != _material);
CPPUNIT_ASSERT(0 != _data);
+ // Check to make sure names of Metadata values match names of test
+ // data values (consistency check).
+ const int numDBProperties = _data->numDBProperties;
+ char** dbPropertyLabelsE = _data->dbPropertyValues;
+ CPPUNIT_ASSERT_EQUAL(numDBProperties, _material->_metadata.numDBProperties());
+ const char* const* dbPropertyLabels = _material->_metadata.dbProperties();
+ for (int i=0; i < numDBProperties; ++i)
+ CPPUNIT_ASSERT_EQUAL(std::string(dbPropertyLabelsE[i]),
+ std::string(dbPropertyLabels[i]));
+
+ // Test _dbToProperties()
const int numLocs = _data->numLocs;
- const int numDBProperties = _data->numDBProperties;
double_array dbValues(numDBProperties);
const int propertiesSize = _data->numPropsQuadPt;
@@ -443,8 +453,18 @@
CPPUNIT_ASSERT(0 != _material);
CPPUNIT_ASSERT(0 != _data);
+ // Check to make sure names of Metadata values match names of test
+ // data values (consistency check).
+ const int numDBStateVars = _data->numDBStateVars;
+ char** dbStateVarsLabelsE = _data->dbStateVarValues;
+ CPPUNIT_ASSERT_EQUAL(numDBStateVars, _material->_metadata.numDBStateVars());
+ const char* const* dbStateVarsLabels = _material->_metadata.dbStateVars();
+ for (int i=0; i < numDBStateVars; ++i)
+ CPPUNIT_ASSERT_EQUAL(std::string(dbStateVarsLabelsE[i]),
+ std::string(dbStateVarsLabels[i]));
+
+ // Test _dbToStateVars()
const int numLocs = _data->numLocs;
- const int numDBStateVars = _data->numDBStateVars;
double_array dbValues(numDBStateVars);
const int stateVarsSize = _data->numVarsQuadPt;
Modified: short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc 2010-07-13 17:08:53 UTC (rev 17039)
+++ short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/DruckerPrager3DElasticData.cc 2010-07-13 19:02:45 UTC (rev 17040)
@@ -58,9 +58,9 @@
"density",
"vs",
"vp",
-"friction_angle",
+"friction-angle",
"cohesion",
-"dilatation_angle",
+"dilatation-angle",
};
const char* pylith::materials::DruckerPrager3DElasticData::_dbStateVarValues[] = {
Modified: short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc 2010-07-13 17:08:53 UTC (rev 17039)
+++ short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/GenMaxwellIsotropic3DElasticData.cc 2010-07-13 19:02:45 UTC (rev 17040)
@@ -64,12 +64,12 @@
"density",
"vs",
"vp",
-"shear_ratio_1",
-"shear_ratio_2",
-"shear_ratio_3",
-"viscosity_1",
-"viscosity_2",
-"viscosity_3",
+"shear-ratio-1",
+"shear-ratio-2",
+"shear-ratio-3",
+"viscosity-1",
+"viscosity-2",
+"viscosity-3",
};
const char* pylith::materials::GenMaxwellIsotropic3DElasticData::_dbStateVarValues[] = {
Modified: short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/PowerLaw3DElasticData.cc
===================================================================
--- short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/PowerLaw3DElasticData.cc 2010-07-13 17:08:53 UTC (rev 17039)
+++ short/3D/PyLith/branches/v1.5-stable/unittests/libtests/materials/data/PowerLaw3DElasticData.cc 2010-07-13 19:02:45 UTC (rev 17040)
@@ -59,9 +59,9 @@
"density",
"vs",
"vp",
-"reference_strain_rate",
-"reference_stress",
-"power_law_exponent",
+"reference-strain-rate",
+"reference-stress",
+"power-law-exponent",
};
const char* pylith::materials::PowerLaw3DElasticData::_dbStateVarValues[] = {
More information about the CIG-COMMITS
mailing list