[cig-commits] r9174 - in short/3D/PyLith/trunk/unittests/libtests/bc: . data
brad at geodynamics.org
brad at geodynamics.org
Tue Jan 29 11:11:48 PST 2008
Author: brad
Date: 2008-01-29 11:11:47 -0800 (Tue, 29 Jan 2008)
New Revision: 9174
Added:
short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_b_rate.spatialdb
short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_rate.spatialdb
Modified:
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPoints.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPointsMulti.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/data/Makefile.am
Log:
Updated C++ unit tests for DirichletPoints include checking of rate of change of values.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPoints.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPoints.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPoints.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -98,7 +98,7 @@
CPPUNIT_ASSERT_EQUAL(size, bc._valuesInitial.size());
const double tolerance = 1.0e-06;
for (int i=0; i < size; ++i)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->values[i], bc._valuesInitial[i],
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->valuesInitial[i], bc._valuesInitial[i],
tolerance);
} // testInitialize
@@ -248,8 +248,10 @@
// check constrained DOF
for (int iDOF=0; iDOF < numFixedDOF; ++iDOF) {
const int index = iConstraint * numFixedDOF + iDOF;
- CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->values[index],
- values[_data->fixedDOF[iDOF]],
+ const double valueE = (t > _data->tRef) ?
+ _data->valuesInitial[index] + (t-_data->tRef)*_data->valueRate :
+ _data->valuesInitial[index];
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(valueE, values[_data->fixedDOF[iDOF]],
tolerance);
} // for
++iConstraint;
@@ -282,7 +284,9 @@
spatialdata::spatialdb::UniformDB dbRate("TestDirichletPoints rate");
const char* names[] = { "dof-0", "dof-1", "dof-2" };
- const double values[] = { 0.0, 0.0, 0.0 };
+ const double values[] = { _data->valueRate,
+ _data->valueRate,
+ _data->valueRate };
const int numValues = 3;
dbRate.setData(names, values, numValues);
@@ -294,6 +298,7 @@
bc->label(_data->label);
bc->db(&db);
bc->dbRate(&dbRate);
+ bc->referenceTime(_data->tRef);
bc->fixedDOF(fixedDOF);
bc->initialize(*mesh, &cs, upDir);
} // _initialize
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPointsMulti.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPointsMulti.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletPointsMulti.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -143,7 +143,7 @@
// Only unconstrained values should be zero.
// Expected values set in _data->field
- const double t = 1.0;
+ const double t = 10.0;
bcA.setField(t, field, mesh);
bcB.setField(t, field, mesh);
@@ -184,11 +184,10 @@
dbIO.filename(_data->dbFilenameA);
db.ioHandler(&dbIO);
- spatialdata::spatialdb::UniformDB dbRate("TestDirichletPointsMulti rate");
- const char* names[] = { "dof-0", "dof-1", "dof-2" };
- const double values[] = { 0.0, 0.0, 0.0 };
- const int numValues = 3;
- dbRate.setData(names, values, numValues);
+ spatialdata::spatialdb::SimpleDB dbRate("TestDirichletPointsMulti rate");
+ spatialdata::spatialdb::SimpleIOAscii dbIORate;
+ dbIORate.filename(_data->dbFilenameARate);
+ dbRate.ioHandler(&dbIORate);
int_array fixedDOFA(_data->fixedDOFA, _data->numFixedDOFA);
const double upDirVals[] = { 0.0, 0.0, 1.0 };
@@ -198,6 +197,7 @@
bcA->label(_data->labelA);
bcA->db(&db);
bcA->dbRate(&dbRate);
+ bcA->referenceTime(_data->tRefA);
bcA->fixedDOF(fixedDOFA);
bcA->initialize(*mesh, &cs, upDir);
@@ -205,12 +205,16 @@
dbIO.filename(_data->dbFilenameB);
db.ioHandler(&dbIO);
+ dbIORate.filename(_data->dbFilenameBRate);
+ dbRate.ioHandler(&dbIORate);
+
int_array fixedDOFB(_data->fixedDOFB, _data->numFixedDOFB);
bcB->id(_data->idB);
bcB->label(_data->labelB);
bcB->db(&db);
bcB->dbRate(&dbRate);
+ bcB->referenceTime(_data->tRefB);
bcB->fixedDOF(fixedDOFB);
bcB->initialize(*mesh, &cs, upDir);
} // _initialize
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -15,6 +15,8 @@
// ----------------------------------------------------------------------
// Constructor
pylith::bc::DirichletPointsData::DirichletPointsData(void) :
+ tRef(0),
+ valueRate(0),
numDOF(0),
numFixedDOF(0),
numConstrainedPts(0),
@@ -22,7 +24,7 @@
label(0),
fixedDOF(0),
constrainedPoints(0),
- values(0),
+ valuesInitial(0),
meshFilename(0),
dbFilename(0)
{ // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsData.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -34,6 +34,9 @@
// PUBLIC MEMBERS ///////////////////////////////////////////////////////
public:
+ double tRef; ///< Reference time for rate of change of values
+ double valueRate; ///< Rate of change of value at constrained points.
+
int numDOF; ///< Number of degrees of freedom at each point.
int numFixedDOF; ///< Number of fixedDOF at constrained points.
int numConstrainedPts; ///< Number of points constrained.
@@ -43,7 +46,7 @@
int* fixedDOF; ///< Degrees of freedom that are constrained at each point
int* constrainedPoints; ///< Array of indices of constrained points.
- double* values; ///< Values at constrained points.
+ double* valuesInitial; ///< Values at constrained points.
char* meshFilename; ///< Filename for input mesh.
char* dbFilename; ///< Filename of simple spatial database.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -16,11 +16,14 @@
*
* Fixed DOF: { 0, 2 }
*
- * Values
+ * Initial values
* 0: -0.2, 0.3
* 1: 0.1, 0.7
* 6: 0.5, 0.4
* 7: 3.2, 6.1
+ * tref = 0.2
+ * Rate of change
+ * +0.4
*/
#include "DirichletPointsDataHex8.hh"
@@ -35,7 +38,10 @@
const int pylith::bc::DirichletPointsDataHex8::_numConstrainedPts = 4;
const int pylith::bc::DirichletPointsDataHex8::_constrainedPoints[] = { 0, 1, 6, 7 };
-const double pylith::bc::DirichletPointsDataHex8::_values[] = {
+
+const double pylith::bc::DirichletPointsDataHex8::_tRef = 0.2;
+const double pylith::bc::DirichletPointsDataHex8::_valueRate = 0.4;
+const double pylith::bc::DirichletPointsDataHex8::_valuesInitial[] = {
-0.2, 0.3,
0.1, 0.7,
0.5, 0.4,
@@ -52,13 +58,16 @@
id = _id;
label = const_cast<char*>(_label);
+ tRef = _tRef;
+ valueRate = _valueRate;
+
numDOF = _numDOF;
numFixedDOF = _numFixedDOF;
fixedDOF = const_cast<int*>(_fixedDOF);
numConstrainedPts = _numConstrainedPts;
constrainedPoints = const_cast<int*>(_constrainedPoints);
- values = const_cast<double*>(_values);
+ valuesInitial = const_cast<double*>(_valuesInitial);
meshFilename = const_cast<char*>(_meshFilename);
dbFilename = const_cast<char*>(_dbFilename);
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataHex8.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -47,7 +47,9 @@
static const int _fixedDOF[]; ///< Degrees of freedom constrained at points
static const int _constrainedPoints[]; ///< Array of indices of constrained pts.
- static const double _values[]; ///< Values at constrained points.
+ static const double _tRef; ///< Reference time for rate of change of value
+ static const double _valuesInitial[]; ///< Initial values.
+ static const double _valueRate; ///< Rate of change of values.
static const char* _meshFilename; ///< Filename of input mesh.
static const char* _dbFilename; ///< Filename of simple spatial database.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -20,6 +20,9 @@
* 0: 1.1 [constrained]
* 1: 0.8 [solution]
* 2: 2.2 [constrained]
+ * tref = 0.6
+ * Rate of change
+ * +0.3
*/
#include "DirichletPointsDataLine2.hh"
@@ -34,8 +37,12 @@
const int pylith::bc::DirichletPointsDataLine2::_numConstrainedPts = 2;
const int pylith::bc::DirichletPointsDataLine2::_constrainedPoints[] = { 0, 2 };
-const double pylith::bc::DirichletPointsDataLine2::_values[] = { 1.1, 2.2 };
+const double pylith::bc::DirichletPointsDataLine2::_tRef = 0.6;
+const double pylith::bc::DirichletPointsDataLine2::_valueRate = 0.3;
+const double pylith::bc::DirichletPointsDataLine2::_valuesInitial[] =
+ { 1.1, 2.2 };
+
const char* pylith::bc::DirichletPointsDataLine2::_meshFilename =
"data/line2.mesh";
const char* pylith::bc::DirichletPointsDataLine2::_dbFilename =
@@ -52,8 +59,11 @@
numConstrainedPts = _numConstrainedPts;
constrainedPoints = const_cast<int*>(_constrainedPoints);
- values = const_cast<double*>(_values);
+ tRef = _tRef;
+ valueRate = _valueRate;
+ valuesInitial = const_cast<double*>(_valuesInitial);
+
meshFilename = const_cast<char*>(_meshFilename);
dbFilename = const_cast<char*>(_dbFilename);
} // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -47,7 +47,9 @@
static const int _fixedDOF[]; ///< Degrees of freedom constrained at points
static const int _constrainedPoints[]; ///< Array of indices of constrained pts.
- static const double _values[]; ///< Values at constrained points.
+ static const double _tRef; ///< Reference time for rate of change of value
+ static const double _valueRate; ///< Rate of change of values.
+ static const double _valuesInitial[]; ///< Initial values.
static const char* _meshFilename; ///< Filename of input mesh.
static const char* _dbFilename; ///< Filename of simple spatial database.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -29,8 +29,11 @@
const int pylith::bc::DirichletPointsDataLine2b::_numConstrainedPts = 2;
const int pylith::bc::DirichletPointsDataLine2b::_constrainedPoints[] = { 0, 2 };
-const double pylith::bc::DirichletPointsDataLine2b::_values[] = {0};
+const double pylith::bc::DirichletPointsDataLine2b::_tRef = -0.2;
+const double pylith::bc::DirichletPointsDataLine2b::_valueRate = 1.0;
+const double pylith::bc::DirichletPointsDataLine2b::_valuesInitial[] = {0};
+
const char* pylith::bc::DirichletPointsDataLine2b::_meshFilename =
"data/line2.mesh";
const char* pylith::bc::DirichletPointsDataLine2b::_dbFilename =
@@ -47,8 +50,11 @@
numConstrainedPts = _numConstrainedPts;
constrainedPoints = const_cast<int*>(_constrainedPoints);
- values = const_cast<double*>(_values);
+ tRef = _tRef;
+ valueRate = _valueRate;
+ valuesInitial = const_cast<double*>(_valuesInitial);
+
meshFilename = const_cast<char*>(_meshFilename);
dbFilename = const_cast<char*>(_dbFilename);
} // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataLine2b.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -47,7 +47,9 @@
static const int _fixedDOF[]; ///< Degrees of freedom constrained at points
static const int _constrainedPoints[]; ///< Array of indices of constrained pts.
- static const double _values[]; ///< Values at constrained points.
+ static const double _tRef; ///< Reference time for rate of change of value
+ static const double _valueRate; ///< Rate of change of values.
+ static const double _valuesInitial[]; ///< Initial values.
static const char* _meshFilename; ///< Filename of input mesh.
static const char* _dbFilename; ///< Filename of simple spatial database.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -22,16 +22,18 @@
labelA(0),
fixedDOFA(0),
constrainedPointsA(0),
- valuesA(0),
dbFilenameA(0),
+ dbFilenameARate(0),
+ tRefA(0),
numFixedDOFB(0),
numConstrainedPtsB(0),
idB(0),
labelB(0),
fixedDOFB(0),
constrainedPointsB(0),
- valuesB(0),
dbFilenameB(0),
+ dbFilenameBRate(0),
+ tRefB(0),
field(0),
constraintSizes(0),
constrainedDOF(0),
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMulti.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -43,8 +43,9 @@
char* labelA; ///< Label for boundary condition group
int* fixedDOFA; ///< Degrees of freedom that are constrained at each point
int* constrainedPointsA; ///< Array of indices of constrained points.
- double* valuesA; ///< Values at constrained points.
- char* dbFilenameA; ///< Filename of simple spatial datamultibase.
+ char* dbFilenameA; ///< Filename for db with initial values.
+ char* dbFilenameARate; ///< Filename for db with rate of change of values.
+ double tRefA; ///< Reference time for rate of change of values.
//@}
//@{ Boundary condition B
@@ -54,8 +55,9 @@
char* labelB; ///< Label for boundary condition group
int* fixedDOFB; ///< Degrees of freedom that are constrained at each point
int* constrainedPointsB; ///< Array of indices of constrained points.
- double* valuesB; ///< Values at constrained points.
- char* dbFilenameB; ///< Filename of simple spatial datamultibase.
+ char* dbFilenameB; ///< Filename for db with initial values.
+ char* dbFilenameBRate; ///< Filename for db with rate of change of values.
+ double tRefB; ///< Reference time for rate of change of values.
//@}
double* field; ///< Values in field
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -16,17 +16,25 @@
*
* Fixed DOF: { 1 }
*
- * Values
+ * Initial values
* 1: 0.3
* 3: 0.7
+ * tRef = 3.2
+ * Rate of change of values
+ * 1: 0.2
+ * 3: 0.8
*
* DirichletPoints BC B at vertex 0 and 3.
*
* Fixed DOF: { 0 }
*
- * Values
+ * Initial values
* 0: 0.9
* 3: 0.5
+ * tRef = 0.4
+ * Rate of change of values
+ * 1: -0.4
+ * 3: 0.2
*/
#include "DirichletPointsDataMultiTri3.hh"
@@ -39,9 +47,12 @@
const int pylith::bc::DirichletPointsDataMultiTri3::_fixedDOFA[] = { 1 };
const int pylith::bc::DirichletPointsDataMultiTri3::_numConstrainedPtsA = 2;
const int pylith::bc::DirichletPointsDataMultiTri3::_constrainedPointsA[] = { 1, 3 };
-const double pylith::bc::DirichletPointsDataMultiTri3::_valuesA[] = { 0.3, 0.7 };
+
const char* pylith::bc::DirichletPointsDataMultiTri3::_dbFilenameA =
"data/tri3.spatialdb";
+const char* pylith::bc::DirichletPointsDataMultiTri3::_dbFilenameARate =
+ "data/tri3_rate.spatialdb";
+const double pylith::bc::DirichletPointsDataMultiTri3::_tRefA = 3.2;
const int pylith::bc::DirichletPointsDataMultiTri3::_idB = 1;
const char* pylith::bc::DirichletPointsDataMultiTri3::_labelB = "bc2";
@@ -49,9 +60,12 @@
const int pylith::bc::DirichletPointsDataMultiTri3::_fixedDOFB[] = { 0 };
const int pylith::bc::DirichletPointsDataMultiTri3::_numConstrainedPtsB = 1;
const int pylith::bc::DirichletPointsDataMultiTri3::_constrainedPointsB[] = { 0, 3 };
-const double pylith::bc::DirichletPointsDataMultiTri3::_valuesB[] = { 0.9, 0.5 };
+
const char* pylith::bc::DirichletPointsDataMultiTri3::_dbFilenameB =
"data/tri3_b.spatialdb";
+const char* pylith::bc::DirichletPointsDataMultiTri3::_dbFilenameBRate =
+ "data/tri3_b_rate.spatialdb";
+const double pylith::bc::DirichletPointsDataMultiTri3::_tRefB = 0.4;
const int pylith::bc::DirichletPointsDataMultiTri3::_constraintSizes[] = {
1,
@@ -66,11 +80,12 @@
0, 1
};
+// Values at t=10.0
const double pylith::bc::DirichletPointsDataMultiTri3::_field[] = {
- 0.9, 0.0,
- 0.0, 0.3,
+ -2.94, 0.0,
+ 0.0, 1.66,
0.0, 0.0,
- 0.5, 0.7
+ 2.42, 6.14
};
const char* pylith::bc::DirichletPointsDataMultiTri3::_meshFilename =
@@ -86,8 +101,10 @@
fixedDOFA = const_cast<int*>(_fixedDOFA);
numConstrainedPtsA = _numConstrainedPtsA;
constrainedPointsA = const_cast<int*>(_constrainedPointsA);
- valuesA = const_cast<double*>(_valuesA);
+
dbFilenameA = const_cast<char*>(_dbFilenameA);
+ dbFilenameARate = const_cast<char*>(_dbFilenameARate);
+ tRefA = _tRefA;
idB = _idA;
labelB = const_cast<char*>(_labelB);
@@ -95,8 +112,10 @@
fixedDOFB = const_cast<int*>(_fixedDOFB);
numConstrainedPtsB = _numConstrainedPtsB;
constrainedPointsB = const_cast<int*>(_constrainedPointsB);
- valuesB = const_cast<double*>(_valuesB);
+
dbFilenameB = const_cast<char*>(_dbFilenameB);
+ dbFilenameBRate = const_cast<char*>(_dbFilenameBRate);
+ tRefB = _tRefB;
field = const_cast<double*>(_field);
constraintSizes = const_cast<int*>(_constraintSizes);
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataMultiTri3.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -44,8 +44,9 @@
static const char* _labelA; /// Label for boundary condition group
static const int _fixedDOFA[]; ///< Degrees of freedom constrained at points
static const int _constrainedPointsA[]; ///< Array of indices of constrained pts.
- static const double _valuesA[]; ///< Values at constrained points.
- static const char* _dbFilenameA; ///< Filename of simple spatial database.
+ static const char* _dbFilenameA; ///< Filename for db of initial values.
+ static const char* _dbFilenameARate; ///< Filename for db of rate of change.
+ static const double _tRefA; ///< Reference time for rate of change.
static const int _numFixedDOFB; ///< Number of fixedDOF at constrained points.
static const int _numConstrainedPtsB; ///< Number of points constrained.
@@ -53,8 +54,9 @@
static const char* _labelB; /// Label for boundary condition group
static const int _fixedDOFB[]; ///< Degrees of freedom constrained at points
static const int _constrainedPointsB[]; ///< Array of indices of constrained pts.
- static const double _valuesB[]; ///< Values at constrained points.
- static const char* _dbFilenameB; ///< Filename of simple spatial database.
+ static const char* _dbFilenameB; ///< Filename for db of initial values.
+ static const char* _dbFilenameBRate; ///< Filename for db of rate of change.
+ static const double _tRefB; ///< Reference time for rate of change.
static const double _field[]; ///< Values in field
static const int _constraintSizes[]; ///< Number of constrained DOF at each vertex
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -20,6 +20,8 @@
* 0: 0.1, 0.6
* 1: 0.5, 0.3
* 4: 0.4, 0.2
+ * tRef = 3.0
+ * Rate of change = -0.5
*/
#include "DirichletPointsDataQuad4.hh"
@@ -34,7 +36,10 @@
const int pylith::bc::DirichletPointsDataQuad4::_numConstrainedPts = 3;
const int pylith::bc::DirichletPointsDataQuad4::_constrainedPoints[] = { 0, 1, 4 };
-const double pylith::bc::DirichletPointsDataQuad4::_values[] =
+
+const double pylith::bc::DirichletPointsDataQuad4::_tRef = 3.0;
+const double pylith::bc::DirichletPointsDataQuad4::_valueRate = -0.5;
+const double pylith::bc::DirichletPointsDataQuad4::_valuesInitial[] =
{ 0.1, 0.6, 0.5, 0.3, 0.4, 0.2 };
const char* pylith::bc::DirichletPointsDataQuad4::_meshFilename =
@@ -53,8 +58,11 @@
numConstrainedPts = _numConstrainedPts;
constrainedPoints = const_cast<int*>(_constrainedPoints);
- values = const_cast<double*>(_values);
+ tRef = _tRef;
+ valueRate = _valueRate;
+ valuesInitial = const_cast<double*>(_valuesInitial);
+
meshFilename = const_cast<char*>(_meshFilename);
dbFilename = const_cast<char*>(_dbFilename);
} // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataQuad4.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -47,7 +47,9 @@
static const int _fixedDOF[]; ///< Degrees of freedom constrained at points
static const int _constrainedPoints[]; ///< Array of indices of constrained pts.
- static const double _values[]; ///< Values at constrained points.
+ static const double _tRef; ///< Reference time for rate of change of value
+ static const double _valueRate; ///< Rate of change of values.
+ static const double _valuesInitial[]; ///< Initial values.
static const char* _meshFilename; ///< Filename of input mesh.
static const char* _dbFilename; ///< Filename of simple spatial database.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -18,6 +18,8 @@
*
* Values
* 2: 0.7, 0.2
+ * tRef = 1.2
+ * Rate of change = 4.0
*/
#include "DirichletPointsDataTet4.hh"
@@ -32,8 +34,13 @@
const int pylith::bc::DirichletPointsDataTet4::_numConstrainedPts = 1;
const int pylith::bc::DirichletPointsDataTet4::_constrainedPoints[] = { 2 };
-const double pylith::bc::DirichletPointsDataTet4::_values[] = { 0.7, 0.2 };
+
+const double pylith::bc::DirichletPointsDataTet4::_tRef = 1.2;
+const double pylith::bc::DirichletPointsDataTet4::_valueRate = 4.0;
+const double pylith::bc::DirichletPointsDataTet4::_valuesInitial[] =
+ { 0.7, 0.2 };
+
const char* pylith::bc::DirichletPointsDataTet4::_meshFilename =
"data/tet4.mesh";
const char* pylith::bc::DirichletPointsDataTet4::_dbFilename =
@@ -50,8 +57,11 @@
numConstrainedPts = _numConstrainedPts;
constrainedPoints = const_cast<int*>(_constrainedPoints);
- values = const_cast<double*>(_values);
+ tRef = _tRef;
+ valueRate = _valueRate;
+ valuesInitial = const_cast<double*>(_valuesInitial);
+
meshFilename = const_cast<char*>(_meshFilename);
dbFilename = const_cast<char*>(_dbFilename);
} // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTet4.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -47,7 +47,9 @@
static const int _fixedDOF[]; ///< Degrees of freedom constrained at points
static const int _constrainedPoints[]; ///< Array of indices of constrained pts.
- static const double _values[]; ///< Values at constrained points.
+ static const double _tRef; ///< Reference time for rate of change of value
+ static const double _valueRate; ///< Rate of change of values.
+ static const double _valuesInitial[]; ///< Initial values.
static const char* _meshFilename; ///< Filename of input mesh.
static const char* _dbFilename; ///< Filename of simple spatial database.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.cc 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.cc 2008-01-29 19:11:47 UTC (rev 9174)
@@ -19,6 +19,8 @@
* Values
* 1: 0.3
* 3: 0.7
+ * tRef = 0.7
+ * Rate of change = -0.2
*/
#include "DirichletPointsDataTri3.hh"
@@ -33,8 +35,12 @@
const int pylith::bc::DirichletPointsDataTri3::_numConstrainedPts = 2;
const int pylith::bc::DirichletPointsDataTri3::_constrainedPoints[] = { 1, 3 };
-const double pylith::bc::DirichletPointsDataTri3::_values[] = { 0.3, 0.7 };
+const double pylith::bc::DirichletPointsDataTri3::_tRef = 0.7;
+const double pylith::bc::DirichletPointsDataTri3::_valueRate = -0.2;
+const double pylith::bc::DirichletPointsDataTri3::_valuesInitial[] =
+ { 0.3, 0.7 };
+
const char* pylith::bc::DirichletPointsDataTri3::_meshFilename =
"data/tri3.mesh";
const char* pylith::bc::DirichletPointsDataTri3::_dbFilename =
@@ -51,8 +57,11 @@
numConstrainedPts = _numConstrainedPts;
constrainedPoints = const_cast<int*>(_constrainedPoints);
- values = const_cast<double*>(_values);
+ tRef = _tRef;
+ valueRate = _valueRate;
+ valuesInitial = const_cast<double*>(_valuesInitial);
+
meshFilename = const_cast<char*>(_meshFilename);
dbFilename = const_cast<char*>(_dbFilename);
} // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.hh 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/DirichletPointsDataTri3.hh 2008-01-29 19:11:47 UTC (rev 9174)
@@ -47,7 +47,9 @@
static const int _fixedDOF[]; ///< Degrees of freedom constrained at points
static const int _constrainedPoints[]; ///< Array of indices of constrained pts.
- static const double _values[]; ///< Values at constrained points.
+ static const double _tRef; ///< Reference time for rate of change of value
+ static const double _valueRate; ///< Rate of change of values.
+ static const double _valuesInitial[]; ///< Initial values.
static const char* _meshFilename; ///< Filename of input mesh.
static const char* _dbFilename; ///< Filename of simple spatial database.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/data/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/Makefile.am 2008-01-29 19:03:22 UTC (rev 9173)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/Makefile.am 2008-01-29 19:11:47 UTC (rev 9174)
@@ -17,7 +17,9 @@
elasticstrain1d.spatialdb \
tri3.mesh \
tri3.spatialdb \
+ tri3_rate.spatialdb \
tri3_b.spatialdb \
+ tri3_b_rate.spatialdb \
tri3-tractions.spatialdb \
elasticplanestrain.spatialdb \
quad4.mesh \
Added: short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_b_rate.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_b_rate.spatialdb (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_b_rate.spatialdb 2008-01-29 19:11:47 UTC (rev 9174)
@@ -0,0 +1,15 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 1
+ value-names = dof-0
+ value-units = m
+ num-locs = 2
+ data-dim = 1
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 2
+ }
+}
+-1.0 0.0 -0.4
+ 1.0 0.0 0.2
Added: short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_rate.spatialdb
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_rate.spatialdb (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/data/tri3_rate.spatialdb 2008-01-29 19:11:47 UTC (rev 9174)
@@ -0,0 +1,15 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 1
+ value-names = dof-1
+ value-units = m
+ num-locs = 2
+ data-dim = 1
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 2
+ }
+}
+ 0.0 -1.0 0.2
+ 1.0 0.0 0.8
More information about the cig-commits
mailing list