[cig-commits] r21706 - short/3D/PyLith/trunk/unittests/libtests/bc
brad at geodynamics.org
brad at geodynamics.org
Wed Apr 3 12:31:25 PDT 2013
Author: brad
Date: 2013-04-03 12:31:24 -0700 (Wed, 03 Apr 2013)
New Revision: 21706
Added:
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.hh
Removed:
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.hh
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.hh
Modified:
short/3D/PyLith/trunk/unittests/libtests/bc/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryCondition.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryConditionPoints.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBC.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMulti.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundary.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependent.cc
short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependentPoints.cc
Log:
Code cleanup. Consolidate test cases into single file per unit test suite.
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/Makefile.am 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/Makefile.am 2013-04-03 19:31:24 UTC (rev 21706)
@@ -32,43 +32,19 @@
TestTimeDependent.cc \
TestTimeDependentPoints.cc \
TestBoundaryMesh.cc \
- TestBoundaryMeshTri3.cc \
- TestBoundaryMeshQuad4.cc \
- TestBoundaryMeshTet4.cc \
- TestBoundaryMeshHex8.cc \
+ TestBoundaryMeshCases.cc \
TestAbsorbingDampers.cc \
- TestAbsorbingDampersLine2.cc \
- TestAbsorbingDampersTri3.cc \
- TestAbsorbingDampersQuad4.cc \
- TestAbsorbingDampersTet4.cc \
- TestAbsorbingDampersHex8.cc \
+ TestAbsorbingDampersCases.cc \
TestDirichletBC.cc \
- TestDirichletBCLine2.cc \
- TestDirichletBCLine2b.cc \
- TestDirichletBCTri3.cc \
- TestDirichletBCQuad4.cc \
- TestDirichletBCTet4.cc \
- TestDirichletBCHex8.cc \
+ TestDirichletBCCases.cc \
TestDirichletBCMulti.cc \
- TestDirichletBCMultiTri3.cc \
- TestDirichletBCMultiTet4.cc \
+ TestDirichletBCMultiCases.cc \
TestDirichletBoundary.cc \
- TestDirichletBoundaryTri3.cc \
- TestDirichletBoundaryQuad4.cc \
- TestDirichletBoundaryTet4.cc \
- TestDirichletBoundaryHex8.cc \
+ TestDirichletBoundaryCases.cc \
TestNeumann.cc \
- TestNeumannLine2.cc \
- TestNeumannTri3.cc \
- TestNeumannQuad4.cc \
- TestNeumannTet4.cc \
- TestNeumannHex8.cc \
+ TestNeumannCases.cc \
TestPointForce.cc \
- TestPointForceLine2.cc \
- TestPointForceTri3.cc \
- TestPointForceQuad4.cc \
- TestPointForceTet4.cc \
- TestPointForceHex8.cc \
+ TestPointForceCases.cc \
test_bc.cc
@@ -78,43 +54,19 @@
TestTimeDependent.hh \
TestTimeDependentPoints.hh \
TestBoundaryMesh.hh \
- TestBoundaryMeshTri3.hh \
- TestBoundaryMeshQuad4.hh \
- TestBoundaryMeshTet4.hh \
- TestBoundaryMeshHex8.hh \
+ TestBoundaryMeshCases.hh \
TestAbsorbingDampers.hh \
- TestAbsorbingDampersLine2.hh \
- TestAbsorbingDampersTri3.hh \
- TestAbsorbingDampersQuad4.hh \
- TestAbsorbingDampersTet4.hh \
- TestAbsorbingDampersHex8.hh \
+ TestAbsorbingDampersCases.hh \
TestDirichletBC.hh \
- TestDirichletBCLine2.hh \
- TestDirichletBCLine2b.hh \
- TestDirichletBCTri3.hh \
- TestDirichletBCQuad4.hh \
- TestDirichletBCTet4.hh \
- TestDirichletBCHex8.hh \
+ TestDirichletBCCases.hh \
TestDirichletBCMulti.hh \
- TestDirichletBCMultiTri3.hh \
- TestDirichletBCMultiTet4.hh \
+ TestDirichletBCMultiCases.hh \
TestDirichletBoundary.hh \
- TestDirichletBoundaryTri3.hh \
- TestDirichletBoundaryQuad4.hh \
- TestDirichletBoundaryTet4.hh \
- TestDirichletBoundaryHex8.hh \
+ TestDirichletBoundaryCases.hh \
TestNeumann.hh \
- TestNeumannLine2.hh \
- TestNeumannTri3.hh \
- TestNeumannQuad4.hh \
- TestNeumannTet4.hh \
- TestNeumannHex8.hh \
+ TestNeumannCases.hh \
TestPointForce.hh \
- TestPointForceLine2.hh \
- TestPointForceTri3.hh \
- TestPointForceQuad4.hh \
- TestPointForceTet4.hh \
- TestPointForceHex8.hh
+ TestPointForceCases.hh
# Source files associated with testing data
testbc_SOURCES += \
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampers.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -28,9 +28,11 @@
#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
#include "pylith/topology/SubMesh.hh" // USES SubMesh
#include "pylith/topology/Fields.hh" // USES Fields
-#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
#include "pylith/topology/Jacobian.hh" // USES Jacobian
+#include "pylith/topology/Stratum.hh" // USES Stratum
+#include "pylith/topology/VisitorMesh.hh" // USES VecVisitorMesh
+#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
#include "spatialdata/spatialdb/SimpleDB.hh" // USES SimpleDB
@@ -44,9 +46,13 @@
void
pylith::bc::TestAbsorbingDampers::setUp(void)
{ // setUp
+ PYLITH_METHOD_BEGIN;
+
_data = 0;
_quadrature = new feassemble::Quadrature<topology::SubMesh>();
CPPUNIT_ASSERT(_quadrature);
+
+ PYLITH_METHOD_END;
} // setUp
// ----------------------------------------------------------------------
@@ -54,8 +60,12 @@
void
pylith::bc::TestAbsorbingDampers::tearDown(void)
{ // tearDown
+ PYLITH_METHOD_BEGIN;
+
delete _data; _data = 0;
delete _quadrature; _quadrature = 0;
+
+ PYLITH_METHOD_END;
} // tearDown
// ----------------------------------------------------------------------
@@ -63,7 +73,11 @@
void
pylith::bc::TestAbsorbingDampers::testConstructor(void)
{ // testConstructor
+ PYLITH_METHOD_BEGIN;
+
AbsorbingDampers bc;
+
+ PYLITH_METHOD_END;
} // testConstructor
// ----------------------------------------------------------------------
@@ -71,6 +85,8 @@
void
pylith::bc::TestAbsorbingDampers::testDB(void)
{ // testDB
+ PYLITH_METHOD_BEGIN;
+
const std::string& label = "my db";
spatialdata::spatialdb::SimpleDB db(label.c_str());
AbsorbingDampers bc;
@@ -78,6 +94,8 @@
CPPUNIT_ASSERT(bc._db);
CPPUNIT_ASSERT_EQUAL(label, std::string(bc._db->label()));
+
+ PYLITH_METHOD_END;
} // testDB
// ----------------------------------------------------------------------
@@ -85,6 +103,8 @@
void
pylith::bc::TestAbsorbingDampers::testInitialize(void)
{ // testInitialize
+ PYLITH_METHOD_BEGIN;
+
topology::Mesh mesh;
AbsorbingDampers bc;
topology::SolutionFields fields(mesh);
@@ -93,27 +113,30 @@
CPPUNIT_ASSERT(_data);
const topology::SubMesh& boundaryMesh = *bc._boundaryMesh;
- PetscDM subMesh = boundaryMesh.dmMesh();
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
- // Check boundary mesh
- CPPUNIT_ASSERT(subMesh);
+ PetscDM subMesh = boundaryMesh.dmMesh();CPPUNIT_ASSERT(subMesh);
- err = DMPlexGetHeightStratum(subMesh, 1, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(subMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
+ // Cells
+ topology::Stratum cellsStratum(subMesh, topology::Stratum::HEIGHT, 1);
+ const PetscInt cStart = cellsStratum.begin();
+ const PetscInt cEnd = cellsStratum.end();
+ const PetscInt numCells = cellsStratum.size();
+ // Vertices
+ topology::Stratum verticesStratum(subMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+ const PetscInt numVertices = verticesStratum.size();
+
const int cellDim = boundaryMesh.dimension();
const int numCorners = _data->numCorners;
const int spaceDim = _data->spaceDim;
- const int numVertices = vEnd-vStart;
- const int numCells = cEnd-cStart;
- //const int boundaryDepth = submesh->depth()-1; // depth of boundary cells
CPPUNIT_ASSERT_EQUAL(_data->cellDim, cellDim);
CPPUNIT_ASSERT_EQUAL(_data->numVertices, numVertices);
CPPUNIT_ASSERT_EQUAL(_data->numCells, numCells);
+ PetscErrorCode err = 0;
PetscInt dp = 0;
for(PetscInt c = cStart; c < cEnd; ++c) {
PetscInt *closure = NULL;
@@ -134,32 +157,25 @@
} // for
// Check damping constants
+ CPPUNIT_ASSERT(bc._parameters);
+ topology::VecVisitorMesh dampingConstsVisitor(bc._parameters->get("damping constants"));
+ const PetscScalar* dampingConstsArray = dampingConstsVisitor.localArray();
+
const int numQuadPts = _data->numQuadPts;
const int fiberDim = numQuadPts * spaceDim;
- PetscInt index = 0;
- CPPUNIT_ASSERT(bc._parameters);
- PetscSection dampingConstsSection = bc._parameters->get("damping constants").petscSection();
- PetscVec dampingConstsVec = bc._parameters->get("damping constants").localVector();
- CPPUNIT_ASSERT(dampingConstsSection);CPPUNIT_ASSERT(dampingConstsVec);
-
- const PylithScalar tolerance = 1.0e-06;
const PylithScalar* dampingConstsE = _data->dampingConsts;
const PylithScalar dampingConstsScale = _data->densityScale * _data->lengthScale / _data->timeScale;
- PetscScalar* dampingConstsArray;
- err = VecGetArray(dampingConstsVec, &dampingConstsArray);CHECK_PETSC_ERROR(err);
- for(PetscInt c = cStart; c < cEnd; ++c) {
- PetscInt dof, off;
-
- err = PetscSectionGetDof(dampingConstsSection, c, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(dampingConstsSection, c, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(fiberDim, dof);
+ const PylithScalar tolerance = 1.0e-06;
+ for(PetscInt c = cStart, index=0; c < cEnd; ++c) {
+ const PetscInt off = dampingConstsVisitor.sectionOffset(c);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, dampingConstsVisitor.sectionDof(c));
for(PetscInt iQuad=0; iQuad < numQuadPts; ++iQuad)
- for(PetscInt iDim =0; iDim < spaceDim; ++iDim) {
+ for(PetscInt iDim =0; iDim < spaceDim; ++iDim, ++index) {
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, dampingConstsArray[off+iQuad*spaceDim+iDim]/dampingConstsE[index]*dampingConstsScale, tolerance);
- ++index;
} // for
} // for
- err = VecRestoreArray(dampingConstsVec, &dampingConstsArray);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testInitialize
// ----------------------------------------------------------------------
@@ -167,6 +183,8 @@
void
pylith::bc::TestAbsorbingDampers::testIntegrateResidual(void)
{ // testIntegrateResidual
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_data);
topology::Mesh mesh;
@@ -213,6 +231,8 @@
else
CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[i]/residualScale, vals[i], tolerance);
err = VecRestoreArray(residualVec, &vals);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testIntegrateResidual
// ----------------------------------------------------------------------
@@ -220,6 +240,8 @@
void
pylith::bc::TestAbsorbingDampers::testIntegrateJacobian(void)
{ // testIntegrateJacobian
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_data);
topology::Mesh mesh;
@@ -228,7 +250,7 @@
_initialize(&mesh, &bc, &fields);
const topology::SubMesh& boundaryMesh = *bc._boundaryMesh;
- PetscDM subMesh = boundaryMesh.dmMesh();
+ PetscDM subMesh = boundaryMesh.dmMesh();CPPUNIT_ASSERT(subMesh);
topology::Field<topology::Mesh>& solution = fields.solution();
topology::Jacobian jacobian(solution);
@@ -238,28 +260,28 @@
CPPUNIT_ASSERT_EQUAL(false, bc.needNewJacobian());
jacobian.assemble("final_assembly");
- PetscDM dmMesh = mesh.dmMesh();
- PetscInt vStart, vEnd;
- PetscErrorCode err = 0;
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+ const PetscInt totalNumVertices = verticesStratum.size();
- CPPUNIT_ASSERT(dmMesh);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
const PylithScalar* valsE = _data->valsJacobian;
const PylithScalar dampingConstsScale = _data->densityScale * _data->lengthScale / _data->timeScale;
const PylithScalar jacobianScale = dampingConstsScale*pow(_data->lengthScale, _data->spaceDim-1);
- const int totalNumVertices = vEnd - vStart;
const int nrowsE = totalNumVertices * _data->spaceDim;
const int ncolsE = totalNumVertices * _data->spaceDim;
- const PetscMat jacobianMat = jacobian.matrix();
+ const PetscMat jacobianMat = jacobian.matrix();CPPUNIT_ASSERT(jacobianMat);
int nrows = 0;
int ncols = 0;
+ PetscErrorCode err = 0;
err = MatGetSize(jacobianMat, &nrows, &ncols);CHECK_PETSC_ERROR(err);
CPPUNIT_ASSERT_EQUAL(nrowsE, nrows);
CPPUNIT_ASSERT_EQUAL(ncolsE, ncols);
PetscMat jDense;
- err = MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);CHECK_PETSC_ERROR(err);
+ err = MatConvert(jacobianMat, MATSEQDENSE, MAT_INITIAL_MATRIX, &jDense);CHECK_PETSC_ERROR(err);CPPUNIT_ASSERT(jDense);
scalar_array vals(nrows*ncols);
int_array rows(nrows);
@@ -287,6 +309,8 @@
CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[index]/jacobianScale, vals[index], tolerance);
} // for
err = MatDestroy(&jDense);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testIntegrateJacobian
// ----------------------------------------------------------------------
@@ -294,6 +318,8 @@
void
pylith::bc::TestAbsorbingDampers::testIntegrateJacobianLumped(void)
{ // testIntegrateJacobianLumped
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_data);
topology::Mesh mesh;
@@ -308,22 +334,20 @@
jacobian.allocate();
const topology::SubMesh& boundaryMesh = *bc._boundaryMesh;
- PetscDM subMesh = boundaryMesh.dmMesh();
- CPPUNIT_ASSERT(subMesh);
+ PetscDM subMesh = boundaryMesh.dmMesh();CPPUNIT_ASSERT(subMesh);
const PylithScalar t = 1.0;
bc.integrateJacobian(&jacobian, t, &fields);
CPPUNIT_ASSERT_EQUAL(false, bc.needNewJacobian());
jacobian.complete();
- PetscDM dmMesh = mesh.dmMesh();
- PetscInt vStart, vEnd;
- PetscErrorCode err = 0;
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+ const PetscInt totalNumVertices = verticesStratum.size();
- CPPUNIT_ASSERT(dmMesh);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
const PylithScalar* valsMatrixE = _data->valsJacobian;
- const int totalNumVertices = vEnd - vStart;
const int sizeE = totalNumVertices * _data->spaceDim;
scalar_array valsE(sizeE);
const PylithScalar dampingConstsScale = _data->densityScale * _data->lengthScale / _data->timeScale;
@@ -350,22 +374,21 @@
} // for
#endif // DEBUGGING
- PetscSection jacobianSection = jacobian.petscSection();
- PetscVec jacobianVec = jacobian.localVector();
- PetscScalar *vals;
- PetscInt size;
+ topology::VecVisitorMesh jacobianVisitor(jacobian);
+ const PetscScalar* jacobianArray = jacobianVisitor.localArray();
+ const PylithScalar tolerance = 1.0e-06;
+ for(int v = vStart, index=0; v < vEnd; ++v) {
+ const PetscInt off = jacobianVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, jacobianVisitor.sectionDof(v));
+ for (int iDim=0; iDim < spaceDim; ++iDim, ++index) {
+ if (fabs(valsE[index]) > 1.0)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, jacobianArray[off+iDim]/valsE[index]*jacobianScale, tolerance);
+ else
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[index]/jacobianScale, jacobianArray[off+iDim], tolerance);
+ } // for
+ } // for
- CPPUNIT_ASSERT(jacobianSection);CPPUNIT_ASSERT(jacobianVec);
- err = PetscSectionGetStorageSize(jacobianSection, &size);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(sizeE, size);
- const PylithScalar tolerance = 1.0e-06;
- err = VecGetArray(jacobianVec, &vals);CHECK_PETSC_ERROR(err);
- for(int i = 0; i < size; ++i)
- if (fabs(valsE[i]) > 1.0)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[i]/valsE[i]*jacobianScale, tolerance);
- else
- CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[i]/jacobianScale, vals[i], tolerance);
- err = VecRestoreArray(jacobianVec, &vals);CHECK_PETSC_ERROR(err);
+ PYLITH_METHOD_END;
} // testIntegrateJacobianLumped
// ----------------------------------------------------------------------
@@ -374,6 +397,8 @@
AbsorbingDampers* const bc,
topology::SolutionFields* fields) const
{ // _initialize
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(mesh);
CPPUNIT_ASSERT(bc);
CPPUNIT_ASSERT(fields);
@@ -449,56 +474,53 @@
const int totalNumVertices = vEnd - vStart;
const int fieldSize = _data->spaceDim * totalNumVertices;
- PetscSection dispTIncrSection = fields->get("dispIncr(t->t+dt)").petscSection();
- PetscVec dispTIncrVec = fields->get("dispIncr(t->t+dt)").localVector();
- PetscSection dispTSection = fields->get("disp(t)").petscSection();
- PetscVec dispTVec = fields->get("disp(t)").localVector();
- PetscSection dispTmdtSection = fields->get("disp(t-dt)").petscSection();
- PetscVec dispTmdtVec = fields->get("disp(t-dt)").localVector();
- PetscSection velSection = fields->get("velocity(t)").petscSection();
- PetscVec velVec = fields->get("velocity(t)").localVector();
- PetscScalar *dispTIncrArray, *dispTArray, *dispTmdtArray, *velArray;
+
+ topology::VecVisitorMesh dispTIncrVisitor(fields->get("dispIncr(t->t+dt)"));
+ PetscScalar* dispTIncrArray = dispTIncrVisitor.localArray();
+
+ topology::VecVisitorMesh dispTVisitor(fields->get("disp(t)"));
+ PetscScalar* dispTArray = dispTVisitor.localArray();
+
+ topology::VecVisitorMesh dispTmdtVisitor(fields->get("disp(t-dt)"));
+ PetscScalar* dispTmdtArray = dispTmdtVisitor.localArray();
+
+ topology::VecVisitorMesh velocityVisitor(fields->get("velocity(t)"));
+ PetscScalar* velocityArray = velocityVisitor.localArray();
+
const int spaceDim = _data->spaceDim;
const PylithScalar dt = _data->dt;
- CPPUNIT_ASSERT(dispTIncrSection);CPPUNIT_ASSERT(dispTIncrVec);
- CPPUNIT_ASSERT(dispTSection);CPPUNIT_ASSERT(dispTVec);
- CPPUNIT_ASSERT(dispTmdtSection);CPPUNIT_ASSERT(dispTmdtVec);
- CPPUNIT_ASSERT(velSection);CPPUNIT_ASSERT(velVec);
- err = VecGetArray(dispTIncrVec, &dispTIncrArray);CHECK_PETSC_ERROR(err);
- err = VecGetArray(dispTVec, &dispTArray);CHECK_PETSC_ERROR(err);
- err = VecGetArray(dispTmdtVec, &dispTmdtArray);CHECK_PETSC_ERROR(err);
- err = VecGetArray(velVec, &velArray);CHECK_PETSC_ERROR(err);
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, off;
+ const PetscInt doff = v-vStart;
- err = PetscSectionGetDof(dispTIncrSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(dispTIncrSection, v, &off);CHECK_PETSC_ERROR(err);
- for(PetscInt d = 0; d < dof; ++d) {
- dispTIncrArray[off+d] = _data->fieldTIncr[(v - vStart)*spaceDim+d];
- }
- err = PetscSectionGetDof(dispTSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(dispTSection, v, &off);CHECK_PETSC_ERROR(err);
- for(PetscInt d = 0; d < dof; ++d) {
- dispTIncrArray[off+d] = _data->fieldT[(v - vStart)*spaceDim+d];
- }
- err = PetscSectionGetDof(dispTmdtSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(dispTmdtSection, v, &off);CHECK_PETSC_ERROR(err);
- for(PetscInt d = 0; d < dof; ++d) {
- dispTIncrArray[off+d] = _data->fieldTmdt[(v - vStart)*spaceDim+d];
- }
- err = PetscSectionGetDof(velSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(velSection, v, &off);CHECK_PETSC_ERROR(err);
- for(PetscInt d = 0; d < dof; ++d) {
- velArray[off+d] = (_data->fieldTIncr[(v - vStart)*spaceDim+d] +
- _data->fieldT[(v - vStart)*spaceDim+d] -
- _data->fieldTmdt[(v - vStart)*spaceDim+d]) / (2*dt);
- }
+ PetscInt off = dispTIncrVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, dispTIncrVisitor.sectionDof(v));
+ for(PetscInt d = 0; d < spaceDim; ++d) {
+ dispTIncrArray[off+d] = _data->fieldTIncr[doff*spaceDim+d];
+ } // for
+
+ off = dispTVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, dispTVisitor.sectionDof(v));
+ for(PetscInt d = 0; d < spaceDim; ++d) {
+ dispTArray[off+d] = _data->fieldT[doff*spaceDim+d];
+ } // for
+
+ off = dispTmdtVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, dispTmdtVisitor.sectionDof(v));
+ for(PetscInt d = 0; d < spaceDim; ++d) {
+ dispTmdtArray[off+d] = _data->fieldTmdt[doff*spaceDim+d];
+ } // for
+
+ off = velocityVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, velocityVisitor.sectionDof(v));
+ for(PetscInt d = 0; d < spaceDim; ++d) {
+ velocityArray[off+d] = (_data->fieldTIncr[doff*spaceDim+d] +
+ _data->fieldT[doff*spaceDim+d] -
+ _data->fieldTmdt[doff*spaceDim+d]) / (2*dt);
+ } // for
} // for
- err = VecRestoreArray(dispTIncrVec, &dispTIncrArray);CHECK_PETSC_ERROR(err);
- err = VecRestoreArray(dispTVec, &dispTArray);CHECK_PETSC_ERROR(err);
- err = VecRestoreArray(dispTmdtVec, &dispTmdtArray);CHECK_PETSC_ERROR(err);
- err = VecRestoreArray(velVec, &velArray);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // _initialize
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestAbsorbingDampersCases.hh" // Implementation of cases
+
+#include "pylith/topology/SubMesh.hh" // USES SubMesh
+#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersLine2 );
+
+#include "data/AbsorbingDampersDataLine2.hh" // USES AbsorbingDampersDataLine2
+#include "pylith/feassemble/GeometryPoint1D.hh" // USES GeometryPoint0D
+
+// Setup testing data.
+void
+pylith::bc::TestAbsorbingDampersLine2::setUp(void)
+{ // setUp
+ TestAbsorbingDampers::setUp();
+ _data = new AbsorbingDampersDataLine2();
+ feassemble::GeometryPoint1D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersTri3 );
+
+#include "data/AbsorbingDampersDataTri3.hh" // USES AbsorbingDampersDataTri3
+#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
+
+// Setup testing data.
+void
+pylith::bc::TestAbsorbingDampersTri3::setUp(void)
+{ // setUp
+ TestAbsorbingDampers::setUp();
+ _data = new AbsorbingDampersDataTri3();
+ feassemble::GeometryLine2D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersQuad4 );
+
+#include "data/AbsorbingDampersDataQuad4.hh" // USES AbsorbingDampersDataQuad4
+#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
+
+// Setup testing data.
+void
+pylith::bc::TestAbsorbingDampersQuad4::setUp(void)
+{ // setUp
+ TestAbsorbingDampers::setUp();
+ _data = new AbsorbingDampersDataQuad4();
+ feassemble::GeometryLine2D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersTet4 );
+
+#include "data/AbsorbingDampersDataTet4.hh" // USES AbsorbingDampersDataTet4
+#include "pylith/feassemble/GeometryTri3D.hh" // USES GeometryTri3D
+
+// Setup testing data.
+void
+pylith::bc::TestAbsorbingDampersTet4::setUp(void)
+{ // setUp
+ TestAbsorbingDampers::setUp();
+ _data = new AbsorbingDampersDataTet4();
+ feassemble::GeometryTri3D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersHex8 );
+
+#include "data/AbsorbingDampersDataHex8.hh" // USES AbsorbingDampersDataHex8
+#include "pylith/feassemble/GeometryQuad3D.hh" // USES GeometryQuad3D
+
+// Setup testing data.
+void
+pylith::bc::TestAbsorbingDampersHex8::setUp(void)
+{ // setUp
+ TestAbsorbingDampers::setUp();
+ _data = new AbsorbingDampersDataHex8();
+ feassemble::GeometryQuad3D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersCases.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,155 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/bc/TestAbsorbingDampersCases.hh
+ *
+ * @brief C++ TestAbsorbingDampers object.
+ *
+ * Test cases for C++ unit testing for AbsorbingDampers.
+ */
+
+#if !defined(pylith_bc_testabsorbingdamperscases_hh)
+#define pylith_bc_testabsorbingdamperscases_hh
+
+#include "TestAbsorbingDampers.hh" // ISA TestAbsorbingDampers
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace bc {
+ class TestAbsorbingDampersLine2;
+ class TestAbsorbingDampersTri3;
+ class TestAbsorbingDampersQuad4;
+ class TestAbsorbingDampersTet4;
+ class TestAbsorbingDampersHex8;
+ } // bc
+} // pylith
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for AbsorbingDampers for mesh with 1-D line cells.
+class pylith::bc::TestAbsorbingDampersLine2 : public TestAbsorbingDampers
+{ // class TestAbsorbingDampers
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersLine2, TestAbsorbingDampers );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testIntegrateJacobian );
+ CPPUNIT_TEST( testIntegrateJacobianLumped );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestAbsorbingDampersLine2
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for AbsorbingDampers for mesh with 2-D tri cells.
+class pylith::bc::TestAbsorbingDampersTri3 : public TestAbsorbingDampers
+{ // class TestAbsorbingDampers
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersTri3, TestAbsorbingDampers );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testIntegrateJacobian );
+ CPPUNIT_TEST( testIntegrateJacobianLumped );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestAbsorbingDampersTri3
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for AbsorbingDampers for mesh with 2-D quad cells.
+class pylith::bc::TestAbsorbingDampersQuad4 : public TestAbsorbingDampers
+{ // class TestAbsorbingDampers
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersQuad4, TestAbsorbingDampers );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testIntegrateJacobian );
+ CPPUNIT_TEST( testIntegrateJacobianLumped );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestAbsorbingDampersQuad4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for AbsorbingDampers for mesh with 3-D tet cells.
+class pylith::bc::TestAbsorbingDampersTet4 : public TestAbsorbingDampers
+{ // class TestAbsorbingDampers
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersTet4, TestAbsorbingDampers );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testIntegrateJacobian );
+ CPPUNIT_TEST( testIntegrateJacobianLumped );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestAbsorbingDampersTet4
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for AbsorbingDampers for mesh with 3-D hex cells.
+class pylith::bc::TestAbsorbingDampersHex8 : public TestAbsorbingDampers
+{ // class TestAbsorbingDampers
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersHex8, TestAbsorbingDampers );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testIntegrateJacobian );
+ CPPUNIT_TEST( testIntegrateJacobianLumped );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestAbsorbingDampersHex8
+
+#endif // pylith_bc_absorbingdamperscases_hh
+
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestAbsorbingDampersHex8.hh" // Implementation of class methods
-
-#include "data/AbsorbingDampersDataHex8.hh" // USES AbsorbingDampersDataHex8
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryQuad3D.hh" // USES GeometryQuad3D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersHex8 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestAbsorbingDampersHex8::setUp(void)
-{ // setUp
- TestAbsorbingDampers::setUp();
- _data = new AbsorbingDampersDataHex8();
- feassemble::GeometryQuad3D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersHex8.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,64 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestAbsorbingDampersHex8.hh
- *
- * @brief C++ TestAbsorbingDampers object.
- *
- * C++ unit testing for AbsorbingDampers for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testabsorbingdampershex8_hh)
-#define pylith_bc_testabsorbingdampershex8_hh
-
-#include "TestAbsorbingDampers.hh" // ISA TestAbsorbingDampers
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestAbsorbingDampersHex8;
- } // bc
-} // pylith
-
-/// C++ unit testing for AbsorbingDampers for mesh with 2-D tri cells.
-class pylith::bc::TestAbsorbingDampersHex8 : public TestAbsorbingDampers
-{ // class TestAbsorbingDampers
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersHex8, TestAbsorbingDampers );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testIntegrateJacobian );
- CPPUNIT_TEST( testIntegrateJacobianLumped );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestAbsorbingDampersHex8
-
-#endif // pylith_bc_absorbingdampershex8_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestAbsorbingDampersLine2.hh" // Implementation of class methods
-
-#include "data/AbsorbingDampersDataLine2.hh" // USES AbsorbingDampersDataLine2
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryPoint1D.hh" // USES GeometryPoint0D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersLine2 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestAbsorbingDampersLine2::setUp(void)
-{ // setUp
- TestAbsorbingDampers::setUp();
- _data = new AbsorbingDampersDataLine2();
- feassemble::GeometryPoint1D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersLine2.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestAbsorbingDampersLine2.hh
- *
- * @brief C++ TestAbsorbingDampers object.
- *
- * C++ unit testing for AbsorbingDampers for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testabsorbingdampersline2_hh)
-#define pylith_bc_testabsorbingdampersline2_hh
-
-#include "TestAbsorbingDampers.hh" // ISA TestAbsorbingDampers
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestAbsorbingDampersLine2;
- } // bc
-} // pylith
-
-/// C++ unit testing for AbsorbingDampers for mesh with 1-D line cells.
-class pylith::bc::TestAbsorbingDampersLine2 : public TestAbsorbingDampers
-{ // class TestAbsorbingDampers
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersLine2, TestAbsorbingDampers );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testIntegrateJacobian );
- CPPUNIT_TEST( testIntegrateJacobianLumped );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestAbsorbingDampersLine2
-
-#endif // pylith_bc_absorbingdampersline2_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestAbsorbingDampersQuad4.hh" // Implementation of class methods
-
-#include "data/AbsorbingDampersDataQuad4.hh" // USES AbsorbingDampersDataQuad4
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersQuad4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestAbsorbingDampersQuad4::setUp(void)
-{ // setUp
- TestAbsorbingDampers::setUp();
- _data = new AbsorbingDampersDataQuad4();
- feassemble::GeometryLine2D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersQuad4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestAbsorbingDampersQuad4.hh
- *
- * @brief C++ TestAbsorbingDampers object.
- *
- * C++ unit testing for AbsorbingDampers for mesh with 2-D quad cells.
- */
-
-#if !defined(pylith_bc_testabsorbingdampersquad4_hh)
-#define pylith_bc_testabsorbingdampersquad4_hh
-
-#include "TestAbsorbingDampers.hh" // ISA TestAbsorbingDampers
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestAbsorbingDampersQuad4;
- } // bc
-} // pylith
-
-/// C++ unit testing for AbsorbingDampers for mesh with 2-D quad cells.
-class pylith::bc::TestAbsorbingDampersQuad4 : public TestAbsorbingDampers
-{ // class TestAbsorbingDampers
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersQuad4, TestAbsorbingDampers );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testIntegrateJacobian );
- CPPUNIT_TEST( testIntegrateJacobianLumped );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestAbsorbingDampersQuad4
-
-#endif // pylith_bc_absorbingdampersquad4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestAbsorbingDampersTet4.hh" // Implementation of class methods
-
-#include "data/AbsorbingDampersDataTet4.hh" // USES AbsorbingDampersDataTet4
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryTri3D.hh" // USES GeometryTri3D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersTet4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestAbsorbingDampersTet4::setUp(void)
-{ // setUp
- TestAbsorbingDampers::setUp();
- _data = new AbsorbingDampersDataTet4();
- feassemble::GeometryTri3D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTet4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestAbsorbingDampersTet4.hh
- *
- * @brief C++ TestAbsorbingDampers object.
- *
- * C++ unit testing for AbsorbingDampers for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testabsorbingdamperstet4_hh)
-#define pylith_bc_testabsorbingdamperstet4_hh
-
-#include "TestAbsorbingDampers.hh" // ISA TestAbsorbingDampers
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestAbsorbingDampersTet4;
- } // bc
-} // pylith
-
-/// C++ unit testing for AbsorbingDampers for mesh with 2-D tri cells.
-class pylith::bc::TestAbsorbingDampersTet4 : public TestAbsorbingDampers
-{ // class TestAbsorbingDampers
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersTet4, TestAbsorbingDampers );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testIntegrateJacobian );
- CPPUNIT_TEST( testIntegrateJacobianLumped );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestAbsorbingDampersTet4
-
-#endif // pylith_bc_absorbingdamperstet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestAbsorbingDampersTri3.hh" // Implementation of class methods
-
-#include "data/AbsorbingDampersDataTri3.hh" // USES AbsorbingDampersDataTri3
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestAbsorbingDampersTri3 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestAbsorbingDampersTri3::setUp(void)
-{ // setUp
- TestAbsorbingDampers::setUp();
- _data = new AbsorbingDampersDataTri3();
- feassemble::GeometryLine2D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestAbsorbingDampersTri3.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestAbsorbingDampersTri3.hh
- *
- * @brief C++ TestAbsorbingDampers object.
- *
- * C++ unit testing for AbsorbingDampers for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testabsorbingdamperstri3_hh)
-#define pylith_bc_testabsorbingdamperstri3_hh
-
-#include "TestAbsorbingDampers.hh" // ISA TestAbsorbingDampers
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestAbsorbingDampersTri3;
- } // bc
-} // pylith
-
-/// C++ unit testing for AbsorbingDampers for mesh with 2-D tri cells.
-class pylith::bc::TestAbsorbingDampersTri3 : public TestAbsorbingDampers
-{ // class TestAbsorbingDampers
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestAbsorbingDampersTri3, TestAbsorbingDampers );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testIntegrateJacobian );
- CPPUNIT_TEST( testIntegrateJacobianLumped );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestAbsorbingDampersTri3
-
-#endif // pylith_bc_absorbingdamperstri3_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryCondition.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryCondition.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryCondition.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -22,6 +22,8 @@
#include "pylith/bc/DirichletBC.hh" // USES DirichletBC
+#include "pylith/utils/petscerror.h" // USES PYLITH_METHOD_BEGIN
+
#include <string> // USES std::string
// ----------------------------------------------------------------------
@@ -32,11 +34,15 @@
void
pylith::bc::TestBoundaryCondition::testLabel(void)
{ // testLabel
+ PYLITH_METHOD_BEGIN;
+
const std::string& label = "the_database";
DirichletBC bc;
bc.label(label.c_str());
CPPUNIT_ASSERT_EQUAL(label, std::string(bc.label()));
+
+ PYLITH_METHOD_END;
} // testLabel
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryConditionPoints.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryConditionPoints.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryConditionPoints.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -38,6 +38,8 @@
void
pylith::bc::TestBoundaryConditionPoints::testGetPoints(void)
{ // testGetPoints
+ PYLITH_METHOD_BEGIN;
+
topology::Mesh mesh;
PointForce bc;
PointForceDataTri3 data;
@@ -66,6 +68,8 @@
CPPUNIT_ASSERT_EQUAL(numPoints, bc._points.size());
for (int i=0; i < numPoints; ++i)
CPPUNIT_ASSERT_EQUAL(data.forcePoints[i]+offset, bc._points[i]);
+
+ PYLITH_METHOD_END;
} // testGetPoints
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -23,7 +23,10 @@
#include "data/BoundaryMeshData.hh" // USES BoundaryMeshData
#include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/topology/Field.hh" // USES Field
#include "pylith/topology/SubMesh.hh" // USES SubMesh
+#include "pylith/topology/Stratum.hh" // USES Stratum
+#include "pylith/topology/VisitorSubMesh.hh" // USES SubMeshIS
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "pylith/faults/FaultCohesiveKin.hh" // USES FaultsCohesiveKin
@@ -34,7 +37,11 @@
void
pylith::bc::TestBoundaryMesh::setUp(void)
{ // setUp
+ PYLITH_METHOD_BEGIN;
+
_data = 0;
+
+ PYLITH_METHOD_END;
} // setUp
// ----------------------------------------------------------------------
@@ -42,7 +49,11 @@
void
pylith::bc::TestBoundaryMesh::tearDown(void)
{ // tearDown
+ PYLITH_METHOD_BEGIN;
+
delete _data; _data = 0;
+
+ PYLITH_METHOD_END;
} // tearDown
// ----------------------------------------------------------------------
@@ -50,11 +61,11 @@
void
pylith::bc::TestBoundaryMesh::testSubmesh(void)
{ // testSubmesh
- CPPUNIT_ASSERT(0 != _data);
+ PYLITH_METHOD_BEGIN;
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
- PetscErrorCode err;
-
meshio::MeshIOAscii iohandler;
iohandler.filename(_data->filename);
iohandler.read(&mesh);
@@ -69,27 +80,25 @@
// Create submesh
topology::SubMesh submesh(mesh, _data->bcLabel);
- DM dmMesh = submesh.dmMesh();
- CPPUNIT_ASSERT(dmMesh);
+ PetscDM dmMesh = submesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
// Check vertices
- IS subpointIS;
- const PetscInt *subpointMap;
- PetscInt vStart, vEnd;
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+ CPPUNIT_ASSERT_EQUAL(_data->numVerticesNoFault, verticesStratum.size());
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(_data->numVerticesNoFault, vEnd-vStart);
- err = DMPlexCreateSubpointIS(dmMesh, &subpointIS);CHECK_PETSC_ERROR(err);
- err = ISGetIndices(subpointIS, &subpointMap);CHECK_PETSC_ERROR(err);
+ topology::SubMeshIS subpointIS(submesh);
+ const PetscInt* subpointMap = subpointIS.points();CPPUNIT_ASSERT(subpointMap);
for (PetscInt v = vStart; v < vEnd; ++v)
CPPUNIT_ASSERT_EQUAL(_data->verticesNoFault[v-vStart], subpointMap[v]);
// Check cells
- PetscInt cStart, cEnd;
-
- err = DMPlexGetHeightStratum(dmMesh, 1, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(_data->numCells, cEnd-cStart);
-
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 1);
+ const PetscInt cStart = cellsStratum.begin();
+ const PetscInt cEnd = cellsStratum.end();
+ CPPUNIT_ASSERT_EQUAL(_data->numCells, cellsStratum.size());
+ PetscErrorCode err = 0;
for (PetscInt c = cStart, index = 0; c < cEnd; ++c) {
PetscInt *closure = NULL;
PetscInt closureSize, numVertices = 0;
@@ -97,14 +106,14 @@
err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);CHECK_PETSC_ERROR(err);
for (PetscInt p = 0; p < closureSize*2; p += 2) {
if ((closure[p] >= vStart) && (closure[p] < vEnd)) closure[numVertices++] = closure[p];
- }
+ } // for
CPPUNIT_ASSERT_EQUAL(_data->numCorners, numVertices);
for (PetscInt v = 0; v < numVertices; ++v, ++index)
CPPUNIT_ASSERT_EQUAL(_data->cellsNoFault[index], subpointMap[closure[v]]);
err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);CHECK_PETSC_ERROR(err);
} // for
- err = ISRestoreIndices(subpointIS, &subpointMap);CHECK_PETSC_ERROR(err);
- err = ISDestroy(&subpointIS);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testSubmesh
// ----------------------------------------------------------------------
@@ -112,7 +121,9 @@
void
pylith::bc::TestBoundaryMesh::testSubmeshFault(void)
{ // testSubmeshFault
- CPPUNIT_ASSERT(0 != _data);
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
PetscErrorCode err;
topology::Mesh mesh;
@@ -141,26 +152,25 @@
// Create submesh
topology::SubMesh submesh(mesh, _data->bcLabel);
- DM dmMesh = submesh.dmMesh();
- CPPUNIT_ASSERT(dmMesh);
+ PetscDM dmMesh = submesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
// Check vertices
- IS subpointIS;
- const PetscInt *subpointMap;
- PetscInt vStart, vEnd;
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+ CPPUNIT_ASSERT_EQUAL(_data->numVerticesFault, verticesStratum.size());
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(_data->numVerticesFault, vEnd-vStart);
- err = DMPlexCreateSubpointIS(dmMesh, &subpointIS);CHECK_PETSC_ERROR(err);
- err = ISGetIndices(subpointIS, &subpointMap);CHECK_PETSC_ERROR(err);
+ topology::SubMeshIS subpointIS(submesh);
+ const PetscInt *subpointMap = subpointIS.points();CPPUNIT_ASSERT(subpointMap);
for (PetscInt v = vStart; v < vEnd; ++v)
CPPUNIT_ASSERT_EQUAL(_data->verticesFault[v-vStart], subpointMap[v]);
+
// Check cells
- PetscInt cStart, cEnd;
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 1);
+ const PetscInt cStart = cellsStratum.begin();
+ const PetscInt cEnd = cellsStratum.end();
+ CPPUNIT_ASSERT_EQUAL(_data->numCells, cellsStratum.size());
- err = DMPlexGetHeightStratum(dmMesh, 1, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(_data->numCells, cEnd-cStart);
-
for (PetscInt c = cStart, index = 0; c < cEnd; ++c) {
PetscInt *closure = NULL;
PetscInt closureSize, numVertices = 0;
@@ -168,14 +178,14 @@
err = DMPlexGetTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);CHECK_PETSC_ERROR(err);
for (PetscInt p = 0; p < closureSize*2; p += 2) {
if ((closure[p] >= vStart) && (closure[p] < vEnd)) closure[numVertices++] = closure[p];
- }
+ } // for
CPPUNIT_ASSERT_EQUAL(_data->numCorners, numVertices);
for (PetscInt v = 0; v < numVertices; ++v, ++index)
CPPUNIT_ASSERT_EQUAL(_data->cellsFault[index], subpointMap[closure[v]]);
err = DMPlexRestoreTransitiveClosure(dmMesh, c, PETSC_TRUE, &closureSize, &closure);CHECK_PETSC_ERROR(err);
} // for
- err = ISRestoreIndices(subpointIS, &subpointMap);CHECK_PETSC_ERROR(err);
- err = ISDestroy(&subpointIS);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testSubmeshFault
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,81 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestBoundaryMeshCases.hh" // Implementation of cases
+
+#include "pylith/faults/CohesiveTopology.hh"
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshTri3 );
+
+#include "data/BoundaryMeshDataTri3.hh" // USES BoundaryMeshDataTri3
+
+// Setup testing data.
+void
+pylith::bc::TestBoundaryMeshTri3::setUp(void)
+{ // setUp
+ _data = new BoundaryMeshDataTri3();
+ _flipFault = true;
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshQuad4 );
+
+#include "data/BoundaryMeshDataQuad4.hh" // USES BoundaryMeshDataQuad4
+
+// Setup testing data.
+void
+pylith::bc::TestBoundaryMeshQuad4::setUp(void)
+{ // setUp
+ _data = new BoundaryMeshDataQuad4();
+ _flipFault = true;
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshTet4 );
+
+#include "data/BoundaryMeshDataTet4.hh" // USES BoundaryMeshDataTet4
+
+// Setup testing data.
+void
+pylith::bc::TestBoundaryMeshTet4::setUp(void)
+{ // setUp
+ _data = new BoundaryMeshDataTet4();
+ _flipFault = false;
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshHex8 );
+
+#include "data/BoundaryMeshDataHex8.hh" // USES BoundaryMeshDataHex8
+
+// Setup testing data.
+void
+pylith::bc::TestBoundaryMeshHex8::setUp(void)
+{ // setUp
+ _data = new BoundaryMeshDataHex8();
+ _flipFault = true;
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshCases.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,133 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/bc/TestBoundaryMeshTri3.hh
+ *
+ * @brief C++ TestBoundaryMesh object.
+ *
+ * Test cases for C++ unit testing of submesh().
+ */
+
+#if !defined(pylith_bc_testboundarymeshcases_hh)
+#define pylith_bc_testboundarymeshcases_hh
+
+#include "TestBoundaryMesh.hh" // ISA TestBoundaryMesh
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace bc {
+ class TestBoundaryMeshTri3;
+ class TestBoundaryMeshQuad4;
+ class TestBoundaryMeshTet4;
+ class TestBoundaryMeshHex8;
+ } // bc
+} // pylith
+
+// ----------------------------------------------------------------------
+/// C++ unit testing of submesh() for mesh with 2-D tri cells.
+class pylith::bc::TestBoundaryMeshTri3 : public TestBoundaryMesh
+{ // class TestBoundaryMesh
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE(TestBoundaryMeshTri3);
+
+ CPPUNIT_TEST( testSubmesh );
+ CPPUNIT_TEST( testSubmeshFault );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestBoundaryMeshTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing of submesh() for mesh with 2-D quad cells.
+class pylith::bc::TestBoundaryMeshQuad4 : public TestBoundaryMesh
+{ // class TestBoundaryMesh
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE(TestBoundaryMeshQuad4);
+
+ CPPUNIT_TEST( testSubmesh );
+ CPPUNIT_TEST( testSubmeshFault );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestBoundaryMeshQuad4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing of submesh() for mesh with 3-D tet cells.
+class pylith::bc::TestBoundaryMeshTet4 : public TestBoundaryMesh
+{ // class TestBoundaryMesh
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE(TestBoundaryMeshTet4);
+
+ CPPUNIT_TEST( testSubmesh );
+ CPPUNIT_TEST( testSubmeshFault );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestBoundaryMeshTet4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing of submesh() for mesh with 3-D hex cells.
+class pylith::bc::TestBoundaryMeshHex8 : public TestBoundaryMesh
+{ // class TestBoundaryMesh
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE(TestBoundaryMeshHex8);
+
+ CPPUNIT_TEST( testSubmesh );
+ CPPUNIT_TEST( testSubmeshFault );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestBoundaryMeshHex8
+
+
+#endif // pylith_bc_boundarymeshcases_hh
+
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,38 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestBoundaryMeshHex8.hh" // Implementation of class methods
-
-#include "data/BoundaryMeshDataHex8.hh" // USES BoundaryMeshDataHex8
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshHex8 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestBoundaryMeshHex8::setUp(void)
-{ // setUp
- _data = new BoundaryMeshDataHex8();
- _flipFault = true;
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshHex8.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestBoundaryMeshHex8.hh
- *
- * @brief C++ TestBoundaryMesh object.
- *
- * C++ unit testing of submesh() for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testboundarymeshhex8_hh)
-#define pylith_bc_testboundarymeshhex8_hh
-
-#include "TestBoundaryMesh.hh" // ISA TestBoundaryMesh
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestBoundaryMeshHex8;
- } // bc
-} // pylith
-
-/// C++ unit testing of submesh() for mesh with 2-D tri cells.
-class pylith::bc::TestBoundaryMeshHex8 : public TestBoundaryMesh
-{ // class TestBoundaryMesh
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE(TestBoundaryMeshHex8);
-
- CPPUNIT_TEST( testSubmesh );
- CPPUNIT_TEST( testSubmeshFault );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestBoundaryMeshHex8
-
-#endif // pylith_bc_boundarymeshhex8_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,38 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestBoundaryMeshQuad4.hh" // Implementation of class methods
-
-#include "data/BoundaryMeshDataQuad4.hh" // USES BoundaryMeshDataQuad4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshQuad4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestBoundaryMeshQuad4::setUp(void)
-{ // setUp
- _data = new BoundaryMeshDataQuad4();
- _flipFault = true;
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshQuad4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestBoundaryMeshQuad4.hh
- *
- * @brief C++ TestBoundaryMesh object.
- *
- * C++ unit testing of submesh() for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testboundarymeshquad4_hh)
-#define pylith_bc_testboundarymeshquad4_hh
-
-#include "TestBoundaryMesh.hh" // ISA TestBoundaryMesh
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestBoundaryMeshQuad4;
- } // bc
-} // pylith
-
-/// C++ unit testing of submesh() for mesh with 2-D tri cells.
-class pylith::bc::TestBoundaryMeshQuad4 : public TestBoundaryMesh
-{ // class TestBoundaryMesh
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE(TestBoundaryMeshQuad4);
-
- CPPUNIT_TEST( testSubmesh );
- CPPUNIT_TEST( testSubmeshFault );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestBoundaryMeshQuad4
-
-#endif // pylith_bc_boundarymeshquad4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,38 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestBoundaryMeshTet4.hh" // Implementation of class methods
-
-#include "data/BoundaryMeshDataTet4.hh" // USES BoundaryMeshDataTet4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshTet4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestBoundaryMeshTet4::setUp(void)
-{ // setUp
- _data = new BoundaryMeshDataTet4();
- _flipFault = false;
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTet4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestBoundaryMeshTet4.hh
- *
- * @brief C++ TestBoundaryMesh object.
- *
- * C++ unit testing of submesh() for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testboundarymeshtet4_hh)
-#define pylith_bc_testboundarymeshtet4_hh
-
-#include "TestBoundaryMesh.hh" // ISA TestBoundaryMesh
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestBoundaryMeshTet4;
- } // bc
-} // pylith
-
-/// C++ unit testing of submesh() for mesh with 2-D tri cells.
-class pylith::bc::TestBoundaryMeshTet4 : public TestBoundaryMesh
-{ // class TestBoundaryMesh
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE(TestBoundaryMeshTet4);
-
- CPPUNIT_TEST( testSubmesh );
- CPPUNIT_TEST( testSubmeshFault );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestBoundaryMeshTet4
-
-#endif // pylith_bc_boundarymeshtet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,40 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestBoundaryMeshTri3.hh" // Implementation of class methods
-
-#include "data/BoundaryMeshDataTri3.hh" // USES BoundaryMeshDataTri3
-
-#include "pylith/faults/CohesiveTopology.hh"
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestBoundaryMeshTri3 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestBoundaryMeshTri3::setUp(void)
-{ // setUp
- _data = new BoundaryMeshDataTri3();
- _flipFault = true;
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMeshTri3.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestBoundaryMeshTri3.hh
- *
- * @brief C++ TestBoundaryMesh object.
- *
- * C++ unit testing of submesh() for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testboundarymeshtri3_hh)
-#define pylith_bc_testboundarymeshtri3_hh
-
-#include "TestBoundaryMesh.hh" // ISA TestBoundaryMesh
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestBoundaryMeshTri3;
- } // bc
-} // pylith
-
-/// C++ unit testing of submesh() for mesh with 2-D tri cells.
-class pylith::bc::TestBoundaryMeshTri3 : public TestBoundaryMesh
-{ // class TestBoundaryMesh
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE(TestBoundaryMeshTri3);
-
- CPPUNIT_TEST( testSubmesh );
- CPPUNIT_TEST( testSubmeshFault );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestBoundaryMeshTri3
-
-#endif // pylith_bc_boundarymeshtri3_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBC.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBC.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBC.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -28,6 +28,7 @@
#include "pylith/topology/Field.hh" // USES Field
#include "pylith/topology/Fields.hh" // USES Fields
#include "pylith/topology/Stratum.hh" // USES Stratum
+#include "pylith/topology/VisitorMesh.hh" // USES VisitorMesh
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
@@ -43,7 +44,11 @@
void
pylith::bc::TestDirichletBC::setUp(void)
{ // setUp
+ PYLITH_METHOD_BEGIN;
+
_data = 0;
+
+ PYLITH_METHOD_END;
} // setUp
// ----------------------------------------------------------------------
@@ -51,7 +56,11 @@
void
pylith::bc::TestDirichletBC::tearDown(void)
{ // tearDown
+ PYLITH_METHOD_BEGIN;
+
delete _data; _data = 0;
+
+ PYLITH_METHOD_END;
} // tearDown
// ----------------------------------------------------------------------
@@ -59,7 +68,11 @@
void
pylith::bc::TestDirichletBC::testConstructor(void)
{ // testConstructor
+ PYLITH_METHOD_BEGIN;
+
DirichletBC bc;
+
+ PYLITH_METHOD_END;
} // testConstructor
// ----------------------------------------------------------------------
@@ -67,6 +80,8 @@
void
pylith::bc::TestDirichletBC::testInitialize(void)
{ // testInitialize
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_data);
topology::Mesh mesh;
@@ -90,48 +105,38 @@
if (numFixedDOF > 0) {
// Check values
- CPPUNIT_ASSERT(0 != bc._parameters);
- PetscSection initialSection = bc._parameters->get("initial").petscSection();
- PetscVec initialVec = bc._parameters->get("initial").localVector();
- PetscScalar* initialArray;
- PetscErrorCode err = 0;
- CPPUNIT_ASSERT(initialSection);CPPUNIT_ASSERT(initialVec);
+ CPPUNIT_ASSERT(bc._parameters);
+ topology::VecVisitorMesh initialVisitor(bc._parameters->get("initial"));
+ const PetscScalar* initialArray = initialVisitor.localArray();CPPUNIT_ASSERT(initialArray);
const PylithScalar tolerance = 1.0e-06;
const PylithScalar dispScale = _data->lengthScale;
const PylithScalar velocityScale = _data->lengthScale / _data->timeScale;
- err = VecGetArray(initialVec, &initialArray);CHECK_PETSC_ERROR(err);
for (int i=0; i < numPoints; ++i) {
const PetscInt p_value = _data->constrainedPoints[i]+offset;
- PetscInt dof, off;
- err = PetscSectionGetDof(initialSection, p_value, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(initialSection, p_value, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(numFixedDOF, dof);
+ const PetscInt off = initialVisitor.sectionOffset(p_value);
+ CPPUNIT_ASSERT_EQUAL(numFixedDOF, initialVisitor.sectionDof(p_value));
for(int iDOF = 0; iDOF < numFixedDOF; ++iDOF) {
CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->valuesInitial[i*numFixedDOF+iDOF]/dispScale, initialArray[off+iDOF], tolerance);
} // for
} // for
- err = VecRestoreArray(initialVec, &initialArray);CHECK_PETSC_ERROR(err);
// Check rate of change
- PetscSection rateSection = bc._parameters->get("rate").petscSection();
- PetscVec rateVec = bc._parameters->get("rate").localVector();
- PetscScalar *rateArray;
-
- err = VecGetArray(rateVec, &rateArray);CHECK_PETSC_ERROR(err);
+ topology::VecVisitorMesh rateVisitor(bc._parameters->get("rate"));
+ const PetscScalar* rateArray = rateVisitor.localArray();CPPUNIT_ASSERT(rateArray);
+
for (int i=0; i < numPoints; ++i) {
const PetscInt p_value = _data->constrainedPoints[i]+offset;
- PetscInt dof, off;
- err = PetscSectionGetDof(rateSection, p_value, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(rateSection, p_value, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(numFixedDOF, dof);
+ const PetscInt off = rateVisitor.sectionOffset(p_value);
+ CPPUNIT_ASSERT_EQUAL(numFixedDOF, rateVisitor.sectionDof(p_value));
for(int iDOF = 0; iDOF < numFixedDOF; ++iDOF)
CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->valueRate/velocityScale, rateArray[off+iDOF], tolerance);
} // for
- err = VecRestoreArray(rateVec, &rateArray);CHECK_PETSC_ERROR(err);
} // if
+
+ PYLITH_METHOD_END;
} // testInitialize
// ----------------------------------------------------------------------
@@ -139,12 +144,16 @@
void
pylith::bc::TestDirichletBC::testNumDimConstrained(void)
{ // testNumDimConstrained
+ PYLITH_METHOD_BEGIN;
+
topology::Mesh mesh;
DirichletBC bc;
_initialize(&mesh, &bc);
- CPPUNIT_ASSERT(0 != _data);
+ CPPUNIT_ASSERT(_data);
CPPUNIT_ASSERT_EQUAL(_data->numFixedDOF, bc.numDimConstrained());
+
+ PYLITH_METHOD_END;
} // testNumDimConstrained
// ----------------------------------------------------------------------
@@ -152,19 +161,14 @@
void
pylith::bc::TestDirichletBC::testSetConstraintSizes(void)
{ // testSetConstraintSizes
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bc;
_initialize(&mesh, &bc);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();
- CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int fiberDim = _data->numDOF;
const int spaceDim = mesh.dimension();
topology::Field<topology::Mesh> field(mesh);
@@ -175,13 +179,22 @@
bc.setConstraintSizes(field); // Does not handle fields right now
field.allocate();
- PetscSection fieldSection = field.petscSection();
- PetscVec fieldVec = field.localVector();
- CPPUNIT_ASSERT(fieldSection);CPPUNIT_ASSERT(fieldVec);
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- const PetscInt numCells = cEnd - cStart;
- const PetscInt offset = numCells;
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
+
+ PetscSection fieldSection = field.petscSection();CPPUNIT_ASSERT(fieldSection);
+ const PetscInt offset = numCells;
+
int iConstraint = 0;
+ PetscErrorCode err = 0;
for(PetscInt v = vStart; v < vEnd; ++v) {
PetscInt dof, cdof, fdof, fcdof;
@@ -198,10 +211,12 @@
CPPUNIT_ASSERT_EQUAL(_data->numDOF, dof);
CPPUNIT_ASSERT_EQUAL(_data->numFixedDOF, cdof);
CPPUNIT_ASSERT_EQUAL(_data->numDOF, fdof);
- //CPPUNIT_ASSERT_EQUAL(_data->numFixedDOF, fcdof);
+ CPPUNIT_ASSERT_EQUAL(_data->numFixedDOF, fcdof);
++iConstraint;
} // if/else
} // for
+
+ PYLITH_METHOD_END;
} // testSetConstraintSizes
// ----------------------------------------------------------------------
@@ -209,19 +224,14 @@
void
pylith::bc::TestDirichletBC::testSetConstraints(void)
{ // testSetConstraints
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bc;
_initialize(&mesh, &bc);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();
- CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int spaceDim = mesh.dimension();
const int fiberDim = _data->numDOF;
topology::Field<topology::Mesh> field(mesh);
@@ -233,13 +243,22 @@
field.allocate();
bc.setConstraints(field);
- PetscSection fieldSection = field.petscSection();
- PetscVec fieldVec = field.localVector();
- CPPUNIT_ASSERT(fieldSection);CPPUNIT_ASSERT(fieldVec);
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- const PetscInt numCells = cEnd - cStart;
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
+
+ PetscSection fieldSection = field.petscSection();CPPUNIT_ASSERT(fieldSection);
const PetscInt offset = numCells;
+
int iConstraint = 0;
+ PetscErrorCode err = 0;
for(PetscInt v = vStart; v < vEnd; ++v) {
const PetscInt *cInd, *fcInd;
PetscInt dof, cdof, fdof, fcdof;
@@ -256,14 +275,16 @@
} else {
if (_data->numFixedDOF) {CPPUNIT_ASSERT(cInd);}
CPPUNIT_ASSERT_EQUAL(_data->numFixedDOF, cdof);
- //CPPUNIT_ASSERT_EQUAL(_data->numFixedDOF, fcdof);
+ CPPUNIT_ASSERT_EQUAL(_data->numFixedDOF, fcdof);
for(PetscInt iDOF = 0; iDOF < _data->numFixedDOF; ++iDOF) {
CPPUNIT_ASSERT_EQUAL(_data->fixedDOF[iDOF], cInd[iDOF]);
- //CPPUNIT_ASSERT_EQUAL(_data->fixedDOF[iDOF], fcInd[iDOF]);
+ CPPUNIT_ASSERT_EQUAL(_data->fixedDOF[iDOF], fcInd[iDOF]);
}
++iConstraint;
} // if/else
} // for
+
+ PYLITH_METHOD_END;
} // testSetConstraints
// ----------------------------------------------------------------------
@@ -271,19 +292,14 @@
void
pylith::bc::TestDirichletBC::testSetField(void)
{ // testSetField
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bc;
_initialize(&mesh, &bc);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();
- CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int fiberDim = _data->numDOF;
topology::Field<topology::Mesh> field(mesh);
field.addField("bc", fiberDim);
@@ -294,27 +310,36 @@
field.allocate();
bc.setConstraints(field);
- PetscSection fieldSection = field.petscSection();
- PetscVec fieldVec = field.localVector();
- CPPUNIT_ASSERT(fieldSection);CPPUNIT_ASSERT(fieldVec);
+ // Scales
const PylithScalar tolerance = 1.0e-06;
const PylithScalar dispScale = _data->lengthScale;
const PylithScalar velocityScale = _data->lengthScale / _data->timeScale;
const PylithScalar timeScale = _data->timeScale;
// All values should be zero.
- PetscScalar *values;
field.zero();
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
+ const PetscInt offset = numCells;
+
+ topology::VecVisitorMesh fieldVisitor(field);
+ PetscScalar* fieldArray = fieldVisitor.localArray();
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, off;
-
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- for(int d = 0; d < dof; ++d)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+d], tolerance);
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, fieldVisitor.sectionDof(v));
+ for(int d = 0; d < fiberDim; ++d)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+d], tolerance);
} // for
- err = VecRestoreArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+ fieldVisitor.clear();
// Only unconstrained values should be zero.
const PylithScalar t = 1.0 / timeScale;
@@ -334,30 +359,26 @@
} // for
assert(index == numFreeDOF);
- const PetscInt numCells = cEnd - cStart;
- const PetscInt offset = numCells;
+ const PylithScalar tRef = _data->tRef / timeScale;
const PetscInt numFixedDOF = _data->numFixedDOF;
int iConstraint = 0;
- const PylithScalar tRef = _data->tRef / timeScale;
-
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+ fieldVisitor.initialize(field);
+ fieldArray = fieldVisitor.localArray();
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, cdof, off;
-
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetConstraintDof(fieldSection, v, &cdof);CHECK_PETSC_ERROR(err);
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ const PetscInt dof = fieldVisitor.sectionDof(v);
+ const PetscInt cdof = fieldVisitor.sectionConstraintDof(v);
if (v != _data->constrainedPoints[iConstraint] + offset) {
// unconstrained point
for(PetscInt d = 0; d < dof; ++d)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+d], tolerance);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+d], tolerance);
} else {
// constrained point
// check unconstrained DOF
for (int iDOF=0; iDOF < numFreeDOF; ++iDOF)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+freeDOF[iDOF]], tolerance);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+freeDOF[iDOF]], tolerance);
// check constrained DOF
for (int iDOF=0; iDOF < numFixedDOF; ++iDOF) {
@@ -365,12 +386,13 @@
const PylithScalar valueE = (t > tRef) ?
_data->valuesInitial[index]/dispScale + (t-tRef)*_data->valueRate/velocityScale :
_data->valuesInitial[index]/dispScale;
- CPPUNIT_ASSERT_DOUBLES_EQUAL(valueE, values[off+_data->fixedDOF[iDOF]], tolerance);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(valueE, fieldArray[off+_data->fixedDOF[iDOF]], tolerance);
} // for
++iConstraint;
} // if/else
} // for
- err = VecRestoreArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testSetField
// ----------------------------------------------------------------------
@@ -378,19 +400,14 @@
void
pylith::bc::TestDirichletBC::testSetFieldIncr(void)
{ // testSetFieldIncr
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bc;
_initialize(&mesh, &bc);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();
- CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int fiberDim = _data->numDOF;
topology::Field<topology::Mesh> field(mesh);
field.addField("bc", fiberDim);
@@ -401,28 +418,36 @@
field.allocate();
bc.setConstraints(field);
- PetscSection fieldSection = field.petscSection();
- PetscVec fieldVec = field.localVector();
- CPPUNIT_ASSERT(fieldSection);CPPUNIT_ASSERT(fieldVec);
+ // Scales
const PylithScalar tolerance = 1.0e-06;
const PylithScalar dispScale = _data->lengthScale;
const PylithScalar velocityScale = _data->lengthScale / _data->timeScale;
const PylithScalar timeScale = _data->timeScale;
// All values should be zero.
- PetscScalar *values;
+ field.zero();
- field.zero();
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
+ const PetscInt offset = numCells;
+
+ topology::VecVisitorMesh fieldVisitor(field);
+ PetscScalar* fieldArray = fieldVisitor.localArray();
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, off;
-
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- for(int d = 0; d < dof; ++d)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+d], tolerance);
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, fieldVisitor.sectionDof(v));
+ for(int d = 0; d < fiberDim; ++d)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+d], tolerance);
} // for
- err = VecRestoreArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+ fieldVisitor.clear();
// Only unconstrained values should be zero.
const PylithScalar t0 = 1.0 / timeScale;
@@ -443,40 +468,38 @@
} // for
assert(index == numFreeDOF);
- const PetscInt numCells = cEnd - cStart;
- const PetscInt offset = numCells;
+ const PylithScalar tRef = _data->tRef / timeScale;
const PetscInt numFixedDOF = _data->numFixedDOF;
int iConstraint = 0;
- const PylithScalar tRef = _data->tRef / timeScale;
-
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+ fieldVisitor.initialize(field);
+ fieldArray = fieldVisitor.localArray();
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, cdof, off;
-
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetConstraintDof(fieldSection, v, &cdof);CHECK_PETSC_ERROR(err);
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ const PetscInt dof = fieldVisitor.sectionDof(v);
+ const PetscInt cdof = fieldVisitor.sectionConstraintDof(v);
if (v != _data->constrainedPoints[iConstraint] + offset) {
// unconstrained point
for(PetscInt d = 0; d < dof; ++d)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+d], tolerance);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+d], tolerance);
} else {
// constrained point
// check unconstrained DOF
for (int iDOF=0; iDOF < numFreeDOF; ++iDOF)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+freeDOF[iDOF]], tolerance);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+freeDOF[iDOF]], tolerance);
// check constrained DOF
for (int iDOF=0; iDOF < numFixedDOF; ++iDOF) {
const PylithScalar valueE = (t0 > tRef) ? (t1-t0)*_data->valueRate/velocityScale :
(t1 > tRef) ? (t1-tRef)*_data->valueRate/velocityScale : 0.0;
- CPPUNIT_ASSERT_DOUBLES_EQUAL(valueE, values[off+_data->fixedDOF[iDOF]], tolerance);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(valueE, fieldArray[off+_data->fixedDOF[iDOF]], tolerance);
} // for
++iConstraint;
} // if/else
} // for
+
+ PYLITH_METHOD_END;
} // testSetFieldIncr
// ----------------------------------------------------------------------
@@ -484,9 +507,11 @@
pylith::bc::TestDirichletBC::_initialize(topology::Mesh* mesh,
DirichletBC* const bc) const
{ // _initialize
- CPPUNIT_ASSERT(0 != _data);
- CPPUNIT_ASSERT(0 != bc);
+ PYLITH_METHOD_BEGIN;
+ CPPUNIT_ASSERT(_data);
+ CPPUNIT_ASSERT(bc);
+
meshio::MeshIOAscii iohandler;
iohandler.filename(_data->meshFilename);
iohandler.read(mesh);
@@ -536,6 +561,8 @@
bc->bcDOF(_data->fixedDOF, _data->numFixedDOF);
bc->normalizer(normalizer);
bc->initialize(*mesh, upDir);
+
+ PYLITH_METHOD_END;
} // _initialize
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,101 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDirichletBCCases.hh" // Implementation of cases
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCLine2 );
+
+#include "data/DirichletDataLine2.hh" // USES DirichletDataLine2
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCLine2::setUp(void)
+{ // setUp
+ _data = new DirichletDataLine2();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCLine2b );
+
+#include "data/DirichletDataLine2b.hh" // USES DirichletDataLine2b
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCLine2b::setUp(void)
+{ // setUp
+ _data = new DirichletDataLine2b();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCTri3 );
+
+#include "data/DirichletDataTri3.hh" // USES DirichletDataTri3
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCTri3::setUp(void)
+{ // setUp
+ _data = new DirichletDataTri3();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCQuad4 );
+
+#include "data/DirichletDataQuad4.hh" // USES DirichletDataQuad4
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCQuad4::setUp(void)
+{ // setUp
+ _data = new DirichletDataQuad4();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCTet4 );
+
+#include "data/DirichletDataTet4.hh" // USES DirichletDataTet4
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCTet4::setUp(void)
+{ // setUp
+ _data = new DirichletDataTet4();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCHex8 );
+
+#include "data/DirichletDataHex8.hh" // USES DirichletDataHex8
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCHex8::setUp(void)
+{ // setUp
+ _data = new DirichletDataHex8();
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCCases.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,201 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/bc/TestDirichletBCCases.hh
+ *
+ * @brief C++ TestDirichletBC object.
+ *
+ * Test cases C++ unit testing for DirichletBC for mesh.
+ */
+
+#if !defined(pylith_bc_testdirichletbccases_hh)
+#define pylith_bc_testdirichletbccases_hh
+
+#include "TestDirichletBC.hh" // ISA TestDirichletBC
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace bc {
+ class TestDirichletBCLine2;
+ class TestDirichletBCLine2b;
+ class TestDirichletBCTri3;
+ class TestDirichletBCQuad4;
+ class TestDirichletBCTet4;
+ class TestDirichletBCHex8;
+ } // bc
+} // pylith
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 1-D line cells.
+class pylith::bc::TestDirichletBCLine2 : public TestDirichletBC
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBCLine2, TestDirichletBC );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testNumDimConstrained );
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+ CPPUNIT_TEST( testSetFieldIncr );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCLine2
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 1-D line cells.
+class pylith::bc::TestDirichletBCLine2b : public TestDirichletBC
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBCLine2b, TestDirichletBC );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testNumDimConstrained );
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCLine2b
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 2-D tri cells.
+class pylith::bc::TestDirichletBCTri3 : public TestDirichletBC
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBCTri3, TestDirichletBC );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testNumDimConstrained );
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+ CPPUNIT_TEST( testSetFieldIncr );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 2-D quad cells.
+class pylith::bc::TestDirichletBCQuad4 : public TestDirichletBC
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBCQuad4, TestDirichletBC );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testNumDimConstrained );
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+ CPPUNIT_TEST( testSetFieldIncr );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCQuad4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 3-D tet cells.
+class pylith::bc::TestDirichletBCTet4 : public TestDirichletBC
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBCTet4, TestDirichletBC );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testNumDimConstrained );
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+ CPPUNIT_TEST( testSetFieldIncr );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCTet4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 3-D hex cells.
+class pylith::bc::TestDirichletBCHex8 : public TestDirichletBC
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBCHex8, TestDirichletBC );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+ CPPUNIT_TEST( testSetFieldIncr );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCHex8
+
+
+#endif // pylith_bc_dirichletbccases_hh
+
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCHex8.hh" // Implementation of class methods
-
-#include "data/DirichletDataHex8.hh" // USES DirichletDataHex8
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCHex8 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCHex8::setUp(void)
-{ // setUp
- _data = new DirichletDataHex8();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCHex8.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,65 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCHex8.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbchex8_hh)
-#define pylith_bc_testdirichletbchex8_hh
-
-#include "TestDirichletBC.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCHex8;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 3-D hex cells.
-class pylith::bc::TestDirichletBCHex8 : public TestDirichletBC
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBCHex8, TestDirichletBC );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
- CPPUNIT_TEST( testSetFieldIncr );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCHex8
-
-#endif // pylith_bc_dirichletbchex8_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCLine2.hh" // Implementation of class methods
-
-#include "data/DirichletDataLine2.hh" // USES DirichletDataLine2
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCLine2 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCLine2::setUp(void)
-{ // setUp
- _data = new DirichletDataLine2();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCLine2.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbcline2_hh)
-#define pylith_bc_testdirichletbcline2_hh
-
-#include "TestDirichletBC.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCLine2;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 1-D line cells.
-class pylith::bc::TestDirichletBCLine2 : public TestDirichletBC
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBCLine2, TestDirichletBC );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testNumDimConstrained );
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
- CPPUNIT_TEST( testSetFieldIncr );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCLine2
-
-#endif // pylith_bc_dirichletbcline2_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCLine2b.hh" // Implementation of class methods
-
-#include "data/DirichletDataLine2b.hh" // USES DirichletDataLine2b
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCLine2b );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCLine2b::setUp(void)
-{ // setUp
- _data = new DirichletDataLine2b();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCLine2b.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,65 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCLine2b.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbcline2b_hh)
-#define pylith_bc_testdirichletbcline2b_hh
-
-#include "TestDirichletBC.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCLine2b;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 1-D line cells.
-class pylith::bc::TestDirichletBCLine2b : public TestDirichletBC
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBCLine2b, TestDirichletBC );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testNumDimConstrained );
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCLine2b
-
-#endif // pylith_bc_dirichletbcline2b_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMulti.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMulti.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMulti.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -26,6 +26,8 @@
#include "pylith/topology/Mesh.hh" // USES Mesh
#include "pylith/topology/Field.hh" // USES Field
+#include "pylith/topology/Stratum.hh" // USES Stratum
+#include "pylith/topology/VisitorMesh.hh" // USES VisitorMesh
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
@@ -37,7 +39,11 @@
void
pylith::bc::TestDirichletBCMulti::setUp(void)
{ // setUp
+ PYLITH_METHOD_BEGIN;
+
_data = 0;
+
+ PYLITH_METHOD_END;
} // setUp
// ----------------------------------------------------------------------
@@ -45,7 +51,11 @@
void
pylith::bc::TestDirichletBCMulti::tearDown(void)
{ // tearDown
+ PYLITH_METHOD_BEGIN;
+
delete _data; _data = 0;
+
+ PYLITH_METHOD_END;
} // tearDown
// ----------------------------------------------------------------------
@@ -53,20 +63,16 @@
void
pylith::bc::TestDirichletBCMulti::testSetConstraintSizes(void)
{ // testSetConstraintSizes
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bcA;
DirichletBC bcB;
DirichletBC bcC;
_initialize(&mesh, &bcA, &bcB, &bcC);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int fiberDim = _data->numDOF;
topology::Field<topology::Mesh> field(mesh);
field.addField("bc", fiberDim);
@@ -78,20 +84,29 @@
bcC.setConstraintSizes(field);
field.allocate();
- PetscSection fieldSection = field.petscSection();CPPUNIT_ASSERT(fieldSection);
- PetscVec fieldVec = field.localVector();CPPUNIT_ASSERT(fieldVec);
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- const PetscInt numCells = cEnd - cStart;
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
const PetscInt offset = numCells;
+
+ topology::VecVisitorMesh fieldVisitor(field);
+
int iConstraint = 0;
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, cdof;
-
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetConstraintDof(fieldSection, v, &cdof);CHECK_PETSC_ERROR(err);
+ const PetscInt dof = fieldVisitor.sectionDof(v);
+ const PetscInt cdof = fieldVisitor.sectionConstraintDof(v);
CPPUNIT_ASSERT_EQUAL(_data->numDOF, dof);
CPPUNIT_ASSERT_EQUAL(_data->constraintSizes[v-offset], cdof);
} // for
+
+ PYLITH_METHOD_END;
} // testSetConstraintSizes
// ----------------------------------------------------------------------
@@ -99,20 +114,16 @@
void
pylith::bc::TestDirichletBCMulti::testSetConstraints(void)
{ // testSetConstraints
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bcA;
DirichletBC bcB;
DirichletBC bcC;
_initialize(&mesh, &bcA, &bcB, &bcC);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int fiberDim = _data->numDOF;
topology::Field<topology::Mesh> field(mesh);
field.addField("bc", fiberDim);
@@ -127,11 +138,21 @@
bcB.setConstraints(field);
bcC.setConstraints(field);
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
+
PetscSection fieldSection = field.petscSection();CPPUNIT_ASSERT(fieldSection);
- PetscVec fieldVec = field.localVector();CPPUNIT_ASSERT(fieldVec);
+ const PetscInt offset = numCells;
- const PetscInt numCells = cEnd - cStart;
- const PetscInt offset = numCells;
+ PetscErrorCode err = 0;
int index = 0;
int iConstraint = 0;
for(PetscInt v = vStart; v < vEnd; ++v) {
@@ -148,6 +169,8 @@
CPPUNIT_ASSERT_EQUAL(_data->constrainedDOF[index++], cInd[iDOF]);
} // if
} // for
+
+ PYLITH_METHOD_END;
} // testSetConstraints
// ----------------------------------------------------------------------
@@ -155,20 +178,16 @@
void
pylith::bc::TestDirichletBCMulti::testSetField(void)
{ // testSetField
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bcA;
DirichletBC bcB;
DirichletBC bcC;
_initialize(&mesh, &bcA, &bcB, &bcC);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int fiberDim = _data->numDOF;
topology::Field<topology::Mesh> field(mesh);
field.addField("bc", fiberDim);
@@ -183,25 +202,35 @@
bcB.setConstraints(field);
bcC.setConstraints(field);
- PetscSection fieldSection = field.petscSection();CPPUNIT_ASSERT(fieldSection);
- PetscVec fieldVec = field.localVector();CPPUNIT_ASSERT(fieldVec);
-
+ // Scales
const PylithScalar tolerance = 1.0e-06;
const PylithScalar valueScale = _data->lengthScale;
// All values should be zero.
- PetscScalar *values;
field.zero();
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
+ const PetscInt offset = numCells;
+
+ topology::VecVisitorMesh fieldVisitor(field);
+ PetscScalar* fieldArray = fieldVisitor.localArray();
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, off;
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, fieldVisitor.sectionDof(v));
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- for(int d = 0; d < dof; ++d)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+d], tolerance);
+ for(int d = 0; d < fiberDim; ++d)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+d], tolerance);
} // for
- err = VecRestoreArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+ fieldVisitor.clear();
// Only unconstrained values should be zero.
// Expected values set in _data->field
@@ -210,17 +239,18 @@
bcB.setField(t, field);
bcC.setField(t, field);
+ fieldVisitor.initialize(field);
+ fieldArray = fieldVisitor.localArray();
int i = 0;
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, cdof, off;
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, fieldVisitor.sectionDof(v));
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- for(int iDOF = 0; iDOF < dof; ++iDOF)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->field[i++], values[off+iDOF]*valueScale, tolerance);
+ for(int iDOF = 0; iDOF < fiberDim; ++iDOF)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->field[i++], fieldArray[off+iDOF]*valueScale, tolerance);
} // for
- err = VecRestoreArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testSetField
// ----------------------------------------------------------------------
@@ -228,21 +258,16 @@
void
pylith::bc::TestDirichletBCMulti::testSetFieldIncr(void)
{ // testSetFieldIncr
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
DirichletBC bcA;
DirichletBC bcB;
DirichletBC bcC;
_initialize(&mesh, &bcA, &bcB, &bcC);
- CPPUNIT_ASSERT(0 != _data);
- PetscDM dmMesh = mesh.dmMesh();
- CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err;
-
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
-
const int fiberDim = _data->numDOF;
topology::Field<topology::Mesh> field(mesh);
field.addField("bc", fiberDim);
@@ -257,26 +282,35 @@
bcB.setConstraints(field);
bcC.setConstraints(field);
- PetscSection fieldSection = field.petscSection();
- PetscVec fieldVec = field.localVector();
- CPPUNIT_ASSERT(fieldSection);CPPUNIT_ASSERT(fieldVec);
-
+ // Scales
const PylithScalar tolerance = 1.0e-06;
const PylithScalar valueScale = _data->lengthScale;
// All values should be zero.
- PetscScalar *values;
field.zero();
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+
+ PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
+
+ // Vertices
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+
+ // Cells
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
+ const PetscInt offset = numCells;
+
+ topology::VecVisitorMesh fieldVisitor(field);
+ PetscScalar* fieldArray = fieldVisitor.localArray();
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, off;
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, fieldVisitor.sectionDof(v));
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- for(int d = 0; d < dof; ++d)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, values[off+d], tolerance);
+ for(int d = 0; d < fiberDim; ++d)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0, fieldArray[off+d], tolerance);
} // for
- err = VecRestoreArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+ fieldVisitor.clear();
// Only unconstrained values should be zero.
// Expected values set in _data->field
@@ -286,18 +320,18 @@
bcB.setFieldIncr(t0, t1, field);
bcC.setFieldIncr(t0, t1, field);
+ fieldVisitor.initialize(field);
+ fieldArray = fieldVisitor.localArray();
int i = 0;
- err = VecGetArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
for(PetscInt v = vStart; v < vEnd; ++v) {
- PetscInt dof, cdof, off;
+ const PetscInt off = fieldVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, fieldVisitor.sectionDof(v));
- err = PetscSectionGetDof(fieldSection, v, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, v, &off);CHECK_PETSC_ERROR(err);
- for(int iDOF = 0; iDOF < dof; ++iDOF) {
- CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->fieldIncr[i++], values[off+iDOF]*valueScale, tolerance);
- } // for
+ for(int iDOF = 0; iDOF < fiberDim; ++iDOF)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->fieldIncr[i++], fieldArray[off+iDOF]*valueScale, tolerance);
} // for
- err = VecRestoreArray(fieldVec, &values);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testSetFieldIncr
// ----------------------------------------------------------------------
@@ -307,11 +341,13 @@
DirichletBC* const bcB,
DirichletBC* const bcC) const
{ // _initialize
- CPPUNIT_ASSERT(0 != _data);
- CPPUNIT_ASSERT(0 != bcA);
- CPPUNIT_ASSERT(0 != bcB);
- CPPUNIT_ASSERT(0 != bcC);
+ PYLITH_METHOD_BEGIN;
+ CPPUNIT_ASSERT(_data);
+ CPPUNIT_ASSERT(bcA);
+ CPPUNIT_ASSERT(bcB);
+ CPPUNIT_ASSERT(bcC);
+
meshio::MeshIOAscii iohandler;
iohandler.filename(_data->meshFilename);
iohandler.read(mesh);
@@ -377,6 +413,8 @@
bcC->normalizer(normalizer);
bcC->initialize(*mesh, upDir);
} // if
+
+ PYLITH_METHOD_END;
} // _initialize
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,49 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDirichletBCMultiCases.hh" // Implementation of cases
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCMultiTri3 );
+
+#include "data/DirichletDataMultiTri3.hh" // USES DirichletDataMultiTri3
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCMultiTri3::setUp(void)
+{ // setUp
+ _data = new DirichletDataMultiTri3();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCMultiTet4 );
+
+#include "data/DirichletDataMultiTet4.hh" // USES DirichletDataMultiTet4
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBCMultiTet4::setUp(void)
+{ // setUp
+ _data = new DirichletDataMultiTet4();
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiCases.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/bc/TestDirichletBCMultiCases.hh
+ *
+ * @brief C++ TestDirichletBC object.
+ *
+ * Test cases for C++ unit testing for DirichletBC for mesh.
+ */
+
+#if !defined(pylith_bc_testdirichletbcmulticases_hh)
+#define pylith_bc_testdirichletbcmulticases_hh
+
+#include "TestDirichletBCMulti.hh" // ISA TestDirichletBC
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace bc {
+ class TestDirichletBCMultiTri3;
+ class TestDirichletBCMultiTet4;
+ } // bc
+} // pylith
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 2-D tri cells.
+class pylith::bc::TestDirichletBCMultiTri3 : public TestDirichletBCMulti
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestDirichletBCMultiTri3 );
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCMultiTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBC for mesh with 3-D tet cells.
+class pylith::bc::TestDirichletBCMultiTet4 : public TestDirichletBCMulti
+{ // class TestDirichletBC
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestDirichletBCMultiTet4 );
+
+ CPPUNIT_TEST( testSetConstraintSizes );
+ CPPUNIT_TEST( testSetConstraints );
+ CPPUNIT_TEST( testSetField );
+ CPPUNIT_TEST( testSetFieldIncr );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBCMultiTet4
+
+
+#endif // pylith_bc_dirichletbcmulticases_hh
+
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCMultiTet4.hh" // Implementation of class methods
-
-#include "data/DirichletDataMultiTet4.hh" // USES DirichletDataMultiTet4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCMultiTet4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCMultiTet4::setUp(void)
-{ // setUp
- _data = new DirichletDataMultiTet4();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTet4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,64 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCMultiTet4.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbcmultitet4_hh)
-#define pylith_bc_testdirichletbcmultitet4_hh
-
-#include "TestDirichletBCMulti.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCMultiTet4;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 2-D tri cells.
-class pylith::bc::TestDirichletBCMultiTet4 : public TestDirichletBCMulti
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE( TestDirichletBCMultiTet4 );
-
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
- CPPUNIT_TEST( testSetFieldIncr );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCMultiTet4
-
-#endif // pylith_bc_dirichletbcmultitet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCMultiTri3.hh" // Implementation of class methods
-
-#include "data/DirichletDataMultiTri3.hh" // USES DirichletDataMultiTri3
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCMultiTri3 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCMultiTri3::setUp(void)
-{ // setUp
- _data = new DirichletDataMultiTri3();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCMultiTri3.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,61 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCMultiTri3.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbcmultitri3_hh)
-#define pylith_bc_testdirichletbcmultitri3_hh
-
-#include "TestDirichletBCMulti.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCMultiTri3;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 2-D tri cells.
-class pylith::bc::TestDirichletBCMultiTri3 : public TestDirichletBCMulti
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE( TestDirichletBCMultiTri3 );
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCMultiTri3
-
-#endif // pylith_bc_dirichletbcmultitri3_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCQuad4.hh" // Implementation of class methods
-
-#include "data/DirichletDataQuad4.hh" // USES DirichletDataQuad4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCQuad4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCQuad4::setUp(void)
-{ // setUp
- _data = new DirichletDataQuad4();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCQuad4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCQuad4.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbcquad4_hh)
-#define pylith_bc_testdirichletbcquad4_hh
-
-#include "TestDirichletBC.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCQuad4;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 2-D quad cells.
-class pylith::bc::TestDirichletBCQuad4 : public TestDirichletBC
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBCQuad4, TestDirichletBC );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testNumDimConstrained );
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
- CPPUNIT_TEST( testSetFieldIncr );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCQuad4
-
-#endif // pylith_bc_dirichletbcquad4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCTet4.hh" // Implementation of class methods
-
-#include "data/DirichletDataTet4.hh" // USES DirichletDataTet4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCTet4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCTet4::setUp(void)
-{ // setUp
- _data = new DirichletDataTet4();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTet4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCTet4.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbctet4_hh)
-#define pylith_bc_testdirichletbcet4_hh
-
-#include "TestDirichletBC.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCTet4;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 3-D tet cells.
-class pylith::bc::TestDirichletBCTet4 : public TestDirichletBC
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBCTet4, TestDirichletBC );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testNumDimConstrained );
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
- CPPUNIT_TEST( testSetFieldIncr );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCTet4
-
-#endif // pylith_bc_dirichletbctet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBCTri3.hh" // Implementation of class methods
-
-#include "data/DirichletDataTri3.hh" // USES DirichletDataTri3
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBCTri3 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBCTri3::setUp(void)
-{ // setUp
- _data = new DirichletDataTri3();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBCTri3.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBCTri3.hh
- *
- * @brief C++ TestDirichletBC object.
- *
- * C++ unit testing for DirichletBC for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletbctri3_hh)
-#define pylith_bc_testdirichletbctri3_hh
-
-#include "TestDirichletBC.hh" // ISA TestDirichletBC
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBCTri3;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBC for mesh with 2-D tri cells.
-class pylith::bc::TestDirichletBCTri3 : public TestDirichletBC
-{ // class TestDirichletBC
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBCTri3, TestDirichletBC );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testNumDimConstrained );
- CPPUNIT_TEST( testSetConstraintSizes );
- CPPUNIT_TEST( testSetConstraints );
- CPPUNIT_TEST( testSetField );
- CPPUNIT_TEST( testSetFieldIncr );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBCTri3
-
-#endif // pylith_bc_dirichletbctri3_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundary.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundary.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundary.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -43,7 +43,11 @@
void
pylith::bc::TestDirichletBoundary::setUp(void)
{ // setUp
+ PYLITH_METHOD_BEGIN;
+
_data = 0;
+
+ PYLITH_METHOD_END;
} // setUp
// ----------------------------------------------------------------------
@@ -51,7 +55,11 @@
void
pylith::bc::TestDirichletBoundary::tearDown(void)
{ // tearDown
+ PYLITH_METHOD_BEGIN;
+
delete _data; _data = 0;
+
+ PYLITH_METHOD_END;
} // tearDown
// ----------------------------------------------------------------------
@@ -59,7 +67,11 @@
void
pylith::bc::TestDirichletBoundary::testConstructor(void)
{ // testConstructor
+ PYLITH_METHOD_BEGIN;
+
DirichletBoundary bc;
+
+ PYLITH_METHOD_END;
} // testConstructor
// ----------------------------------------------------------------------
@@ -67,6 +79,8 @@
void
pylith::bc::TestDirichletBoundary::testInitialize(void)
{ // testInitialize
+ PYLITH_METHOD_BEGIN;
+
topology::Mesh mesh;
DirichletBoundary bc;
_initialize(&mesh, &bc);
@@ -84,6 +98,8 @@
CPPUNIT_ASSERT_EQUAL(PetscInt(numBoundary), depthStratum.size());
// :TODO: Check cells in boundary mesh.
+
+ PYLITH_METHOD_END;
} // testInitialize
// ----------------------------------------------------------------------
@@ -91,6 +107,8 @@
pylith::bc::TestDirichletBoundary::_initialize(topology::Mesh* mesh,
DirichletBoundary* const bc) const
{ // _initialize
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_data);
CPPUNIT_ASSERT(bc);
@@ -140,6 +158,8 @@
bc->dbRate(&dbRate);
bc->bcDOF(_data->fixedDOF, _data->numFixedDOF);
bc->initialize(*mesh, upDir);
+
+ PYLITH_METHOD_END;
} // _initialize
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDirichletBoundaryCases.hh" // Implementation of cases
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryTri3 );
+
+#include "data/DirichletDataTri3.hh" // USES DirichletDataTri3
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBoundaryTri3::setUp(void)
+{ // setUp
+ _data = new DirichletDataTri3();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryQuad4 );
+
+#include "data/DirichletDataQuad4.hh" // USES DirichletDataQuad4
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBoundaryQuad4::setUp(void)
+{ // setUp
+ _data = new DirichletDataQuad4();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryTet4 );
+
+#include "data/DirichletDataTet4.hh" // USES DirichletDataTet4
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBoundaryTet4::setUp(void)
+{ // setUp
+ _data = new DirichletDataTet4();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryHex8 );
+
+#include "data/DirichletDataHex8.hh" // USES DirichletDataHex8
+
+// Setup testing data.
+void
+pylith::bc::TestDirichletBoundaryHex8::setUp(void)
+{ // setUp
+ _data = new DirichletDataHex8();
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryCases.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,121 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/bc/TestDirichletBoundaryCases.hh
+ *
+ * @brief C++ TestDirichletBoundary object.
+ *
+ * Test cases for C++ unit testing for DirichletBoundary for mesh.
+ */
+
+#if !defined(pylith_bc_testdirichletboundarycases_hh)
+#define pylith_bc_testdirichletboundarycases_hh
+
+#include "TestDirichletBoundary.hh" // ISA TestDirichletBoundary
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace bc {
+ class TestDirichletBoundaryTri3;
+ class TestDirichletBoundaryQuad4;
+ class TestDirichletBoundaryTet4;
+ class TestDirichletBoundaryHex8;
+ } // bc
+} // pylith
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBoundary for mesh with 2-D tri cells.
+class pylith::bc::TestDirichletBoundaryTri3 : public TestDirichletBoundary
+{ // class TestDirichletBoundary
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryTri3, TestDirichletBoundary );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBoundaryTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBoundary for mesh with 2-D quad cells.
+class pylith::bc::TestDirichletBoundaryQuad4 : public TestDirichletBoundary
+{ // class TestDirichletBoundary
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryQuad4, TestDirichletBoundary );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBoundaryQuad4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBoundary for mesh with 3-D tet cells.
+class pylith::bc::TestDirichletBoundaryTet4 : public TestDirichletBoundary
+{ // class TestDirichletBoundary
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryTet4, TestDirichletBoundary );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBoundaryTet4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for DirichletBoundary for mesh with 3-D hex cells.
+class pylith::bc::TestDirichletBoundaryHex8 : public TestDirichletBoundary
+{ // class TestDirichletBoundary
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryHex8, TestDirichletBoundary );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestDirichletBoundaryHex8
+
+
+#endif // pylith_bc_dirichletboundarycases_hh
+
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBoundaryHex8.hh" // Implementation of class methods
-
-#include "data/DirichletDataHex8.hh" // USES DirichletDataHex8
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryHex8 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBoundaryHex8::setUp(void)
-{ // setUp
- _data = new DirichletDataHex8();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryHex8.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,59 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBoundaryHex8.hh
- *
- * @brief C++ TestDirichletBoundary object.
- *
- * C++ unit testing for DirichletBoundary for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletboundaryhex8_hh)
-#define pylith_bc_testdirichletboundaryhex8_hh
-
-#include "TestDirichletBoundary.hh" // ISA TestDirichletBoundary
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBoundaryHex8;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBoundary for mesh with 3-D hex cells.
-class pylith::bc::TestDirichletBoundaryHex8 : public TestDirichletBoundary
-{ // class TestDirichletBoundary
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryHex8, TestDirichletBoundary );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBoundaryHex8
-
-#endif // pylith_bc_dirichletboundaryhex8_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBoundaryQuad4.hh" // Implementation of class methods
-
-#include "data/DirichletDataQuad4.hh" // USES DirichletDataQuad4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryQuad4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBoundaryQuad4::setUp(void)
-{ // setUp
- _data = new DirichletDataQuad4();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryQuad4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,59 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBoundaryQuad4.hh
- *
- * @brief C++ TestDirichletBoundary object.
- *
- * C++ unit testing for DirichletBoundary for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletboundaryquad4_hh)
-#define pylith_bc_testdirichletboundaryquad4_hh
-
-#include "TestDirichletBoundary.hh" // ISA TestDirichletBoundary
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBoundaryQuad4;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBoundary for mesh with 2-D quad cells.
-class pylith::bc::TestDirichletBoundaryQuad4 : public TestDirichletBoundary
-{ // class TestDirichletBoundary
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryQuad4, TestDirichletBoundary );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBoundaryQuad4
-
-#endif // pylith_bc_dirichletboundaryquad4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBoundaryTet4.hh" // Implementation of class methods
-
-#include "data/DirichletDataTet4.hh" // USES DirichletDataTet4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryTet4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBoundaryTet4::setUp(void)
-{ // setUp
- _data = new DirichletDataTet4();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTet4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,59 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBoundaryTet4.hh
- *
- * @brief C++ TestDirichletBoundary object.
- *
- * C++ unit testing for DirichletBoundary for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletboundarytet4_hh)
-#define pylith_bc_testdirichletboundaryet4_hh
-
-#include "TestDirichletBoundary.hh" // ISA TestDirichletBoundary
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBoundaryTet4;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBoundary for mesh with 3-D tet cells.
-class pylith::bc::TestDirichletBoundaryTet4 : public TestDirichletBoundary
-{ // class TestDirichletBoundary
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryTet4, TestDirichletBoundary );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBoundaryTet4
-
-#endif // pylith_bc_dirichletboundarytet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestDirichletBoundaryTri3.hh" // Implementation of class methods
-
-#include "data/DirichletDataTri3.hh" // USES DirichletDataTri3
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestDirichletBoundaryTri3 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestDirichletBoundaryTri3::setUp(void)
-{ // setUp
- _data = new DirichletDataTri3();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestDirichletBoundaryTri3.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,59 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestDirichletBoundaryTri3.hh
- *
- * @brief C++ TestDirichletBoundary object.
- *
- * C++ unit testing for DirichletBoundary for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testdirichletboundarytri3_hh)
-#define pylith_bc_testdirichletboundarytri3_hh
-
-#include "TestDirichletBoundary.hh" // ISA TestDirichletBoundary
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestDirichletBoundaryTri3;
- } // bc
-} // pylith
-
-/// C++ unit testing for DirichletBoundary for mesh with 2-D tri cells.
-class pylith::bc::TestDirichletBoundaryTri3 : public TestDirichletBoundary
-{ // class TestDirichletBoundary
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestDirichletBoundaryTri3, TestDirichletBoundary );
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestDirichletBoundaryTri3
-
-#endif // pylith_bc_dirichletboundarytri3_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumann.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -28,6 +28,8 @@
#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
#include "pylith/topology/SubMesh.hh" // USES SubMesh
#include "pylith/topology/Fields.hh" // USES Fields
+#include "pylith/topology/Stratum.hh" // USES Stratum
+#include "pylith/topology/VisitorMesh.hh" // USES VecVisitorMesh
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
@@ -158,31 +160,36 @@
{ // testInitialize
PYLITH_METHOD_BEGIN;
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
Neumann bc;
topology::SolutionFields fields(mesh);
_initialize(&mesh, &bc, &fields);
- CPPUNIT_ASSERT(_data);
-
const topology::SubMesh& boundaryMesh = *bc._boundaryMesh;
+
PetscDM subMesh = boundaryMesh.dmMesh();assert(subMesh);
- PetscInt cStart, cEnd, vStart, vEnd;
- PetscErrorCode err = 0;
- err = DMPlexGetHeightStratum(subMesh, 1, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
- err = DMPlexGetDepthStratum(subMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
+ topology::Stratum verticesStratum(subMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+ const int numVertices = verticesStratum.size();
+ topology::Stratum cellsStratum(subMesh, topology::Stratum::HEIGHT, 1);
+ const PetscInt cStart = cellsStratum.begin();
+ const PetscInt cEnd = cellsStratum.end();
+ const PetscInt numCells = cellsStratum.size();
+
const int cellDim = boundaryMesh.dimension();
const int numCorners = _data->numCorners;
const int spaceDim = _data->spaceDim;
- const int numVertices = vEnd-vStart;
- const int numCells = cEnd-cStart;
CPPUNIT_ASSERT_EQUAL(_data->cellDim, cellDim);
CPPUNIT_ASSERT_EQUAL(_data->numVertices, numVertices);
CPPUNIT_ASSERT_EQUAL(_data->numCells, numCells);
PetscInt dp = 0;
+ PetscErrorCode err = 0;
for (PetscInt c = cStart; c < cEnd; ++c) {
PetscInt *closure = PETSC_NULL;
PetscInt closureSize, numCorners = 0;
@@ -204,31 +211,23 @@
// Check traction values
const int numQuadPts = _data->numQuadPts;
const int fiberDim = numQuadPts * spaceDim;
- scalar_array tractionsCell(fiberDim);
- PetscInt index = 0;
CPPUNIT_ASSERT(bc._parameters);
- PetscSection initialSection = bc._parameters->get("initial").petscSection();
- PetscVec initialVec = bc._parameters->get("initial").localVector();
- PetscScalar *initialArray;
- CPPUNIT_ASSERT(initialSection);CPPUNIT_ASSERT(initialVec);
+ topology::VecVisitorMesh initialVisitor(bc._parameters->get("initial"));
+ const PetscScalar* initialArray = initialVisitor.localArray();CPPUNIT_ASSERT(initialArray);
const PylithScalar tolerance = 1.0e-06;
const PylithScalar pressureScale = _data->pressureScale;
- err = VecGetArray(initialVec, &initialArray);CHECK_PETSC_ERROR(err);
- for (PetscInt c = cStart; c < cEnd; ++c) {
- PetscInt dof, off;
- err = PetscSectionGetDof(initialSection, c, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(initialSection, c, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT(dof == numQuadPts*spaceDim);
+ for (PetscInt c = cStart, index = 0; c < cEnd; ++c) {
+ const PetscInt off = initialVisitor.sectionOffset(c);
+ CPPUNIT_ASSERT_EQUAL(numQuadPts*spaceDim, initialVisitor.sectionDof(c));
+
for (int iQuad=0; iQuad < numQuadPts; ++iQuad)
- for (int iDim =0; iDim < spaceDim; ++iDim) {
+ for (int iDim =0; iDim < spaceDim; ++iDim, ++index) {
const PylithScalar tractionE = _data->tractionsCell[index];
CPPUNIT_ASSERT_DOUBLES_EQUAL(tractionE, initialArray[off+iQuad*spaceDim+iDim]*pressureScale, tolerance);
- ++index;
} // for
} // for
- err = VecRestoreArray(initialVec, &initialArray);CHECK_PETSC_ERROR(err);
PYLITH_METHOD_END;
} // testInitialize
@@ -252,36 +251,34 @@
bc.integrateResidual(residual, t, &fields);
PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- PetscInt vStart, vEnd;
- PetscErrorCode err = 0;
- const PylithScalar* valsE = _data->valsResidual;
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
+ const int totalNumVertices = verticesStratum.size();
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
- const int totalNumVertices = vEnd - vStart;
- const int sizeE = _data->spaceDim * totalNumVertices;
+ const PylithScalar* residualE = _data->valsResidual;
+ const int spaceDim = _data->spaceDim;
- PetscSection residualSection = residual.petscSection();CPPUNIT_ASSERT(residualSection);
- PetscVec residualVec = residual.localVector();CPPUNIT_ASSERT(residualVec);
- PetscScalar *vals;
- PetscInt size;
-
- err = PetscSectionGetStorageSize(residualSection, &size);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(sizeE, size);
-
+ topology::VecVisitorMesh residualVisitor(residual);
+ const PetscScalar* residualArray = residualVisitor.localArray();
//residual.view("RESIDUAL");
const PylithScalar tolerance = 1.0e-06;
const PylithScalar residualScale = _data->pressureScale * pow(_data->lengthScale, _data->spaceDim-1);
- err = VecGetArray(residualVec, &vals);CHECK_PETSC_ERROR(err);
- for (int i=0; i < size; ++i)
- if (fabs(valsE[i]) > 1.0) {
- CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[i]/valsE[i]*residualScale, tolerance);
- } else {
- CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[i], vals[i]*residualScale, tolerance);
- } // if/else
- err = VecRestoreArray(residualVec, &vals);CHECK_PETSC_ERROR(err);
+ for (PetscInt v = vStart, index = 0; v < vEnd; ++v) {
+ const PetscInt off = residualVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, residualVisitor.sectionDof(v));
+ for (int iDim=0; iDim < spaceDim; ++iDim, ++index) {
+ if (fabs(residualE[index]) > 1.0) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, residualArray[off+iDim]/residualE[index]*residualScale, tolerance);
+ } else {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(residualE[index], residualArray[off+iDim]*residualScale, tolerance);
+ } // if/else
+ } // for
+ } // for
+
PYLITH_METHOD_END;
} // testIntegrateResidual
@@ -292,7 +289,7 @@
{ // test_queryDatabases
PYLITH_METHOD_BEGIN;
- _data = new NeumannDataQuad4();
+ delete _data; _data = new NeumannDataQuad4();
feassemble::GeometryLine2D geometry;
CPPUNIT_ASSERT(_quadrature);
_quadrature->refGeometry(&geometry);
@@ -369,7 +366,7 @@
{ // test_paramsLocalToGlobal
PYLITH_METHOD_BEGIN;
- _data = new NeumannDataQuad4();
+ delete _data; _data = new NeumannDataQuad4();
feassemble::GeometryLine2D geometry;
CPPUNIT_ASSERT(_quadrature);
_quadrature->refGeometry(&geometry);
@@ -450,7 +447,7 @@
{ // test_calculateValueInitial
PYLITH_METHOD_BEGIN;
- _data = new NeumannDataQuad4();
+ delete _data; _data = new NeumannDataQuad4();
feassemble::GeometryLine2D geometry;
CPPUNIT_ASSERT(_quadrature);
_quadrature->refGeometry(&geometry);
@@ -490,7 +487,7 @@
{ // test_calculateValueRate
PYLITH_METHOD_BEGIN;
- _data = new NeumannDataQuad4();
+ delete _data; _data = new NeumannDataQuad4();
feassemble::GeometryLine2D geometry;
CPPUNIT_ASSERT(_quadrature);
_quadrature->refGeometry(&geometry);
@@ -530,7 +527,7 @@
{ // test_calculateValueChange
PYLITH_METHOD_BEGIN;
- _data = new NeumannDataQuad4();
+ delete _data; _data = new NeumannDataQuad4();
feassemble::GeometryLine2D geometry;
CPPUNIT_ASSERT(_quadrature);
_quadrature->refGeometry(&geometry);
@@ -570,7 +567,7 @@
{ // test_calculateValueChangeTH
PYLITH_METHOD_BEGIN;
- _data = new NeumannDataQuad4();
+ delete _data; _data = new NeumannDataQuad4();
feassemble::GeometryLine2D geometry;
CPPUNIT_ASSERT(_quadrature);
_quadrature->refGeometry(&geometry);
@@ -614,7 +611,7 @@
{ // test_calculateValueAll
PYLITH_METHOD_BEGIN;
- _data = new NeumannDataQuad4();
+ delete _data; _data = new NeumannDataQuad4();
feassemble::GeometryLine2D geometry;
CPPUNIT_ASSERT(_quadrature);
_quadrature->refGeometry(&geometry);
@@ -776,29 +773,25 @@
CPPUNIT_ASSERT(valuesE);
const topology::SubMesh& boundaryMesh = field.mesh();
+ const PetscInt ncells = _TestNeumann::ncells;
+
PetscDM subMesh = boundaryMesh.dmMesh();CPPUNIT_ASSERT(subMesh);
- PetscInt cStart, cEnd;
- PetscErrorCode err = 0;
- err = DMPlexGetHeightStratum(subMesh, 1, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
+ topology::Stratum cellsStratum(subMesh, topology::Stratum::HEIGHT, 1);
+ const PetscInt cStart = cellsStratum.begin();
+ const PetscInt cEnd = cellsStratum.end();
+ CPPUNIT_ASSERT_EQUAL(ncells, cellsStratum.size());
const PylithScalar scale = field.scale();
- PetscSection fieldSection = field.petscSection();CPPUNIT_ASSERT(fieldSection);
- PetscVec fieldVec = field.localVector();assert(fieldVec);
- PetscScalar *fieldArray;
- const PetscInt ncells = _TestNeumann::ncells;
- CPPUNIT_ASSERT_EQUAL(ncells, cEnd-cStart);
-
// Check values associated with BC.
- int icell = 0;
+ topology::VecVisitorMesh fieldVisitor(field);
+ const PetscScalar* fieldArray = fieldVisitor.localArray();
+
const PylithScalar tolerance = 1.0e-06;
- err = VecGetArray(fieldVec, &fieldArray);CHECK_PETSC_ERROR(err);
- for (PetscInt c = cStart; c < cEnd; ++c, ++icell) {
- PetscInt dof, off;
+ for (PetscInt c = cStart, icell = 0; c < cEnd; ++c, ++icell) {
+ const PetscInt off = fieldVisitor.sectionOffset(c);
+ CPPUNIT_ASSERT_EQUAL(fiberDimE, fieldVisitor.sectionDof(c));
- err = PetscSectionGetDof(fieldSection, c, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(fieldSection, c, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(fiberDimE, dof);
for (int iDim=0; iDim < fiberDimE; ++iDim) {
if (valuesE[icell*fiberDimE+iDim] != 0.0) {
CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, fieldArray[off+iDim]/valuesE[icell*fiberDimE+iDim]*scale, tolerance);
@@ -807,7 +800,6 @@
} // if/else
} // for
} // for
- err = VecRestoreArray(fieldVec, &fieldArray);CHECK_PETSC_ERROR(err);
PYLITH_METHOD_END;
} // _checkValues
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestNeumannCases.hh" // Implementation of class methods
+
+#include "pylith/topology/SubMesh.hh" // USES SubMesh
+#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannLine2 );
+
+#include "data/NeumannDataLine2.hh" // USES NeumannDataLine2
+#include "pylith/feassemble/GeometryPoint1D.hh" // USES GeometryPoint1D
+
+// Setup testing data.
+void
+pylith::bc::TestNeumannLine2::setUp(void)
+{ // setUp
+ TestNeumann::setUp();
+ _data = new NeumannDataLine2();
+ feassemble::GeometryPoint1D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannTri3 );
+
+#include "data/NeumannDataTri3.hh" // USES NeumannDataTri3
+#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
+
+// Setup testing data.
+void
+pylith::bc::TestNeumannTri3::setUp(void)
+{ // setUp
+ TestNeumann::setUp();
+ _data = new NeumannDataTri3();
+ feassemble::GeometryLine2D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannQuad4 );
+
+#include "data/NeumannDataQuad4.hh" // USES NeumannDataQuad4
+#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
+
+// Setup testing data.
+void
+pylith::bc::TestNeumannQuad4::setUp(void)
+{ // setUp
+ TestNeumann::setUp();
+ _data = new NeumannDataQuad4();
+ feassemble::GeometryLine2D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannTet4 );
+
+#include "data/NeumannDataTet4.hh" // USES NeumannDataTet4
+#include "pylith/feassemble/GeometryTri3D.hh" // USES GeometryTri3D
+
+// Setup testing data.
+void
+pylith::bc::TestNeumannTet4::setUp(void)
+{ // setUp
+ TestNeumann::setUp();
+ _data = new NeumannDataTet4();
+ feassemble::GeometryTri3D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannHex8 );
+
+#include "data/NeumannDataHex8.hh" // USES NeumannDataHex8
+#include "pylith/feassemble/GeometryQuad3D.hh" // USES GeometryQuad3D
+
+// Setup testing data.
+void
+pylith::bc::TestNeumannHex8::setUp(void)
+{ // setUp
+ TestNeumann::setUp();
+ _data = new NeumannDataHex8();
+ feassemble::GeometryQuad3D geometry;
+ CPPUNIT_ASSERT(_quadrature);
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannCases.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,156 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/bc/TestNeumannLine2.hh
+ *
+ * @brief C++ TestNeumann object.
+ *
+ * Test cases for C++ unit testing for Neumann.
+ */
+
+#if !defined(pylith_bc_testneumanncases_hh)
+#define pylith_bc_testneumanncases_hh
+
+#include "TestNeumann.hh" // ISA TestNeumann
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace bc {
+ class TestNeumannLine2;
+ class TestNeumannTri3;
+ class TestNeumannQuad4;
+ class TestNeumannTet4;
+ class TestNeumannHex8;
+ } // bc
+} // pylith
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for Neumann for mesh with 1-D line cells.
+class pylith::bc::TestNeumannLine2 : public TestNeumann
+{ // class TestNeumann
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestNeumannLine2 );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestNeumannLine2
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for Neumann for mesh with 2-D tri cells.
+class pylith::bc::TestNeumannTri3 : public TestNeumann
+{ // class TestNeumann
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestNeumannTri3 );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestNeumannTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for Neumann for mesh with 2-D quad cells.
+class pylith::bc::TestNeumannQuad4 : public TestNeumann
+{ // class TestNeumann
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestNeumannQuad4 );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestNeumannQuad4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for Neumann for mesh with 3-D tet cells.
+class pylith::bc::TestNeumannTet4 : public TestNeumann
+{ // class TestNeumann
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestNeumannTet4 );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestNeumannTet4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for Neumann for mesh with 3-D hex cells.
+class pylith::bc::TestNeumannHex8 : public TestNeumann
+{ // class TestNeumann
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestNeumannHex8 );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestNeumannHex8
+
+
+#endif // pylith_bc_neumanncases_hh
+
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestNeumannHex8.hh" // Implementation of class methods
-
-#include "data/NeumannDataHex8.hh" // USES NeumannDataHex8
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryQuad3D.hh" // USES GeometryQuad3D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannHex8 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestNeumannHex8::setUp(void)
-{ // setUp
- TestNeumann::setUp();
- _data = new NeumannDataHex8();
- feassemble::GeometryQuad3D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannHex8.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestNeumannHex8.hh
- *
- * @brief C++ TestNeumann object.
- *
- * C++ unit testing for Neumann for mesh with 3-D hex cells.
- */
-
-#if !defined(pylith_bc_testneumannhex8_hh)
-#define pylith_bc_testneumannhex8_hh
-
-#include "TestNeumann.hh" // ISA TestNeumann
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestNeumannHex8;
- } // bc
-} // pylith
-
-/// C++ unit testing for Neumann for mesh with 3-D hex cells.
-class pylith::bc::TestNeumannHex8 : public TestNeumann
-{ // class TestNeumann
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE( TestNeumannHex8 );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestNeumannHex8
-
-#endif // pylith_bc_neumannhex8_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestNeumannLine2.hh" // Implementation of class methods
-
-#include "data/NeumannDataLine2.hh" // USES NeumannDataLine2
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryPoint1D.hh" // USES GeometryPoint1D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannLine2 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestNeumannLine2::setUp(void)
-{ // setUp
- TestNeumann::setUp();
- _data = new NeumannDataLine2();
- feassemble::GeometryPoint1D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannLine2.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestNeumannLine2.hh
- *
- * @brief C++ TestNeumann object.
- *
- * C++ unit testing for Neumann for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testneumannline2_hh)
-#define pylith_bc_testneumannline2_hh
-
-#include "TestNeumann.hh" // ISA TestNeumann
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestNeumannLine2;
- } // bc
-} // pylith
-
-/// C++ unit testing for Neumann for mesh with 1-D line cells.
-class pylith::bc::TestNeumannLine2 : public TestNeumann
-{ // class TestNeumann
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE( TestNeumannLine2 );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestNeumannLine2
-
-#endif // pylith_bc_neumannline2_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestNeumannQuad4.hh" // Implementation of class methods
-
-#include "data/NeumannDataQuad4.hh" // USES NeumannDataQuad4
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannQuad4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestNeumannQuad4::setUp(void)
-{ // setUp
- TestNeumann::setUp();
- _data = new NeumannDataQuad4();
- feassemble::GeometryLine2D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannQuad4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestNeumannQuad4.hh
- *
- * @brief C++ TestNeumann object.
- *
- * C++ unit testing for Neumann for mesh with 2-D quad cells.
- */
-
-#if !defined(pylith_bc_testneumannquad4_hh)
-#define pylith_bc_testneumannquad4_hh
-
-#include "TestNeumann.hh" // ISA TestNeumann
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestNeumannQuad4;
- } // bc
-} // pylith
-
-/// C++ unit testing for Neumann for mesh with 2-D quad cells.
-class pylith::bc::TestNeumannQuad4 : public TestNeumann
-{ // class TestNeumann
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE( TestNeumannQuad4 );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestNeumannQuad4
-
-#endif // pylith_bc_neumannquad4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestNeumannTet4.hh" // Implementation of class methods
-
-#include "data/NeumannDataTet4.hh" // USES NeumannDataTet4
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryTri3D.hh" // USES GeometryTri3D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannTet4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestNeumannTet4::setUp(void)
-{ // setUp
- TestNeumann::setUp();
- _data = new NeumannDataTet4();
- feassemble::GeometryTri3D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTet4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestNeumannTet4.hh
- *
- * @brief C++ TestNeumann object.
- *
- * C++ unit testing for Neumann for mesh with 3-D tet cells.
- */
-
-#if !defined(pylith_bc_testneumanntet4_hh)
-#define pylith_bc_testneumanntet4_hh
-
-#include "TestNeumann.hh" // ISA TestNeumann
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestNeumannTet4;
- } // bc
-} // pylith
-
-/// C++ unit testing for Neumann for mesh with 3-D tet cells.
-class pylith::bc::TestNeumannTet4 : public TestNeumann
-{ // class TestNeumann
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE( TestNeumannTet4 );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestNeumannTet4
-
-#endif // pylith_bc_neumanntet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,45 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestNeumannTri3.hh" // Implementation of class methods
-
-#include "data/NeumannDataTri3.hh" // USES NeumannDataTri3
-
-#include "pylith/topology/SubMesh.hh" // USES SubMesh
-#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
-#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestNeumannTri3 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestNeumannTri3::setUp(void)
-{ // setUp
- TestNeumann::setUp();
- _data = new NeumannDataTri3();
- feassemble::GeometryLine2D geometry;
- CPPUNIT_ASSERT(0 != _quadrature);
- _quadrature->refGeometry(&geometry);
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestNeumannTri3.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestNeumannTri3.hh
- *
- * @brief C++ TestNeumann object.
- *
- * C++ unit testing for Neumann for mesh with 2-D tri cells.
- */
-
-#if !defined(pylith_bc_testneumanntri3_hh)
-#define pylith_bc_testneumanntri3_hh
-
-#include "TestNeumann.hh" // ISA TestNeumann
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestNeumannTri3;
- } // bc
-} // pylith
-
-/// C++ unit testing for Neumann for mesh with 2-D tri cells.
-class pylith::bc::TestNeumannTri3 : public TestNeumann
-{ // class TestNeumann
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUITE( TestNeumannTri3 );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestNeumannTri3
-
-#endif // pylith_bc_neumanntri3_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForce.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -28,6 +28,8 @@
#include "pylith/topology/Field.hh" // USES Field
#include "pylith/topology/Fields.hh" // USES Fields
#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
+#include "pylith/topology/Stratum.hh" // USES Stratum
+#include "pylith/topology/VisitorMesh.hh" // USES VecVisitorMesh
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
@@ -43,7 +45,11 @@
void
pylith::bc::TestPointForce::setUp(void)
{ // setUp
+ PYLITH_METHOD_BEGIN;
+
_data = 0;
+
+ PYLITH_METHOD_END;
} // setUp
// ----------------------------------------------------------------------
@@ -51,7 +57,11 @@
void
pylith::bc::TestPointForce::tearDown(void)
{ // tearDown
+ PYLITH_METHOD_BEGIN;
+
delete _data; _data = 0;
+
+ PYLITH_METHOD_END;
} // tearDown
// ----------------------------------------------------------------------
@@ -59,7 +69,11 @@
void
pylith::bc::TestPointForce::testConstructor(void)
{ // testConstructor
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
+
+ PYLITH_METHOD_END;
} // testConstructor
// ----------------------------------------------------------------------
@@ -67,6 +81,8 @@
void
pylith::bc::TestPointForce::testNormalizer(void)
{ // testNormalizer
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
spatialdata::units::Nondimensional normalizer;
@@ -75,6 +91,8 @@
bc.normalizer(normalizer);
CPPUNIT_ASSERT_EQUAL(scale, bc._getNormalizer().lengthScale());
+
+ PYLITH_METHOD_END;
} // testNormalizer
// ----------------------------------------------------------------------
@@ -82,17 +100,18 @@
void
pylith::bc::TestPointForce::testInitialize(void)
{ // testInitialize
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
PointForce bc;
_initialize(&mesh, &bc);
- CPPUNIT_ASSERT(_data);
PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- PetscInt cStart, cEnd;
- PetscErrorCode err;
- err = DMPlexGetHeightStratum(dmMesh, 0, &cStart, &cEnd);CHECK_PETSC_ERROR(err);
+ topology::Stratum cellsStratum(dmMesh, topology::Stratum::HEIGHT, 0);
+ const PetscInt numCells = cellsStratum.size();
- const int numCells = cEnd-cStart;
const int numForceDOF = _data->numForceDOF;
const size_t numPoints = _data->numForcePts;
@@ -105,48 +124,42 @@
} // for
} // if
- CPPUNIT_ASSERT(bc._parameters);
- PetscSection initialSection = bc._parameters->get("initial").petscSection();CPPUNIT_ASSERT(initialSection);
- PetscVec initialVec = bc._parameters->get("initial").localVector();CPPUNIT_ASSERT(initialVec);
- PetscScalar *initialArray = NULL;
-
// Check values
const PylithScalar tolerance = 1.0e-06;
const PylithScalar forceScale = _data->pressureScale*pow(_data->lengthScale, 2);
const PylithScalar timeScale = _data->timeScale;
- err = VecGetArray(initialVec, &initialArray);CHECK_PETSC_ERROR(err);
+ CPPUNIT_ASSERT(bc._parameters);
+ topology::VecVisitorMesh initialVisitor(bc._parameters->get("initial"));
+ const PetscScalar* initialArray = initialVisitor.localArray();
+
for (int i=0; i < numPoints; ++i) {
const int p_force = _data->forcePoints[i]+offset;
- PetscInt dof, off;
- err = PetscSectionGetDof(initialSection, p_force, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(initialSection, p_force, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(numForceDOF, dof);
+ const PetscInt off = initialVisitor.sectionOffset(p_force);
+ CPPUNIT_ASSERT_EQUAL(numForceDOF, initialVisitor.sectionDof(p_force));
+
for (int iDOF=0; iDOF < numForceDOF; ++iDOF) {
CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->forceInitial[i*numForceDOF+iDOF], initialArray[off+iDOF]*forceScale, tolerance);
} // for
} // for
- err = VecRestoreArray(initialVec, &initialArray);CHECK_PETSC_ERROR(err);
// Check rate of change
- PetscSection rateSection = bc._parameters->get("rate").petscSection();CPPUNIT_ASSERT(rateSection);
- PetscVec rateVec = bc._parameters->get("rate").localVector();CPPUNIT_ASSERT(rateVec);
- PetscScalar *rateArray = NULL;
- err = VecGetArray(rateVec, &rateArray);CHECK_PETSC_ERROR(err);
+ topology::VecVisitorMesh rateVisitor(bc._parameters->get("rate"));
+ const PetscScalar* rateArray = rateVisitor.localArray();
for (int i=0; i < numPoints; ++i) {
const int p_force = _data->forcePoints[i]+offset;
- PetscInt dof, off;
- err = PetscSectionGetDof(rateSection, p_force, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(rateSection, p_force, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(numForceDOF, dof);
+ const PetscInt off = rateVisitor.sectionOffset(p_force);
+ CPPUNIT_ASSERT_EQUAL(numForceDOF, rateVisitor.sectionDof(p_force));
+
for (int iDOF=0; iDOF < numForceDOF; ++iDOF) {
CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->forceRate, rateArray[off+iDOF]*forceScale/timeScale, tolerance);
} // for
} // for
- err = VecRestoreArray(rateVec, &rateArray);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // testInitialize
// ----------------------------------------------------------------------
@@ -154,13 +167,16 @@
void
pylith::bc::TestPointForce::testIntegrateResidual(void)
{ // testIntegrateResidual
+ PYLITH_METHOD_BEGIN;
+
+ CPPUNIT_ASSERT(_data);
+
topology::Mesh mesh;
PointForce bc;
_initialize(&mesh, &bc);
topology::Field<topology::Mesh> residual(mesh);
- const spatialdata::geocoords::CoordSys* cs = mesh.coordsys();
- CPPUNIT_ASSERT(cs);
+ const spatialdata::geocoords::CoordSys* cs = mesh.coordsys();CPPUNIT_ASSERT(cs);
const int spaceDim = cs->spaceDim();
residual.newSection(topology::FieldBase::VERTICES_FIELD, spaceDim);
residual.allocate();
@@ -171,36 +187,35 @@
const PylithScalar t = _data->tResidual/_data->timeScale;
bc.integrateResidual(residual, t, &fields);
+ // residual.view("RESIDUAL"); // DEBUGGING
+
PetscDM dmMesh = mesh.dmMesh();CPPUNIT_ASSERT(dmMesh);
- PetscInt vStart, vEnd;
- PetscErrorCode err;
- err = DMPlexGetDepthStratum(dmMesh, 0, &vStart, &vEnd);CHECK_PETSC_ERROR(err);
+ topology::Stratum verticesStratum(dmMesh, topology::Stratum::DEPTH, 0);
+ const PetscInt vStart = verticesStratum.begin();
+ const PetscInt vEnd = verticesStratum.end();
- const PylithScalar* valsE = _data->residual;
- const int totalNumVertices = vEnd-vStart;
- const int sizeE = spaceDim * totalNumVertices;
+ const PylithScalar* residualE = _data->residual;
- PetscSection residualSection = residual.petscSection();CPPUNIT_ASSERT(residualSection);
- PetscVec residualVec = residual.localVector();CPPUNIT_ASSERT(residualVec);
- PetscScalar *vals = NULL;
- PetscInt size;
- err = PetscSectionGetStorageSize(residualSection, &size);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(sizeE, size);
+ topology::VecVisitorMesh residualVisitor(residual);
+ const PetscScalar* residualArray = residualVisitor.localArray();
- // residual.view("RESIDUAL"); // DEBUGGING
-
const PylithScalar tolerance = 1.0e-06;
const PylithScalar forceScale = _data->pressureScale*pow(_data->lengthScale, 2);
const PylithScalar residualScale = forceScale;
+ for (PetscInt v = vStart, index = 0; v < vEnd; ++v) {
+ const PetscInt off = residualVisitor.sectionOffset(v);
+ CPPUNIT_ASSERT_EQUAL(spaceDim, residualVisitor.sectionDof(v));
- err = VecGetArray(residualVec, &vals);CHECK_PETSC_ERROR(err);
- for (int i=0; i < size; ++i)
- if (fabs(valsE[i]) > 1.0) {
- CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[i]/valsE[i]*residualScale, tolerance);
- } else {
- CPPUNIT_ASSERT_DOUBLES_EQUAL(valsE[i], vals[i]*residualScale, tolerance);
- } // if/else
- err = VecRestoreArray(residualVec, &vals);CHECK_PETSC_ERROR(err);
+ for (int iDim=0; iDim < spaceDim; ++iDim, ++index) {
+ if (fabs(residualE[index]) > 1.0) {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, residualArray[off+iDim]/residualE[index]*residualScale, tolerance);
+ } else {
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(residualE[index], residualArray[off+iDim]*residualScale, tolerance);
+ } // if/else
+ } // for
+ } // for
+
+ PYLITH_METHOD_END;
} // testIntegrateResidual
// ----------------------------------------------------------------------
@@ -208,11 +223,15 @@
void
pylith::bc::TestPointForce::testVerifyConfiguration(void)
{ // testVerifyConfiguration
+ PYLITH_METHOD_BEGIN;
+
topology::Mesh mesh;
PointForce bc;
_initialize(&mesh, &bc);
bc.verifyConfiguration(mesh);
+
+ PYLITH_METHOD_END;
} // testVerifyConfiguration
// ----------------------------------------------------------------------
@@ -220,6 +239,8 @@
pylith::bc::TestPointForce::_initialize(topology::Mesh* mesh,
PointForce* const bc) const
{ // _initialize
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_data);
CPPUNIT_ASSERT(bc);
@@ -276,6 +297,8 @@
bc->bcDOF(_data->forceDOF, _data->numForceDOF);
bc->normalizer(normalizer);
bc->initialize(*mesh, upDir);
+
+ PYLITH_METHOD_END;
} // _initialize
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,88 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestPointForceCases.hh" // Implementation of class methods
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceLine2 );
+
+#include "data/PointForceDataLine2.hh" // USES DirichletDataLine2
+
+// Setup testing data.
+void
+pylith::bc::TestPointForceLine2::setUp(void)
+{ // setUp
+ _data = new PointForceDataLine2();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceTri3 );
+
+#include "data/PointForceDataTri3.hh" // USES DirichletDataTri3
+
+// Setup testing data.
+void
+pylith::bc::TestPointForceTri3::setUp(void)
+{ // setUp
+ _data = new PointForceDataTri3();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceQuad4 );
+
+#include "data/PointForceDataQuad4.hh" // USES DirichletDataQuad4
+
+// Setup testing data.
+void
+pylith::bc::TestPointForceQuad4::setUp(void)
+{ // setUp
+ _data = new PointForceDataQuad4();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceTet4 );
+
+#include "data/PointForceDataTet4.hh" // USES DirichletDataTet4
+
+// Setup testing data.
+void
+pylith::bc::TestPointForceTet4::setUp(void)
+{ // setUp
+ _data = new PointForceDataTet4();
+} // setUp
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceHex8 );
+
+#include "data/PointForceDataHex8.hh" // USES DirichletDataHex8
+
+// Setup testing data.
+void
+pylith::bc::TestPointForceHex8::setUp(void)
+{ // setUp
+ _data = new PointForceDataHex8();
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceCases.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -0,0 +1,160 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard, U.S. Geological Survey
+// Charles A. Williams, GNS Science
+// Matthew G. Knepley, University of Chicago
+//
+// This code was developed as part of the Computational Infrastructure
+// for Geodynamics (http://geodynamics.org).
+//
+// Copyright (c) 2010-2012 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/bc/TestPointForceCases.hh
+ *
+ * @brief C++ TestPointForce object.
+ *
+ * Test cases for C++ unit testing for PointForce.
+ */
+
+#if !defined(pylith_bc_testpointforcebccases_hh)
+#define pylith_bc_testpointforcebccases_hh
+
+#include "TestPointForce.hh" // ISA TestPointForce
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace bc {
+ class TestPointForceLine2;
+ class TestPointForceTri3;
+ class TestPointForceQuad4;
+ class TestPointForceTet4;
+ class TestPointForceHex8;
+ } // bc
+} // pylith
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for PointForce for mesh with 2-D tri cells.
+class pylith::bc::TestPointForceLine2 : public TestPointForce
+{ // class TestPointForce
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestPointForceLine2, TestPointForce );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testVerifyConfiguration );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestPointForceLine2
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for PointForce for mesh with 2-D tri cells.
+class pylith::bc::TestPointForceTri3 : public TestPointForce
+{ // class TestPointForce
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestPointForceTri3, TestPointForce );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testVerifyConfiguration );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestPointForceTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for PointForce for mesh with 2-D quad4 cells.
+class pylith::bc::TestPointForceQuad4 : public TestPointForce
+{ // class TestPointForce
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestPointForceQuad4, TestPointForce );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testVerifyConfiguration );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestPointForceQuad4
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for PointForce for mesh with 3-D tet cells.
+class pylith::bc::TestPointForceTet4 : public TestPointForce
+{ // class TestPointForce
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestPointForceTet4, TestPointForce );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testVerifyConfiguration );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestPointForceTet4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for PointForce for mesh with 3-D hex cells.
+class pylith::bc::TestPointForceHex8 : public TestPointForce
+{ // class TestPointForce
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUB_SUITE( TestPointForceHex8, TestPointForce );
+
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+ CPPUNIT_TEST( testVerifyConfiguration );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestPointForceHex8
+
+
+#endif // pylith_bc_pointforcebcline2_hh
+
+
+// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestPointForceHex8.hh" // Implementation of class methods
-
-#include "data/PointForceDataHex8.hh" // USES DirichletDataHex8
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceHex8 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestPointForceHex8::setUp(void)
-{ // setUp
- _data = new PointForceDataHex8();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceHex8.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,63 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestPointForceHex8.hh
- *
- * @brief C++ TestPointForce object.
- *
- * C++ unit testing for PointForce for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testpointforcebchex8_hh)
-#define pylith_bc_testpointforcebchex8_hh
-
-#include "TestPointForce.hh" // ISA TestPointForce
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestPointForceHex8;
- } // bc
-} // pylith
-
-/// C++ unit testing for PointForce for mesh with 2-D tri cells.
-class pylith::bc::TestPointForceHex8 : public TestPointForce
-{ // class TestPointForce
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestPointForceHex8, TestPointForce );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testVerifyConfiguration );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestPointForceHex8
-
-#endif // pylith_bc_pointforcebchex8_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestPointForceLine2.hh" // Implementation of class methods
-
-#include "data/PointForceDataLine2.hh" // USES DirichletDataLine2
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceLine2 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestPointForceLine2::setUp(void)
-{ // setUp
- _data = new PointForceDataLine2();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceLine2.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,63 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestPointForceLine2.hh
- *
- * @brief C++ TestPointForce object.
- *
- * C++ unit testing for PointForce for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testpointforcebcline2_hh)
-#define pylith_bc_testpointforcebcline2_hh
-
-#include "TestPointForce.hh" // ISA TestPointForce
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestPointForceLine2;
- } // bc
-} // pylith
-
-/// C++ unit testing for PointForce for mesh with 2-D tri cells.
-class pylith::bc::TestPointForceLine2 : public TestPointForce
-{ // class TestPointForce
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestPointForceLine2, TestPointForce );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testVerifyConfiguration );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestPointForceLine2
-
-#endif // pylith_bc_pointforcebcline2_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestPointForceQuad4.hh" // Implementation of class methods
-
-#include "data/PointForceDataQuad4.hh" // USES DirichletDataQuad4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceQuad4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestPointForceQuad4::setUp(void)
-{ // setUp
- _data = new PointForceDataQuad4();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceQuad4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,63 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestPointForceQuad4.hh
- *
- * @brief C++ TestPointForce object.
- *
- * C++ unit testing for PointForce for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testpointforcebcquad4_hh)
-#define pylith_bc_testpointforcebcquad4_hh
-
-#include "TestPointForce.hh" // ISA TestPointForce
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestPointForceQuad4;
- } // bc
-} // pylith
-
-/// C++ unit testing for PointForce for mesh with 2-D tri cells.
-class pylith::bc::TestPointForceQuad4 : public TestPointForce
-{ // class TestPointForce
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestPointForceQuad4, TestPointForce );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testVerifyConfiguration );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestPointForceQuad4
-
-#endif // pylith_bc_pointforcebcquad4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestPointForceTet4.hh" // Implementation of class methods
-
-#include "data/PointForceDataTet4.hh" // USES DirichletDataTet4
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceTet4 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestPointForceTet4::setUp(void)
-{ // setUp
- _data = new PointForceDataTet4();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTet4.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,63 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestPointForceTet4.hh
- *
- * @brief C++ TestPointForce object.
- *
- * C++ unit testing for PointForce for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testpointforcebctet4_hh)
-#define pylith_bc_testpointforcebctet4_hh
-
-#include "TestPointForce.hh" // ISA TestPointForce
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestPointForceTet4;
- } // bc
-} // pylith
-
-/// C++ unit testing for PointForce for mesh with 2-D tri cells.
-class pylith::bc::TestPointForceTet4 : public TestPointForce
-{ // class TestPointForce
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestPointForceTet4, TestPointForce );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testVerifyConfiguration );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestPointForceTet4
-
-#endif // pylith_bc_pointforcebctet4_hh
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,37 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-#include <portinfo>
-
-#include "TestPointForceTri3.hh" // Implementation of class methods
-
-#include "data/PointForceDataTri3.hh" // USES DirichletDataTri3
-
-// ----------------------------------------------------------------------
-CPPUNIT_TEST_SUITE_REGISTRATION( pylith::bc::TestPointForceTri3 );
-
-// ----------------------------------------------------------------------
-// Setup testing data.
-void
-pylith::bc::TestPointForceTri3::setUp(void)
-{ // setUp
- _data = new PointForceDataTri3();
-} // setUp
-
-
-// End of file
Deleted: short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.hh 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestPointForceTri3.hh 2013-04-03 19:31:24 UTC (rev 21706)
@@ -1,63 +0,0 @@
-// -*- C++ -*-
-//
-// ----------------------------------------------------------------------
-//
-// Brad T. Aagaard, U.S. Geological Survey
-// Charles A. Williams, GNS Science
-// Matthew G. Knepley, University of Chicago
-//
-// This code was developed as part of the Computational Infrastructure
-// for Geodynamics (http://geodynamics.org).
-//
-// Copyright (c) 2010-2012 University of California, Davis
-//
-// See COPYING for license information.
-//
-// ----------------------------------------------------------------------
-//
-
-/**
- * @file unittests/libtests/bc/TestPointForceTri3.hh
- *
- * @brief C++ TestPointForce object.
- *
- * C++ unit testing for PointForce for mesh with 1-D line cells.
- */
-
-#if !defined(pylith_bc_testpointforcebctri3_hh)
-#define pylith_bc_testpointforcebctri3_hh
-
-#include "TestPointForce.hh" // ISA TestPointForce
-
-/// Namespace for pylith package
-namespace pylith {
- namespace bc {
- class TestPointForceTri3;
- } // bc
-} // pylith
-
-/// C++ unit testing for PointForce for mesh with 2-D tri cells.
-class pylith::bc::TestPointForceTri3 : public TestPointForce
-{ // class TestPointForce
-
- // CPPUNIT TEST SUITE /////////////////////////////////////////////////
- CPPUNIT_TEST_SUB_SUITE( TestPointForceTri3, TestPointForce );
-
- CPPUNIT_TEST( testInitialize );
- CPPUNIT_TEST( testIntegrateResidual );
- CPPUNIT_TEST( testVerifyConfiguration );
-
- CPPUNIT_TEST_SUITE_END();
-
- // PUBLIC METHODS /////////////////////////////////////////////////////
-public :
-
- /// Setup testing data.
- void setUp(void);
-
-}; // class TestPointForceTri3
-
-#endif // pylith_bc_pointforcebctri3_hh
-
-
-// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependent.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependent.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependent.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -34,15 +34,19 @@
void
pylith::bc::TestTimeDependent::testDBInitial(void)
{ // testDBInitial
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
spatialdata::spatialdb::UniformDB db;
bc.dbInitial(&db);
- CPPUNIT_ASSERT(0 != bc._dbInitial);
- CPPUNIT_ASSERT(0 == bc._dbRate);
- CPPUNIT_ASSERT(0 == bc._dbChange);
- CPPUNIT_ASSERT(0 == bc._dbTimeHistory);
+ CPPUNIT_ASSERT(bc._dbInitial);
+ CPPUNIT_ASSERT(!bc._dbRate);
+ CPPUNIT_ASSERT(!bc._dbChange);
+ CPPUNIT_ASSERT(!bc._dbTimeHistory);
+
+ PYLITH_METHOD_END;
} // testDBInitial
// ----------------------------------------------------------------------
@@ -50,15 +54,19 @@
void
pylith::bc::TestTimeDependent::testDBRate(void)
{ // testDBRate
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
spatialdata::spatialdb::UniformDB db;
bc.dbRate(&db);
- CPPUNIT_ASSERT(0 == bc._dbInitial);
- CPPUNIT_ASSERT(0 != bc._dbRate);
- CPPUNIT_ASSERT(0 == bc._dbChange);
- CPPUNIT_ASSERT(0 == bc._dbTimeHistory);
+ CPPUNIT_ASSERT(!bc._dbInitial);
+ CPPUNIT_ASSERT(bc._dbRate);
+ CPPUNIT_ASSERT(!bc._dbChange);
+ CPPUNIT_ASSERT(!bc._dbTimeHistory);
+
+ PYLITH_METHOD_END;
} // testDBRate
// ----------------------------------------------------------------------
@@ -66,15 +74,19 @@
void
pylith::bc::TestTimeDependent::testDBChange(void)
{ // testDBChange
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
spatialdata::spatialdb::UniformDB db;
bc.dbChange(&db);
- CPPUNIT_ASSERT(0 == bc._dbInitial);
- CPPUNIT_ASSERT(0 == bc._dbRate);
- CPPUNIT_ASSERT(0 != bc._dbChange);
- CPPUNIT_ASSERT(0 == bc._dbTimeHistory);
+ CPPUNIT_ASSERT(!bc._dbInitial);
+ CPPUNIT_ASSERT(!bc._dbRate);
+ CPPUNIT_ASSERT(bc._dbChange);
+ CPPUNIT_ASSERT(!bc._dbTimeHistory);
+
+ PYLITH_METHOD_END;
} // testDBChange
// ----------------------------------------------------------------------
@@ -82,15 +94,19 @@
void
pylith::bc::TestTimeDependent::testDBTimeHistory(void)
{ // testDBTimeHistory
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
spatialdata::spatialdb::TimeHistory th;
bc.dbTimeHistory(&th);
- CPPUNIT_ASSERT(0 == bc._dbInitial);
- CPPUNIT_ASSERT(0 == bc._dbRate);
- CPPUNIT_ASSERT(0 == bc._dbChange);
- CPPUNIT_ASSERT(0 != bc._dbTimeHistory);
+ CPPUNIT_ASSERT(!bc._dbInitial);
+ CPPUNIT_ASSERT(!bc._dbRate);
+ CPPUNIT_ASSERT(!bc._dbChange);
+ CPPUNIT_ASSERT(bc._dbTimeHistory);
+
+ PYLITH_METHOD_END;
} // testDBTimeHistory
// ----------------------------------------------------------------------
@@ -98,6 +114,8 @@
void
pylith::bc::TestTimeDependent::testVerifyConfiguration(void)
{ // testVerifyConfiguration
+ PYLITH_METHOD_BEGIN;
+
topology::Mesh mesh;
spatialdata::spatialdb::UniformDB db;
spatialdata::spatialdb::TimeHistory th;
@@ -129,6 +147,7 @@
std::runtime_error);
} // change (missing change)
+ PYLITH_METHOD_END;
} // testVerifyConfiguration
Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependentPoints.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependentPoints.cc 2013-04-03 18:42:56 UTC (rev 21705)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestTimeDependentPoints.cc 2013-04-03 19:31:24 UTC (rev 21706)
@@ -25,6 +25,7 @@
#include "pylith/topology/Mesh.hh" // USES Mesh
#include "pylith/topology/Field.hh" // USES Field
#include "pylith/topology/Fields.hh" // USES Fields
+#include "pylith/topology/VisitorMesh.hh" // USES VecVisitormesh
#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
@@ -105,8 +106,7 @@
static
void _checkValues(const PylithScalar* valuesE,
const int fiberDimE,
- PetscSection section,
- Vec vec,
+ const topology::Field<topology::Mesh>& field,
const PylithScalar scale);
} // _TestTimeDependentPoints
} // bc
@@ -117,9 +117,11 @@
void
pylith::bc::TestTimeDependentPoints::setUp(void)
{ // setUp
+ PYLITH_METHOD_BEGIN;
+
const char* filename = "data/tri3.mesh";
- _mesh = new topology::Mesh();
+ _mesh = new topology::Mesh();CPPUNIT_ASSERT(_mesh);
meshio::MeshIOAscii iohandler;
iohandler.filename(filename);
iohandler.read(_mesh);
@@ -135,11 +137,13 @@
normalizer.timeScale(_TestTimeDependentPoints::timeScale);
_mesh->nondimensionalize(normalizer);
- _bc = new PointForce();
+ _bc = new PointForce();CPPUNIT_ASSERT(_bc);
_bc->label("bc");
_bc->normalizer(normalizer);
_bc->bcDOF(_TestTimeDependentPoints::bcDOF, _TestTimeDependentPoints::numBCDOF);
_bc->_getPoints(*_mesh);
+
+ PYLITH_METHOD_END;
} // setUp
// ----------------------------------------------------------------------
@@ -147,8 +151,12 @@
void
pylith::bc::TestTimeDependentPoints::tearDown(void)
{ // tearDown
+ PYLITH_METHOD_BEGIN;
+
delete _mesh; _mesh = 0;
delete _bc; _bc = 0;
+
+ PYLITH_METHOD_END;
} // tearDown
// ----------------------------------------------------------------------
@@ -156,6 +164,8 @@
void
pylith::bc::TestTimeDependentPoints::testBCDOF(void)
{ // testBCDOF
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
const size_t numDOF = 4;
@@ -165,6 +175,8 @@
CPPUNIT_ASSERT_EQUAL(numDOF, bc._bcDOF.size());
for (int i=0; i < numDOF; ++i)
CPPUNIT_ASSERT_EQUAL(fixedDOF[i], bc._bcDOF[i]);
+
+ PYLITH_METHOD_END;
} // testBCDOF
// ----------------------------------------------------------------------
@@ -172,11 +184,15 @@
void
pylith::bc::TestTimeDependentPoints::testGetLabel(void)
{ // testGetLabel
+ PYLITH_METHOD_BEGIN;
+
PointForce bc;
const std::string& label = "point force";
bc.label(label.c_str());
CPPUNIT_ASSERT_EQUAL(label, std::string(bc._getLabel()));
+
+ PYLITH_METHOD_END;
} // testGetLabel
// ----------------------------------------------------------------------
@@ -184,6 +200,8 @@
void
pylith::bc::TestTimeDependentPoints::testQueryDatabases(void)
{ // testQueryDatabases
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -225,35 +243,22 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check initial values.
- PetscSection initialSection = _bc->_parameters->get("initial").petscSection();
- Vec initialVec = _bc->_parameters->get("initial").localVector();
- CPPUNIT_ASSERT(initialSection);CPPUNIT_ASSERT(initialVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::initial, numBCDOF, initialSection, initialVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::initial, numBCDOF, _bc->_parameters->get("initial"), forceScale);
// Check rate values.
- PetscSection rateSection = _bc->_parameters->get("rate").petscSection();
- Vec rateVec = _bc->_parameters->get("rate").localVector();
- CPPUNIT_ASSERT(rateSection);CPPUNIT_ASSERT(rateVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::rate, numBCDOF, rateSection, rateVec, forceScale/timeScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::rate, numBCDOF, _bc->_parameters->get("rate"), forceScale/timeScale);
// Check rate start time.
- PetscSection rateTimeSection = _bc->_parameters->get("rate time").petscSection();
- Vec rateTimeVec = _bc->_parameters->get("rate time").localVector();
- CPPUNIT_ASSERT(rateTimeSection);CPPUNIT_ASSERT(rateTimeVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::rateTime, 1, rateTimeSection, rateTimeVec, timeScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::rateTime, 1, _bc->_parameters->get("rate time"), timeScale);
// Check change values.
- PetscSection changeSection = _bc->_parameters->get("change").petscSection();
- Vec changeVec = _bc->_parameters->get("change").localVector();
- CPPUNIT_ASSERT(changeSection);CPPUNIT_ASSERT(changeVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::change, numBCDOF, changeSection, changeVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::change, numBCDOF, _bc->_parameters->get("change"), forceScale);
// Check change start time.
- PetscSection changeTimeSection = _bc->_parameters->get("change time").petscSection();
- Vec changeTimeVec = _bc->_parameters->get("change time").localVector();
- CPPUNIT_ASSERT(changeTimeSection);CPPUNIT_ASSERT(changeTimeVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::changeTime, 1, changeTimeSection, changeTimeVec, timeScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::changeTime, 1, _bc->_parameters->get("change time"), timeScale);
th.close();
+
+ PYLITH_METHOD_END;
} // testQueryDatabases
// ----------------------------------------------------------------------
@@ -261,6 +266,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueInitial(void)
{ // testCalculateValueInitial
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -285,10 +292,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::initial, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::initial, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueInitial
// ----------------------------------------------------------------------
@@ -296,6 +302,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueRate(void)
{ // testCalculateValueRate
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -320,10 +328,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesRate, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesRate, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueRate
// ----------------------------------------------------------------------
@@ -331,6 +338,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueChange(void)
{ // testCalculateValueChange
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -355,10 +364,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesChange, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesChange, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueChange
// ----------------------------------------------------------------------
@@ -366,6 +374,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueChangeTH(void)
{ // testCalculateValueChangeTH
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_bc);
spatialdata::spatialdb::SimpleDB dbChange("TestTimeDependentPoints _queryDatabases");
@@ -393,10 +403,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesChangeTH, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesChangeTH, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueChangeTH
// ----------------------------------------------------------------------
@@ -404,6 +413,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueAll(void)
{ // testCalculateValueAll
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -454,10 +465,9 @@
_TestTimeDependentPoints::valuesRate[i] +
_TestTimeDependentPoints::valuesChangeTH[i];
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(&valuesE[0], numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(&valuesE[0], numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueAll
// ----------------------------------------------------------------------
@@ -465,6 +475,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueIncrInitial(void)
{ // testCalculateValueIncrInitial
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -491,10 +503,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrInitial, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrInitial, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueIncrInitial
// ----------------------------------------------------------------------
@@ -502,6 +513,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueIncrRate(void)
{ // testCalculateValueIncrRate
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -528,10 +541,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrRate, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrRate, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueIncrRate
// ----------------------------------------------------------------------
@@ -539,6 +551,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueIncrChange(void)
{ // testCalculateValueIncrChange
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -565,10 +579,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrChange, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrChange, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueIncrChange
// ----------------------------------------------------------------------
@@ -576,6 +589,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueIncrChangeTH(void)
{ // testCalculateValueIncrChangeTH
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_bc);
spatialdata::spatialdb::SimpleDB dbChange("TestTimeDependentPoints _queryDatabases");
@@ -605,10 +620,9 @@
CPPUNIT_ASSERT(_bc->_parameters);
// Check values.
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrChangeTH, numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(_TestTimeDependentPoints::valuesIncrChangeTH, numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueIncrChangeTH
// ----------------------------------------------------------------------
@@ -616,6 +630,8 @@
void
pylith::bc::TestTimeDependentPoints::testCalculateValueIncrAll(void)
{ // testCalculateValueIncrAll
+ PYLITH_METHOD_BEGIN;
+
CPPUNIT_ASSERT(_mesh);
CPPUNIT_ASSERT(_bc);
@@ -668,10 +684,9 @@
_TestTimeDependentPoints::valuesIncrRate[i] +
_TestTimeDependentPoints::valuesIncrChangeTH[i];
- PetscSection valueSection = _bc->_parameters->get("value").petscSection();
- Vec valueVec = _bc->_parameters->get("value").localVector();
- CPPUNIT_ASSERT(valueSection);CPPUNIT_ASSERT(valueVec);
- _TestTimeDependentPoints::_checkValues(&valuesE[0], numBCDOF, valueSection, valueVec, forceScale);
+ _TestTimeDependentPoints::_checkValues(&valuesE[0], numBCDOF, _bc->_parameters->get("value"), forceScale);
+
+ PYLITH_METHOD_END;
} // testCalculateValueIncrAll
// ----------------------------------------------------------------------
@@ -679,30 +694,29 @@
void
pylith::bc::_TestTimeDependentPoints::_checkValues(const PylithScalar* valuesE,
const int fiberDimE,
- PetscSection section,
- Vec vec,
+ const topology::Field<topology::Mesh>& field,
const PylithScalar scale)
{ // _checkValues
- CPPUNIT_ASSERT(section);CPPUNIT_ASSERT(vec);
- PetscScalar *array;
- PetscErrorCode err;
+ PYLITH_METHOD_BEGIN;
+
+ topology::VecVisitorMesh fieldVisitor(field);
+ const PetscScalar* fieldArray = fieldVisitor.localArray();CPPUNIT_ASSERT(fieldArray);
const PylithScalar tolerance = 1.0e-06;
// Check values at points associated with BC.
const int npointsIn = _TestTimeDependentPoints::npointsIn;
- err = VecGetArray(vec, &array);CHECK_PETSC_ERROR(err);
for (int i=0; i < npointsIn; ++i) {
- PetscInt dof, off;
const int p_bc = _TestTimeDependentPoints::pointsIn[i];
-
- err = PetscSectionGetDof(section, p_bc, &dof);CHECK_PETSC_ERROR(err);
- err = PetscSectionGetOffset(section, p_bc, &off);CHECK_PETSC_ERROR(err);
- CPPUNIT_ASSERT_EQUAL(fiberDimE, dof);
+
+ const PetscInt off = fieldVisitor.sectionOffset(p_bc);
+ CPPUNIT_ASSERT_EQUAL(fiberDimE, fieldVisitor.sectionDof(p_bc));
+
for (int iDim=0; iDim < fiberDimE; ++iDim)
- CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesE[i*fiberDimE+iDim]/scale, array[off+iDim], tolerance);
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(valuesE[i*fiberDimE+iDim]/scale, fieldArray[off+iDim], tolerance);
} // for
- err = VecRestoreArray(vec, &array);CHECK_PETSC_ERROR(err);
+
+ PYLITH_METHOD_END;
} // _checkValues
More information about the CIG-COMMITS
mailing list