[cig-commits] r20025 - in short/3D/PyLith/branches/v1.7-trunk: libsrc/pylith/faults unittests/libtests/faults unittests/libtests/faults/data
brad at geodynamics.org
brad at geodynamics.org
Wed May 2 16:32:42 PDT 2012
Author: brad
Date: 2012-05-02 16:32:42 -0700 (Wed, 02 May 2012)
New Revision: 20025
Added:
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8_impulses.spatialdb
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4_impulses.spatialdb
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4_impulses.spatialdb
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3_impulses.spatialdb
Removed:
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8traction.mesh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4traction.mesh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4traction.mesh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3traction.mesh
Modified:
short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/Makefile.am
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.hh
short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/Makefile.am
Log:
Finished FaultCoehesiveImpulses implementation. Added C++ unit tests.
Modified: short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/libsrc/pylith/faults/FaultCohesiveImpulses.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -249,15 +249,10 @@
return buffer;
} else if (0 == strcasecmp("impulse_amplitude", name)) {
- topology::Field<topology::SubMesh>& buffer =
- _fields->get("buffer (scalar)");
- return buffer;
+ topology::Field<topology::SubMesh>& amplitude =
+ _fields->get("impulse amplitude");
+ return amplitude;
- } else if (0 == strcasecmp("impulses", name)) {
- topology::Field<topology::SubMesh>& buffer =
- _fields->get("buffer (scalar)");
- return buffer;
-
} else if (0 == strcasecmp("traction_change", name)) {
assert(fields);
const topology::Field<topology::Mesh>& dispT = fields->get("disp(t)");
@@ -369,10 +364,10 @@
// Close properties database
_dbImpulseAmp->close();
- amplitude.view("IMPULSE AMPLITUDE"); // DEBUGGING
+ //amplitude.view("IMPULSE AMPLITUDE"); // DEBUGGING
_setupImpulseOrder(pointOrder);
-} // _setupImpulss
+} // _setupImpulses
// ----------------------------------------------------------------------
@@ -399,7 +394,7 @@
localOffset += numImpulsesAll[i];
} // for
- const int ncomps = numComponents(); // number of components per point
+ const int ncomps = _impulseDOF.size();
_impulsePoints.clear();
ImpulseInfoStruct impulseInfo;
@@ -409,12 +404,13 @@
const int offset = localOffset+piter->second;
for (int icomp=0; icomp < ncomps; ++icomp) {
const int impulse = ncomps*offset + icomp;
- impulseInfo.indexDOF = icomp;
+ impulseInfo.indexDOF = _impulseDOF[icomp];
_impulsePoints[impulse] = impulseInfo;
+ std::cout << "Adding impulse " << impulse << ", iCohesive: " << impulseInfo.indexCohesive << ", offset: " << offset << ", icomp: " << impulseInfo.indexDOF << std::endl;
} // for
} // for
-#if 1 // DEBUGGING
+#if 0 // DEBUGGING
int impulse = 0;
for (int irank=0; irank < commSize; ++irank) {
MPI_Barrier(comm);
@@ -469,11 +465,11 @@
assert(indexDOF >= 0 && indexDOF < spaceDim);
dispRelVertex[indexDOF] = amplitudeVertex[0];
- assert(dispRelVertex.size() == dispRelSection->getFiberDimension(v_lagrange));
- dispRelSection->updatePoint(v_lagrange, &dispRelVertex[0]);
+ assert(dispRelVertex.size() == dispRelSection->getFiberDimension(v_fault));
+ dispRelSection->updatePoint(v_fault, &dispRelVertex[0]);
} // if
- dispRel.view("DISP RELATIVE"); // DEBUGGING
+ //dispRel.view("DISP RELATIVE"); // DEBUGGING
} // _setRelativeDisp
Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/Makefile.am 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/Makefile.am 2012-05-02 23:32:42 UTC (rev 20025)
@@ -57,6 +57,8 @@
TestFaultCohesiveDynQuad4.cc \
TestFaultCohesiveDynTet4.cc \
TestFaultCohesiveDynHex8.cc \
+ TestFaultCohesiveImpulses.cc \
+ TestFaultCohesiveImpulsesCases.cc \
test_faults.cc
@@ -90,7 +92,9 @@
TestFaultCohesiveDynTri3d.hh \
TestFaultCohesiveDynQuad4.hh \
TestFaultCohesiveDynTet4.hh \
- TestFaultCohesiveDynHex8.hh
+ TestFaultCohesiveDynHex8.hh \
+ TestFaultCohesiveImpulses.hh \
+ TestFaultCohesiveImpulsesCases.hh
# Source files associated with testing data
testfaults_SOURCES += \
@@ -153,7 +157,12 @@
data/CohesiveDynDataTri3d.cc \
data/CohesiveDynDataQuad4.cc \
data/CohesiveDynDataTet4.cc \
- data/CohesiveDynDataHex8.cc
+ data/CohesiveDynDataHex8.cc \
+ data/CohesiveImpulsesData.cc \
+ data/CohesiveImpulsesDataTri3.cc \
+ data/CohesiveImpulsesDataQuad4.cc \
+ data/CohesiveImpulsesDataTet4.cc \
+ data/CohesiveImpulsesDataHex8.cc
noinst_HEADERS += \
data/CohesiveData.hh \
@@ -215,7 +224,12 @@
data/CohesiveDynDataTri3d.hh \
data/CohesiveDynDataQuad4.hh \
data/CohesiveDynDataTet4.hh \
- data/CohesiveDynDataHex8.hh
+ data/CohesiveDynDataHex8.hh \
+ data/CohesiveImpulsesData.hh \
+ data/CohesiveImpulsesDataTri3.hh \
+ data/CohesiveImpulsesDataQuad4.hh \
+ data/CohesiveImpulsesDataTet4.hh \
+ data/CohesiveImpulsesDataHex8.hh
AM_CPPFLAGS = \
$(PYTHON_EGG_CPPFLAGS) -I$(PYTHON_INCDIR) \
Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveDyn.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -24,8 +24,6 @@
#include "data/CohesiveDynData.hh" // USES CohesiveDynData
-#include "pylith/faults/EqKinSrc.hh" // USES EqKinSrc
-#include "pylith/faults/BruneSlipFn.hh" // USES BruneSlipFn
#include "pylith/topology/Mesh.hh" // USES Mesh
#include "pylith/topology/SubMesh.hh" // USES SubMesh
#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.cc (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,390 @@
+// -*- 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 "TestFaultCohesiveImpulses.hh" // Implementation of class methods
+
+#include "pylith/faults/FaultCohesiveImpulses.hh" // USES FaultCohesiveImpulses
+
+#include "data/CohesiveImpulsesData.hh" // USES CohesiveImpulsesData
+
+#include "pylith/topology/Mesh.hh" // USES Mesh
+#include "pylith/topology/SubMesh.hh" // USES SubMesh
+#include "pylith/feassemble/Quadrature.hh" // USES Quadrature
+#include "pylith/topology/SolutionFields.hh" // USES SolutionFields
+#include "pylith/topology/Jacobian.hh" // USES Jacobian
+#include "pylith/meshio/MeshIOAscii.hh" // USES MeshIOAscii
+
+#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
+#include "spatialdata/spatialdb/SimpleDB.hh" // USES SimpleDB
+#include "spatialdata/spatialdb/SimpleIOAscii.hh" // USES SimpleIOAscii
+
+#include <stdexcept> // USES runtime_error
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesiveImpulses );
+
+// ----------------------------------------------------------------------
+typedef pylith::topology::Mesh::SieveMesh SieveMesh;
+typedef pylith::topology::Mesh::RealSection RealSection;
+typedef pylith::topology::SubMesh::SieveMesh SieveSubMesh;
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::faults::TestFaultCohesiveImpulses::setUp(void)
+{ // setUp
+ _data = 0;
+ _quadrature = new feassemble::Quadrature<topology::SubMesh>();
+ CPPUNIT_ASSERT(0 != _quadrature);
+ _dbImpulseAmp = 0;
+ _flipFault = false;
+} // setUp
+
+// ----------------------------------------------------------------------
+// Tear down testing data.
+void
+pylith::faults::TestFaultCohesiveImpulses::tearDown(void)
+{ // tearDown
+ delete _data; _data = 0;
+ delete _quadrature; _quadrature = 0;
+ delete _dbImpulseAmp; _dbImpulseAmp = 0;
+} // tearDown
+
+// ----------------------------------------------------------------------
+// Test constructor.
+void
+pylith::faults::TestFaultCohesiveImpulses::testConstructor(void)
+{ // testConstructor
+ FaultCohesiveImpulses fault;
+} // testConstructor
+
+// ----------------------------------------------------------------------
+// Test dbImpulseAmp().
+void
+pylith::faults::TestFaultCohesiveImpulses::testDBImpulseAmp(void)
+{ // testDBImpulseAmp
+ FaultCohesiveImpulses fault;
+
+ const std::string& label = "test database";
+ spatialdata::spatialdb::SimpleDB db;
+ db.label(label.c_str());
+ fault.dbImpulseAmp(&db);
+ CPPUNIT_ASSERT(fault._dbImpulseAmp);
+ CPPUNIT_ASSERT_EQUAL(label, std::string(fault._dbImpulseAmp->label()));
+ } // testDBImpulseAmp
+
+// ----------------------------------------------------------------------
+// Test threshold().
+void
+pylith::faults::TestFaultCohesiveImpulses::testThreshold(void)
+{ // testThreshold
+ FaultCohesiveImpulses fault;
+
+ CPPUNIT_ASSERT_EQUAL(PylithScalar(1.0e-6), fault._threshold); // default
+
+ const PylithScalar value = 1.0e-20;
+ fault.threshold(value);
+ CPPUNIT_ASSERT_EQUAL(value, fault._threshold);
+ } // testThreshold
+
+// ----------------------------------------------------------------------
+// Test impulseDOF().
+void
+pylith::faults::TestFaultCohesiveImpulses::testImpulseDOF(void)
+{ // testImpulseDOF
+ FaultCohesiveImpulses fault;
+
+ const int ncomps = 2;
+ const int dof[ncomps] = { 0, 2 };
+ fault.impulseDOF(dof, ncomps);
+
+ CPPUNIT_ASSERT_EQUAL(ncomps, fault.numComponents());
+ CPPUNIT_ASSERT_EQUAL(ncomps, int(fault._impulseDOF.size()));
+ for (int i=0; i < ncomps; ++i) {
+ CPPUNIT_ASSERT_EQUAL(dof[i], fault._impulseDOF[i]);
+ } // for
+ } // testImpulseDOF
+
+// ----------------------------------------------------------------------
+// Test numImpulses().
+void
+pylith::faults::TestFaultCohesiveImpulses::testNumImpulses(void)
+{ // testNumImpulses
+ CPPUNIT_ASSERT(_data);
+
+ topology::Mesh mesh;
+ FaultCohesiveImpulses fault;
+ topology::SolutionFields fields(mesh);
+ _initialize(&mesh, &fault, &fields);
+
+ const int ncomps = 2;
+ const int dof[ncomps] = { 0, 2 };
+ fault.impulseDOF(dof, ncomps);
+
+ CPPUNIT_ASSERT_EQUAL(_data->numImpulses, fault.numImpulses());
+ } // testNumImpulses
+
+// ----------------------------------------------------------------------
+// Test initialize().
+void
+pylith::faults::TestFaultCohesiveImpulses::testInitialize(void)
+{ // testInitialize
+ CPPUNIT_ASSERT(_data);
+
+ topology::Mesh mesh;
+ FaultCohesiveImpulses fault;
+ topology::SolutionFields fields(mesh);
+ _initialize(&mesh, &fault, &fields);
+
+ const ALE::Obj<SieveSubMesh>& faultSieveMesh = fault._faultMesh->sieveMesh();
+ CPPUNIT_ASSERT(!faultSieveMesh.isNull());
+ SieveSubMesh::renumbering_type& renumbering =
+ faultSieveMesh->getRenumbering();
+ const ALE::Obj<SieveSubMesh::label_sequence>& vertices =
+ faultSieveMesh->depthStratum(0);
+ CPPUNIT_ASSERT(!vertices.isNull());
+ const SieveSubMesh::label_sequence::iterator verticesBegin = vertices->begin();
+ const SieveSubMesh::label_sequence::iterator verticesEnd = vertices->end();
+ int iVertex = 0;
+ for (SieveSubMesh::label_sequence::iterator v_iter=verticesBegin;
+ v_iter != verticesEnd;
+ ++v_iter, ++iVertex) {
+ CPPUNIT_ASSERT(renumbering.find(_data->constraintVertices[iVertex]) !=
+ renumbering.end());
+ CPPUNIT_ASSERT_EQUAL(renumbering[_data->constraintVertices[iVertex]],
+ *v_iter);
+ } // for
+ CPPUNIT_ASSERT_EQUAL(_data->numConstraintVert, iVertex);
+
+ // Check orientation
+ //fault._fields->get("orientation").view("ORIENTATION"); // DEBUGGING
+
+ const ALE::Obj<RealSection>& orientationSection =
+ fault._fields->get("orientation").section();
+ CPPUNIT_ASSERT(!orientationSection.isNull());
+ const int spaceDim = _data->spaceDim;
+ const int orientationSize = spaceDim*spaceDim;
+ iVertex = 0;
+ for (SieveSubMesh::label_sequence::iterator v_iter=verticesBegin;
+ v_iter != verticesEnd;
+ ++v_iter, ++iVertex) {
+ const int fiberDim = orientationSection->getFiberDimension(*v_iter);
+ CPPUNIT_ASSERT_EQUAL(orientationSize, fiberDim);
+ const PylithScalar* orientationVertex =
+ orientationSection->restrictPoint(*v_iter);
+ CPPUNIT_ASSERT(0 != orientationVertex);
+
+ const PylithScalar tolerance = 1.0e-06;
+ for (int i=0; i < orientationSize; ++i) {
+ const int index = iVertex*orientationSize+i;
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->orientation[index],
+ orientationVertex[i], tolerance);
+ } // for
+ } // for
+
+ // Initial tractions
+ if (fault._dbImpulseAmp) {
+ //fault._fields->get("initial traction").view("INITIAL TRACTIONS"); // DEBUGGING
+ const ALE::Obj<RealSection>& amplitudeSection =
+ fault._fields->get("impulse amplitude").section();
+ CPPUNIT_ASSERT(!amplitudeSection.isNull());
+ const int spaceDim = _data->spaceDim;
+ iVertex = 0;
+ for (SieveSubMesh::label_sequence::iterator v_iter = verticesBegin;
+ v_iter != verticesEnd;
+ ++v_iter, ++iVertex) {
+ const int fiberDim = amplitudeSection->getFiberDimension(*v_iter);
+ CPPUNIT_ASSERT_EQUAL(1, fiberDim);
+ const PylithScalar* amplitudeVertex = amplitudeSection->restrictPoint(*v_iter);
+ CPPUNIT_ASSERT(amplitudeVertex);
+
+ const PylithScalar tolerance = 1.0e-06;
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(_data->amplitude[iVertex], amplitudeVertex[0], tolerance);
+ } // for
+ } // if
+} // testInitialize
+
+// ----------------------------------------------------------------------
+// Test integrateResidual().
+void
+pylith::faults::TestFaultCohesiveImpulses::testIntegrateResidual(void)
+{ // testIntegrateResidual
+ CPPUNIT_ASSERT(_data);
+ CPPUNIT_ASSERT(_data->fieldT);
+ CPPUNIT_ASSERT(_data->residualIncr);
+
+ topology::Mesh mesh;
+ FaultCohesiveImpulses fault;
+ topology::SolutionFields fields(mesh);
+ _initialize(&mesh, &fault, &fields);
+
+ const int spaceDim = _data->spaceDim;
+ topology::Field<topology::Mesh>& residual = fields.get("residual");
+ const ALE::Obj<RealSection>& residualSection = residual.section();
+ CPPUNIT_ASSERT(!residualSection.isNull());
+
+ const ALE::Obj<RealSection>& dispSection = fields.get("disp(t)").section();
+ CPPUNIT_ASSERT(!dispSection.isNull());
+
+ const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
+ CPPUNIT_ASSERT(!sieveMesh.isNull());
+ const ALE::Obj<SieveMesh::label_sequence>& vertices = sieveMesh->depthStratum(0);
+ CPPUNIT_ASSERT(!vertices.isNull());
+ const SieveMesh::label_sequence::iterator verticesBegin = vertices->begin();
+ const SieveMesh::label_sequence::iterator verticesEnd = vertices->end();
+ int iVertex = 0;
+ for (SieveMesh::label_sequence::iterator v_iter=verticesBegin;
+ v_iter != verticesEnd;
+ ++v_iter, ++iVertex)
+ dispSection->updatePoint(*v_iter, &_data->fieldT[iVertex*spaceDim]);
+
+ const PylithScalar t = 1.0;
+ const PylithScalar dt = 1.0;
+ fault.timeStep(dt);
+
+ residual.zero();
+ { // Integrate residual with disp increment.
+ fault.integrateResidual(residual, t, &fields);
+
+ residual.view("RESIDUAL"); // DEBUGGING
+
+ // Check values
+ const PylithScalar* valsE = _data->residualIncr;
+ iVertex = 0;
+ const int fiberDimE = spaceDim;
+ const PylithScalar tolerance = (sizeof(double) == sizeof(PylithScalar)) ? 1.0e-06 : 1.0e-05;
+ for (SieveMesh::label_sequence::iterator v_iter=verticesBegin;
+ v_iter != verticesEnd;
+ ++v_iter, ++iVertex) {
+ const int fiberDim = residualSection->getFiberDimension(*v_iter);
+ CPPUNIT_ASSERT_EQUAL(fiberDimE, fiberDim);
+ const PylithScalar* vals = residualSection->restrictPoint(*v_iter);
+ CPPUNIT_ASSERT(0 != vals);
+
+ for (int i = 0; i < fiberDimE; ++i) {
+ const int index = iVertex * spaceDim + i;
+ const PylithScalar valE = valsE[index];
+ if (fabs(valE) > tolerance)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[i]/valE, tolerance);
+ else
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(valE, vals[i], tolerance);
+ } // for
+ } // for
+ } // Integrate residual with disp increment.
+} // testIntegrateResidual
+
+// ----------------------------------------------------------------------
+// Initialize FaultCohesiveImpulses interface condition.
+void
+pylith::faults::TestFaultCohesiveImpulses::_initialize(
+ topology::Mesh* const mesh,
+ FaultCohesiveImpulses* const fault,
+ topology::SolutionFields* const fields)
+{ // _initialize
+ CPPUNIT_ASSERT(mesh);
+ CPPUNIT_ASSERT(fault);
+ CPPUNIT_ASSERT(fields);
+ CPPUNIT_ASSERT(_data);
+ CPPUNIT_ASSERT(_quadrature);
+
+ meshio::MeshIOAscii iohandler;
+ iohandler.filename(_data->meshFilename);
+ iohandler.read(mesh);
+
+ //mesh->debug(true); // DEBUGGING
+
+ _quadrature->initialize(_data->basis, _data->numQuadPts, _data->numBasis,
+ _data->basisDeriv,
+ _data->numQuadPts, _data->numBasis, _data->cellDim,
+ _data->quadPts, _data->numQuadPts, _data->cellDim,
+ _data->quadWts, _data->numQuadPts,
+ _data->spaceDim);
+
+ // Setup impulse amplitude
+ spatialdata::spatialdb::SimpleDB* db =
+ new spatialdata::spatialdb::SimpleDB("impulse amplitude");
+ CPPUNIT_ASSERT(db);
+ spatialdata::spatialdb::SimpleIOAscii ioImpulseAmp;
+ ioImpulseAmp.filename(_data->impulseAmpFilename);
+ db->ioHandler(&ioImpulseAmp);
+ delete _dbImpulseAmp; _dbImpulseAmp = db;
+ fault->dbImpulseAmp(db);
+
+ CPPUNIT_ASSERT(_data->impulseDOF);
+ fault->impulseDOF(_data->impulseDOF, _data->numComponents);
+
+ int firstFaultVertex = 0;
+ int firstLagrangeVertex = mesh->sieveMesh()->getIntSection(_data->label)->size();
+ int firstFaultCell = mesh->sieveMesh()->getIntSection(_data->label)->size();
+ if (fault->useLagrangeConstraints())
+ firstFaultCell += mesh->sieveMesh()->getIntSection(_data->label)->size();
+ fault->id(_data->id);
+ fault->label(_data->label);
+ fault->quadrature(_quadrature);
+
+ fault->adjustTopology(mesh, &firstFaultVertex, &firstLagrangeVertex,
+ &firstFaultCell, _flipFault);
+
+ spatialdata::geocoords::CSCart cs;
+ spatialdata::units::Nondimensional normalizer;
+ cs.setSpaceDim(mesh->dimension());
+ cs.initialize();
+ mesh->coordsys(&cs);
+ mesh->nondimensionalize(normalizer);
+
+ const PylithScalar upDir[3] = { 0.0, 0.0, 1.0 };
+
+ fault->initialize(*mesh, upDir);
+
+ // Setup fields
+ fields->add("disp(t)", "displacement");
+ fields->add("dispIncr(t->t+dt)", "displacement_increment");
+ fields->add("velocity(t)", "velocity");
+ fields->add("residual", "residual");
+ fields->solutionName("dispIncr(t->t+dt)");
+
+ const int spaceDim = _data->spaceDim;
+ topology::Field<topology::Mesh>& disp = fields->get("disp(t)");
+ disp.newSection(topology::FieldBase::VERTICES_FIELD, spaceDim);
+ disp.allocate();
+ fields->copyLayout("disp(t)");
+
+ fault->verifyConfiguration(*mesh);
+} // _initialize
+
+// ----------------------------------------------------------------------
+// Determine if vertex is a Lagrange multiplier constraint vertex.
+bool
+pylith::faults::TestFaultCohesiveImpulses::_isConstraintVertex(const int vertex) const
+{ // _isConstraintVertex
+ assert(0 != _data);
+
+ const int numConstraintVert = _data->numConstraintVert;
+ bool isFound = false;
+ for (int i=0; i < _data->numConstraintVert; ++i)
+ if (_data->constraintVertices[i] == vertex) {
+ isFound = true;
+ break;
+ } // if
+ return isFound;
+} // _isConstraintVertex
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.hh (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulses.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,129 @@
+// -*- 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/faults/TestFaultCohesiveImpulses.hh
+ *
+ * @brief C++ TestFaultCohesiveImpulses object
+ *
+ * C++ unit testing for FaultCohesiveImpulses.
+ */
+
+#if !defined(pylith_faults_testfaultcohesiveimpulses_hh)
+#define pylith_faults_testfaultcohesiveimpulses_hh
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "pylith/faults/faultsfwd.hh" // forward declarations
+#include "pylith/topology/topologyfwd.hh" // USES Mesh, SubMesh
+#include "pylith/feassemble/feassemblefwd.hh" // HOLDSA Quadrature
+#include "pylith/friction/frictionfwd.hh" // HOLDSA FrictionModel
+#include "spatialdata/spatialdb/spatialdbfwd.hh" // HOLDSA SpatialDB
+#include <vector> // HASA std::vector
+/// Namespace for pylith package
+namespace pylith {
+ namespace faults {
+ class TestFaultCohesiveImpulses;
+
+ class CohesiveImpulsesData;
+ } // faults
+} // pylith
+
+/// C++ unit testing for FaultCohesiveImpulses
+class pylith::faults::TestFaultCohesiveImpulses: public CppUnit::TestFixture
+{ // class TestFaultCohesiveImpulses
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestFaultCohesiveImpulses );
+
+ CPPUNIT_TEST( testConstructor );
+ CPPUNIT_TEST( testDBImpulseAmp );
+ CPPUNIT_TEST( testThreshold );
+ CPPUNIT_TEST( testImpulseDOF );
+
+ // Tests in derived classes:
+ // testNumImpulses()
+ // testInitialize()
+ // testIntegrateResidual()
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PROTECTED MEMBERS //////////////////////////////////////////////////
+protected:
+
+ CohesiveImpulsesData* _data; ///< Data for testing
+ feassemble::Quadrature<topology::SubMesh>* _quadrature; ///< Fault quad.
+ spatialdata::spatialdb::SpatialDB* _dbImpulseAmp; ///< Initial tractions.
+ bool _flipFault; ///< If true, flip fault orientation.
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public:
+
+ /// Setup testing data.
+ void setUp(void);
+
+ /// Tear down testing data.
+ void tearDown(void);
+
+ /// Test constructor.
+ void testConstructor(void);
+
+ /// Test dbInitialTract().
+ void testDBImpulseAmp(void);
+
+ /// Test threshold().
+ void testThreshold(void);
+
+ /// Test impulseDOF().
+ void testImpulseDOF(void);
+
+ /// Test numImpulses().
+ void testNumImpulses(void);
+
+ /// Test initialize().
+ void testInitialize(void);
+
+ /// Test integrateResidual().
+ void testIntegrateResidual(void);
+
+ // PRIVATE METHODS ////////////////////////////////////////////////////
+private:
+
+ /** Initialize FaultCohesiveImpulses interface condition.
+ *
+ * @param mesh PETSc mesh to initialize
+ * @param fault Cohesive fault interface condition to initialize.
+ * @param fields Solution fields.
+ */
+ void _initialize(topology::Mesh* const mesh,
+ FaultCohesiveImpulses* const fault,
+ topology::SolutionFields* const fields);
+
+ /** Determine if vertex is a Lagrange multiplier constraint vertex.
+ *
+ * @param vertex Label of vertex.
+ *
+ * @returns True if vertex is a constraint vertex, false otherwise.
+ */
+ bool _isConstraintVertex(const int vertex) const;
+
+}; // class TestFaultCohesiveImpulses
+
+#endif // pylith_faults_testfaultcohesiveimpulses_hh
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.cc (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,102 @@
+// -*- 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 "TestFaultCohesiveImpulsesCases.hh" // Implementation of class methods
+
+#include "data/CohesiveImpulsesDataTri3.hh"
+#include "data/CohesiveImpulsesDataQuad4.hh"
+#include "data/CohesiveImpulsesDataTet4.hh"
+#include "data/CohesiveImpulsesDataHex8.hh"
+
+#include "pylith/topology/SubMesh.hh" // USES SubMesh
+#include "pylith/feassemble/Quadrature.hh" // USES Quadrature<SubMesh>
+#include "pylith/feassemble/GeometryLine2D.hh" // USES GeometryLine2D
+#include "pylith/feassemble/GeometryTri3D.hh" // USES GeometryTri3D
+#include "pylith/feassemble/GeometryQuad3D.hh" // USES GeometryQuad3D
+
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesiveImpulsesTri3 );
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesiveImpulsesQuad4 );
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesiveImpulsesTet4 );
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::faults::TestFaultCohesiveImpulsesHex8 );
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::faults::TestFaultCohesiveImpulsesTri3::setUp(void)
+{ // setUp
+ TestFaultCohesiveImpulses::setUp();
+ _data = new CohesiveImpulsesDataTri3;
+
+ CPPUNIT_ASSERT(_quadrature);
+ feassemble::GeometryLine2D geometry;
+ _quadrature->refGeometry(&geometry);
+
+ _flipFault = true;
+} // setUp
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::faults::TestFaultCohesiveImpulsesQuad4::setUp(void)
+{ // setUp
+ TestFaultCohesiveImpulses::setUp();
+ _data = new CohesiveImpulsesDataQuad4;
+
+ CPPUNIT_ASSERT(_quadrature);
+ feassemble::GeometryLine2D geometry;
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::faults::TestFaultCohesiveImpulsesTet4::setUp(void)
+{ // setUp
+ TestFaultCohesiveImpulses::setUp();
+ _data = new CohesiveImpulsesDataTet4;
+
+ CPPUNIT_ASSERT(_quadrature);
+ feassemble::GeometryTri3D geometry;
+ _quadrature->refGeometry(&geometry);
+} // setUp
+
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::faults::TestFaultCohesiveImpulsesHex8::setUp(void)
+{ // setUp
+ TestFaultCohesiveImpulses::setUp();
+ _data = new CohesiveImpulsesDataHex8;
+
+ CPPUNIT_ASSERT(_quadrature);
+ feassemble::GeometryQuad3D geometry;
+ _quadrature->refGeometry(&geometry);
+
+ _flipFault = true;
+} // setUp
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.hh (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveImpulsesCases.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,138 @@
+// -*- 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/faults/TestFaultCohesiveImpulsesCases.hh
+ *
+ * @brief C++ unit testing for FaultCohesiveImpulses with various cell
+ * types.
+ */
+
+#if !defined(pylith_faults_testfaultcohesiveimpulsescases_hh)
+#define pylith_faults_testfaultcohesiveimpulsescases_hh
+
+#include "TestFaultCohesiveImpulses.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+ namespace faults {
+ class TestFaultCohesiveImpulsesTri3;
+ class TestFaultCohesiveImpulsesQuad4;
+ class TestFaultCohesiveImpulsesTet4;
+ class TestFaultCohesiveImpulsesHex8;
+ } // faults
+} // pylith
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for FaultCohesiveImpulses with tri3 cells
+class pylith::faults::TestFaultCohesiveImpulsesTri3 : public TestFaultCohesiveImpulses
+{ // class TestFaultCohesiveImpulsesTri3
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestFaultCohesiveImpulsesTri3 );
+
+ CPPUNIT_TEST( testNumImpulses );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestFaultCohesiveImpulsesTri3
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for FaultCohesiveImpulses with Quad4 cells
+class pylith::faults::TestFaultCohesiveImpulsesQuad4 : public TestFaultCohesiveImpulses
+{ // class TestFaultCohesiveImpulsesQuad4
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestFaultCohesiveImpulsesQuad4 );
+
+ CPPUNIT_TEST( testNumImpulses );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestFaultCohesiveImpulsesQuad4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for FaultCohesiveImpulses with Tet4 cells
+class pylith::faults::TestFaultCohesiveImpulsesTet4 : public TestFaultCohesiveImpulses
+{ // class TestFaultCohesiveImpulsesTet4
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestFaultCohesiveImpulsesTet4 );
+
+ CPPUNIT_TEST( testNumImpulses );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestFaultCohesiveImpulsesTet4
+
+
+// ----------------------------------------------------------------------
+/// C++ unit testing for FaultCohesiveImpulses with Hex8 cells
+class pylith::faults::TestFaultCohesiveImpulsesHex8 : public TestFaultCohesiveImpulses
+{ // class TestFaultCohesiveImpulsesHex8
+
+ // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+ CPPUNIT_TEST_SUITE( TestFaultCohesiveImpulsesHex8 );
+
+ CPPUNIT_TEST( testNumImpulses );
+ CPPUNIT_TEST( testInitialize );
+ CPPUNIT_TEST( testIntegrateResidual );
+
+ CPPUNIT_TEST_SUITE_END();
+
+ // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+ /// Setup testing data.
+ void setUp(void);
+
+}; // class TestFaultCohesiveImpulsesHex8
+
+
+
+#endif // pylith_faults_testfaultcohesiveimpulsescases_hh
+
+
+// End of file
Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -891,8 +891,8 @@
// ----------------------------------------------------------------------
// Determine if vertex is a Lagrange multiplier constraint vertex.
bool
-pylith::faults::TestFaultCohesiveKin::_isLagrangeVertex(const int vertex) const
-{ // _isLagrangeVertex
+pylith::faults::TestFaultCohesiveKin::_isConstraintVertex(const int vertex) const
+{ // _isConstraintVertex
CPPUNIT_ASSERT(_data);
const int numFaultVertices = _data->numFaultVertices;
@@ -903,7 +903,7 @@
break;
} // if
return isFound;
-} // _isLagrangeVertex
+} // _isConstraintVertex
// End of file
Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.hh 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/TestFaultCohesiveKin.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -128,7 +128,7 @@
*
* @returns True if vertex is a constraint vertex, false otherwise.
*/
- bool _isLagrangeVertex(const int vertex) const;
+ bool _isConstraintVertex(const int vertex) const;
}; // class TestFaultCohesiveKin
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.cc (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,58 @@
+// -*- 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 "CohesiveImpulsesData.hh"
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::faults::CohesiveImpulsesData::CohesiveImpulsesData(void) :
+ meshFilename(0),
+ spaceDim(0),
+ cellDim(0),
+ numBasis(0),
+ numQuadPts(0),
+ quadPts(0),
+ quadWts(0),
+ basis(0),
+ basisDeriv(0),
+ verticesRef(0),
+ id(0),
+ label(0),
+ impulseAmpFilename(0),
+ impulseDOF(0),
+ numComponents(0),
+ fieldT(0),
+ fieldIncr(0),
+ orientation(0),
+ area(0),
+ amplitude(0),
+ numImpulses(0),
+ residualIncr(0),
+ constraintVertices(0),
+ numConstraintVert(0)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::faults::CohesiveImpulsesData::~CohesiveImpulsesData(void)
+{ // destructor
+} // destructor
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.hh (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesData.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,93 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesiveimpulsesdata_hh)
+#define pylith_faults_cohesiveimpulsesdata_hh
+
+#include "pylith/utils/types.hh" // HASA PylithScalar
+
+namespace pylith {
+ namespace faults {
+ class CohesiveImpulsesData;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveImpulsesData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public :
+
+ /// Constructor
+ CohesiveImpulsesData(void);
+
+ /// Destructor
+ ~CohesiveImpulsesData(void);
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public:
+
+ char* meshFilename; ///< Filename for input mesh
+
+ /// @name Quadrature information
+ //@{
+ int spaceDim; ///< Number of dimensions in vertex coordinates
+ int cellDim; ///< Number of dimensions associated with cell
+ int numBasis; ///< Number of vertices in cell
+ int numQuadPts; ///< Number of quadrature points
+ PylithScalar* quadPts; ///< Coordinates of quad pts in ref cell
+ PylithScalar* quadWts; ///< Weights of quadrature points
+ PylithScalar* basis; ///< Basis fns at quadrature points
+ PylithScalar* basisDeriv; ///< Derivatives of basis fns at quad pts
+ PylithScalar* verticesRef; ///< Coordinates of vertices in ref cell (dual basis)
+ //@}
+
+ /// @name Fault information
+ //@{
+ int id; ///< Fault material identifier
+ char* label; ///< Label for fault
+ char* impulseAmpFilename; ///< Name of db for final slip
+ int* impulseDOF; ///< Fault DOF associated with impulses.
+ int numComponents; ///< Number of components in impulses.
+ //@}
+
+ /// @name Input fields
+ //@{
+ PylithScalar* fieldT; ///< Field over domain at time t.
+ PylithScalar* fieldIncr; ///< Solution increment field over domain at time t.
+ //@}
+
+ /// @name Calculated values.
+ //@{
+ PylithScalar* orientation; ///< Expected values for fault orientation.
+ PylithScalar* area; ///< Expected values for fault area.
+ PylithScalar* amplitude; ///< Expected values for impulse amplitude.
+ int numImpulses; ///< Number of impulses.
+
+ /// Expected values from residual calculation using solution increment.
+ PylithScalar* residualIncr;
+
+ int* constraintVertices; ///< Expected points for constraint vertices
+ int numConstraintVert; ///< Number of constraint vertices
+ //@}
+
+};
+
+#endif // pylith_faults_cohesiveimpulsesdata_hh
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.cc (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,247 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-1 and vertices are 2-13.
+ *
+ * 2,3,4,5 -------- 6,7,8,9 -------- 10,11,12,13
+ *
+ * ^^^^^^^ Vertices forming fault
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-1,16 and vertices are 4-15.
+ *
+ * 2,3,4,5 -------- 6,7,8,9 -- 14,15,16,17 -------- 10,11,12,13
+ * 18,19,20,21
+ * ^^^^^^^^^^^^^^^^^^^^^^ Cohesive element
+ *
+ */
+
+#include "CohesiveImpulsesDataHex8.hh"
+
+const char* pylith::faults::CohesiveImpulsesDataHex8::_meshFilename =
+ "data/hex8.mesh";
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_spaceDim = 3;
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_cellDim = 2;
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_numBasis = 4;
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_numQuadPts = 4;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_quadPts[] = {
+ -1.0, -1.0,
+ +1.0, -1.0,
+ +1.0, +1.0,
+ -1.0, +1.0
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_quadWts[] = {
+ 1.0, 1.0, 1.0, 1.0
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_basis[] = {
+ 1.0, 0.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0, 0.0,
+ 0.0, 0.0, 1.0, 0.0,
+ 0.0, 0.0, 0.0, 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_basisDeriv[] = {
+ -0.39433757, -0.39433757,
+ +0.39433757, -0.10566243,
+ +0.10566243, +0.10566243,
+ -0.10566243, +0.39433757,
+
+ -0.39433757, -0.10566243,
+ +0.39433757, -0.39433757,
+ +0.10566243, +0.39433757,
+ -0.10566243, +0.10566243,
+
+ -0.10566243, -0.10566243,
+ +0.10566243, -0.39433757,
+ +0.39433757, +0.39433757,
+ -0.39433757, +0.10566243,
+
+ -0.10566243, -0.39433757,
+ +0.10566243, -0.10566243,
+ +0.39433757, +0.10566243,
+ -0.39433757, +0.39433757,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_verticesRef[] = {
+ -1.0, -1.0,
+ +1.0, -1.0,
+ +1.0, +1.0,
+ -1.0, +1.0
+};
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_id = 10;
+
+const char* pylith::faults::CohesiveImpulsesDataHex8::_label = "fault";
+
+const char* pylith::faults::CohesiveImpulsesDataHex8::_impulseAmpFilename =
+ "data/hex8_impulses.spatialdb";
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_impulseDOF[1] = {
+ 1,
+};
+const int pylith::faults::CohesiveImpulsesDataHex8::_numComponents = 1;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_fieldT[] = {
+ 4.1, 6.1, 8.1,
+ 4.2, 6.2, 8.2,
+ 4.3, 6.3, 8.3,
+ 4.4, 6.4, 8.4,
+ 4.5, 6.5, 8.5, // 6
+ 4.6, 6.6, 8.6, // 7
+ 4.7, 6.7, 8.7, // 8
+ 4.8, 6.8, 8.8, // 9
+ 4.9, 6.9, 8.9,
+ 4.0, 6.0, 8.0,
+ 5.1, 7.1, 9.1,
+ 5.2, 7.2, 9.2,
+ 5.3, 7.3, 9.3, // 14
+ 5.5, 7.5, 9.5, // 15
+ 5.7, 7.7, 9.7, // 16
+ 5.9, 7.9, 9.9, // 17
+ 5.4, 7.4, 9.4, // 18
+ 5.6, 7.6, 9.6, // 19
+ 5.8, 7.8, 9.8, // 20
+ 5.0, 7.0, 9.0, // 21
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_fieldIncr[] = {
+ 3.1, 4.1, 5.1,
+ 3.2, 4.2, 5.2,
+ 3.3, 4.3, 5.3,
+ 3.4, 4.4, 5.4,
+ 3.5, 4.5, 5.5, // 6
+ 3.6, 4.6, 5.6, // 7
+ 3.7, 4.7, 5.7, // 8
+ 3.8, 4.8, 5.8, // 9
+ 3.9, 4.9, 5.9,
+ 3.0, 4.0, 5.0,
+ 3.1, 4.1, 5.1,
+ 3.2, 4.2, 5.2,
+ 3.3, 4.3, 5.3, // 14
+ 3.5, 4.5, 5.5, // 15
+ 3.7, 4.7, 5.7, // 16
+ 3.9, 4.9, 5.9, // 17
+ 3.4, 4.4, 5.4, // 18
+ 3.6, 4.6, 5.6, // 19
+ 3.8, 4.8, 5.8, // 20
+ 3.0, 4.0, 5.0, // 21
+};
+
+// ----------------------------------------------------------------------
+// Computed values
+// ----------------------------------------------------------------------
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_orientation[] = {
+ 0.0, -1.0, 0.0, 0.0, 0.0, +1.0, -1.0, 0.0, 0.0,
+ 0.0, -1.0, 0.0, 0.0, 0.0, +1.0, -1.0, 0.0, 0.0,
+ 0.0, -1.0, 0.0, 0.0, 0.0, +1.0, -1.0, 0.0, 0.0,
+ 0.0, -1.0, 0.0, 0.0, 0.0, +1.0, -1.0, 0.0, 0.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_area[] = {
+ 1.0, 1.0, 1.0, 1.0
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_amplitude[4] = {
+ 0.8,
+ 1.6,
+ 0.0,
+ 1.2,
+};
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_numImpulses = 3;
+
+const int pylith::faults::CohesiveImpulsesDataHex8::_numConstraintVert = 4;
+const int pylith::faults::CohesiveImpulsesDataHex8::_constraintVertices[4] = {
+ 18, 19, 20, 21
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataHex8::_residualIncr[] = {
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ +5.4, +7.4, +9.4, // 6
+ +5.6, +7.6, +9.6, // 7
+ +5.8, +7.8, +9.8, // 8
+ +5.0, +7.0, +9.0, // 9
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ -5.4, -7.4, -9.4, // 14
+ -5.6, -7.6, -9.6, // 15
+ -5.8, -7.8, -9.8, // 16
+ -5.0, -7.0, -9.0, // 17
+
+ // 18 (constraint)
+ -(5.3-4.5+0.0), -(7.3-6.5+0.0), -(9.3-8.5+0.0),
+
+ // 19 (constraint)
+ -(5.5-4.6+0.0), -(7.5-6.6+0.0), -(9.5-8.6-1.6),
+
+ // 20 (constraint)
+ -(5.7-4.7+0.0), -(7.7-6.7+0.0), -(9.7-8.7+0.0),
+
+ // 21 (constraint)
+ -(5.9-4.8+0.0), -(7.9-6.8+0.0), -(9.9-8.8+0.0),
+};
+
+pylith::faults::CohesiveImpulsesDataHex8::CohesiveImpulsesDataHex8(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ cellDim = _cellDim;
+ numBasis = _numBasis;
+ numQuadPts = _numQuadPts;
+ quadPts = const_cast<PylithScalar*>(_quadPts);
+ quadWts = const_cast<PylithScalar*>(_quadWts);
+ basis = const_cast<PylithScalar*>(_basis);
+ basisDeriv = const_cast<PylithScalar*>(_basisDeriv);
+ verticesRef = const_cast<PylithScalar*>(_verticesRef);
+ id = _id;
+ label = const_cast<char*>(_label);
+ impulseAmpFilename = const_cast<char*>(_impulseAmpFilename);
+ impulseDOF = const_cast<int*>(_impulseDOF);
+ numComponents = _numComponents;
+ fieldT = const_cast<PylithScalar*>(_fieldT);
+ fieldIncr = const_cast<PylithScalar*>(_fieldIncr);
+ orientation = const_cast<PylithScalar*>(_orientation);
+ area = const_cast<PylithScalar*>(_area);
+ amplitude = const_cast<PylithScalar*>(_amplitude);
+ numImpulses = _numImpulses;
+ residualIncr = const_cast<PylithScalar*>(_residualIncr);
+ constraintVertices = const_cast<int*>(_constraintVertices);
+ numConstraintVert = _numConstraintVert;
+} // constructor
+
+pylith::faults::CohesiveImpulsesDataHex8::~CohesiveImpulsesDataHex8(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.hh (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataHex8.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,82 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesiveimpulsesdatahex8_hh)
+#define pylith_faults_cohesiveimpulsesdatahex8_hh
+
+#include "CohesiveImpulsesData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveImpulsesDataHex8;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveImpulsesDataHex8 : public CohesiveImpulsesData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveImpulsesDataHex8(void);
+
+ /// Destructor
+ ~CohesiveImpulsesDataHex8(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _cellDim; ///< Number of dimensions associated with cell
+
+ static const int _numBasis; ///< Number of vertices in cell
+ static const int _numQuadPts; ///< Number of quadrature points
+ static const PylithScalar _quadPts[]; ///< Coordinates of quad pts in ref cell
+ static const PylithScalar _quadWts[]; ///< Weights of quadrature points
+ static const PylithScalar _basis[]; ///< Basis fns at quadrature points
+ static const PylithScalar _basisDeriv[]; ///< Derivatives of basis fns at quad pts
+ static const PylithScalar _verticesRef[]; ///< Coordinates of vertices in ref cell (dual basis)
+
+ static const int _id; ///< Fault material identifier
+ static const char* _label; ///< Label for fault
+ static const char* _impulseAmpFilename; ///< Name of db for impulse amplitude
+ static const int _impulseDOF[]; ///< Fault components associated with impulses.
+ static const int _numComponents; ///< Number of components;
+ //@}
+
+ static const PylithScalar _fieldT[]; ///< Field over domain at time t.
+ static const PylithScalar _fieldIncr[]; ///< Solution increment field over domain at time t.
+
+ static const PylithScalar _orientation[]; ///< Expected values for fault orientation.
+ static const PylithScalar _area[]; ///< Expected values for fault area.
+ static const PylithScalar _amplitude[]; ///< Expected values for impulse amplitude.
+ static const int _numImpulses; ///< Number of impulses.
+ static const PylithScalar _residualIncr[]; ///< Expected values from residual calculation with solution increment.
+
+ static const int _constraintVertices[]; ///< Expected points for constraint vertices
+ static const int _numConstraintVert; ///< Number of constraint vertices
+
+};
+
+#endif // pylith_faults_cohesiveimpulsesdatahex8_hh
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.cc (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,196 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-1, vertices are 2-7.
+ *
+ * 3 -------- 5 -------- 7
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * | | |
+ * 2 -------- 4 -------- 6
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-1,10 vertices are 2-9.
+ *
+ * 3 -------- 5 -11-- 9 -------- 7
+ * | | | |
+ * | | | |
+ * | | | |
+ * | | | |
+ * | | | |
+ * | | | |
+ * | | | |
+ * | | | |
+ * 2 -------- 4 -10-- 8 -------- 6
+ */
+
+#include "CohesiveImpulsesDataQuad4.hh"
+
+const char* pylith::faults::CohesiveImpulsesDataQuad4::_meshFilename =
+ "data/quad4.mesh";
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_spaceDim = 2;
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_cellDim = 1;
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_numBasis = 2;
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_numQuadPts = 2;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_quadPts[] = {
+ -1.0, 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_quadWts[] = {
+ 1.0, 1.0
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_basis[] = {
+ 1.0, 0.0,
+ 0.0, 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_basisDeriv[] = {
+ -0.5, 0.5,
+ -0.5, 0.5,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_verticesRef[] = {
+ -1.0, 1.0
+};
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_id = 10;
+
+const char* pylith::faults::CohesiveImpulsesDataQuad4::_label = "fault";
+
+const char* pylith::faults::CohesiveImpulsesDataQuad4::_impulseAmpFilename =
+ "data/quad4_impulses.spatialdb";
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_impulseDOF[2] = {
+ 0,1,
+};
+const int pylith::faults::CohesiveImpulsesDataQuad4::_numComponents = 2;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_fieldT[] = {
+ 8.1, 9.1,
+ 8.2, 9.2,
+ 8.3, 9.3, // 4
+ 8.4, 9.4, // 5
+ 8.5, 9.5,
+ 8.6, 9.6,
+ 8.7, 9.7, // 8
+ 8.9, 9.9, // 9
+ 8.8, 9.8, // 10
+ 8.0, 9.0, // 11
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_fieldIncr[] = {
+ 3.1, 4.1,
+ 3.2, 4.2,
+ 3.3, 4.3, // 4
+ 3.4, 4.4, // 5
+ 3.5, 4.5,
+ 3.6, 4.6,
+ 3.7, 4.7, // 8
+ 3.9, 4.9, // 9
+ 3.8, 4.8, // 10
+ 3.0, 4.0, // 11
+};
+
+// ----------------------------------------------------------------------
+// Computed values
+// ----------------------------------------------------------------------
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_orientation[] = {
+ 0.0, 1.0, +1.0, 0.0,
+ 0.0, 1.0, +1.0, 0.0
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_area[] = {
+ 1.0,
+ 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_amplitude[] = {
+ 0.0,
+ 1.5,
+};
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_numImpulses = 2;
+
+const int pylith::faults::CohesiveImpulsesDataQuad4::_numConstraintVert = 2;
+const int pylith::faults::CohesiveImpulsesDataQuad4::_constraintVertices[] = {
+ 10, 11
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataQuad4::_residualIncr[] = {
+ 0.0, 0.0,
+ 0.0, 0.0,
+ +8.8, +9.8, // 4
+ +8.0, +9.0, // 5
+ 0.0, 0.0,
+ 0.0, 0.0,
+ -8.8, -9.8, // 8
+ -8.0, -9.0, // 9
+ -(8.7-8.3) + 0.0,
+ -(9.7-9.3) + 0.0, // 10
+ -(8.9-8.4) + 1.5,
+ -(9.9-9.4) + 0.0, // 11
+};
+
+pylith::faults::CohesiveImpulsesDataQuad4::CohesiveImpulsesDataQuad4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ cellDim = _cellDim;
+ numBasis = _numBasis;
+ numQuadPts = _numQuadPts;
+ quadPts = const_cast<PylithScalar*>(_quadPts);
+ quadWts = const_cast<PylithScalar*>(_quadWts);
+ basis = const_cast<PylithScalar*>(_basis);
+ basisDeriv = const_cast<PylithScalar*>(_basisDeriv);
+ verticesRef = const_cast<PylithScalar*>(_verticesRef);
+ id = _id;
+ label = const_cast<char*>(_label);
+ impulseAmpFilename = const_cast<char*>(_impulseAmpFilename);
+ impulseDOF = const_cast<int*>(_impulseDOF);
+ numComponents = _numComponents;
+ fieldT = const_cast<PylithScalar*>(_fieldT);
+ fieldIncr = const_cast<PylithScalar*>(_fieldIncr);
+ orientation = const_cast<PylithScalar*>(_orientation);
+ area = const_cast<PylithScalar*>(_area);
+ amplitude = const_cast<PylithScalar*>(_amplitude);
+ numImpulses = _numImpulses;
+ residualIncr = const_cast<PylithScalar*>(_residualIncr);
+ constraintVertices = const_cast<int*>(_constraintVertices);
+ numConstraintVert = _numConstraintVert;
+} // constructor
+
+pylith::faults::CohesiveImpulsesDataQuad4::~CohesiveImpulsesDataQuad4(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.hh (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataQuad4.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,82 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesiveimpulsesdataquad4_hh)
+#define pylith_faults_cohesiveimpulsesdataquad4_hh
+
+#include "CohesiveImpulsesData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveImpulsesDataQuad4;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveImpulsesDataQuad4 : public CohesiveImpulsesData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveImpulsesDataQuad4(void);
+
+ /// Destructor
+ ~CohesiveImpulsesDataQuad4(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _cellDim; ///< Number of dimensions associated with cell
+
+ static const int _numBasis; ///< Number of vertices in cell
+ static const int _numQuadPts; ///< Number of quadrature points
+ static const PylithScalar _quadPts[]; ///< Coordinates of quad pts in ref cell
+ static const PylithScalar _quadWts[]; ///< Weights of quadrature points
+ static const PylithScalar _basis[]; ///< Basis fns at quadrature points
+ static const PylithScalar _basisDeriv[]; ///< Derivatives of basis fns at quad pts
+ static const PylithScalar _verticesRef[]; ///< Coordinates of vertices in ref cell (dual basis)
+
+ static const int _id; ///< Fault material identifier
+ static const char* _label; ///< Label for fault
+ static const char* _impulseAmpFilename; ///< Name of db for impulse amplitude
+ static const int _impulseDOF[]; ///< Fault components associated with impulses.
+ static const int _numComponents; ///< Number of components;
+ //@}
+
+ static const PylithScalar _fieldT[]; ///< Field over domain at time t.
+ static const PylithScalar _fieldIncr[]; ///< Solution increment field over domain at time t.
+
+ static const PylithScalar _orientation[]; ///< Expected values for fault orientation.
+ static const PylithScalar _area[]; ///< Expected values for fault area.
+ static const PylithScalar _amplitude[]; ///< Expected values for impulse amplitude.
+ static const int _numImpulses; ///< Number of impulses.
+ static const PylithScalar _residualIncr[]; ///< Expected values from residual calculation with solution increment.
+
+ static const int _constraintVertices[]; ///< Expected points for constraint vertices
+ static const int _numConstraintVert; ///< Number of constraint vertices
+
+};
+
+#endif // pylith_faults_cohesiveimpulsesdataquad4_hh
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.cc (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,204 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-1, vertices are 2-6.
+ *
+ * 2 3,4,5 6
+ *
+ * ^^^^^ Face in x-y plane
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-1,13, vertices are 2-9.
+ *
+ * 2 3,4,5 7,8,9 6
+ * 10,11,12
+ * ^^^^^^^^^^^^ Cohesive element in x-y plane.
+ */
+
+#include "CohesiveImpulsesDataTet4.hh"
+
+const char* pylith::faults::CohesiveImpulsesDataTet4::_meshFilename =
+ "data/tet4.mesh";
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_spaceDim = 3;
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_cellDim = 2;
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_numBasis = 3;
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_numQuadPts = 3;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_quadPts[] = {
+ -1.00000000e+00, -1.00000000e+00,
+ 1.00000000e+00, -1.00000000e+00,
+ -1.00000000e+00, 1.00000000e+00,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_quadWts[] = {
+ 2.0/3.0, 2.0/3.0, 2.0/3.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_basis[] = {
+ 1.0, 0.0, 0.0,
+ 0.0, 1.0, 0.0,
+ 0.0, 0.0, 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_basisDeriv[] = {
+ -0.50000000e+00, -0.50000000e+00,
+ 0.50000000e+00, 0.00000000e+00,
+ 0.00000000e+00, 0.50000000e+00,
+ -0.50000000e+00, -0.50000000e+00,
+ 0.50000000e+00, 0.00000000e+00,
+ 0.00000000e+00, 0.50000000e+00,
+ -0.50000000e+00, -0.50000000e+00,
+ 0.50000000e+00, 0.00000000e+00,
+ 0.00000000e+00, 0.50000000e+00,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_verticesRef[] = {
+ -1.00000000e+00, -1.00000000e+00,
+ 1.00000000e+00, -1.00000000e+00,
+ -1.00000000e+00, 1.00000000e+00,
+};
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_id = 10;
+
+const char* pylith::faults::CohesiveImpulsesDataTet4::_label = "fault";
+
+const char* pylith::faults::CohesiveImpulsesDataTet4::_impulseAmpFilename =
+ "data/tet4_impulses.spatialdb";
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_impulseDOF[2] = {
+ 0, 2,
+};
+const int pylith::faults::CohesiveImpulsesDataTet4::_numComponents = 2;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_fieldT[] = {
+ 7.1, 8.1, 9.1,
+ 7.2, 8.2, 9.2, // 3
+ 7.3, 8.3, 9.3, // 4
+ 7.4, 8.4, 9.4, // 5
+ 7.5, 8.5, 9.5,
+ 7.6, 8.6, 9.6, // 7
+ 7.8, 8.8, 9.8, // 8
+ 7.0, 8.0, 9.0, // 9
+ 7.7, 8.7, 9.7, // 10
+ 7.9, 8.9, 9.9, // 11
+ 7.1, 8.1, 9.1, // 12
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_fieldIncr[] = {
+ 3.1, 4.1, 5.1,
+ 3.2, 4.2, 5.2, // 3
+ 3.3, 4.3, 5.3, // 4
+ 3.4, 4.4, 5.4, // 5
+ 3.5, 4.5, 5.5,
+ 3.6, 4.6, 5.6, // 7
+ 3.8, 4.8, 5.8, // 8
+ 3.0, 4.0, 5.0, // 9
+ 3.7, 4.7, 5.7, // 10
+ 3.9, 4.9, 5.9, // 11
+ 3.1, 4.1, 5.1, // 12
+};
+
+// ----------------------------------------------------------------------
+// Computed values
+// ----------------------------------------------------------------------
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_orientation[] = {
+ 0.0, +1.0, 0.0, 0.0, 0.0, +1.0, +1.0, 0.0, 0.0,
+ 0.0, +1.0, 0.0, 0.0, 0.0, +1.0, +1.0, 0.0, 0.0,
+ 0.0, +1.0, 0.0, 0.0, 0.0, +1.0, +1.0, 0.0, 0.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_area[] = {
+ 1.0/3.0,
+ 1.0/3.0,
+ 1.0/3.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_amplitude[3] = {
+ 1.2,
+ 0.0,
+ 1.5,
+};
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_numImpulses = 4;
+
+const int pylith::faults::CohesiveImpulsesDataTet4::_numConstraintVert = 3;
+const int pylith::faults::CohesiveImpulsesDataTet4::_constraintVertices[] = {
+ 10, 11, 12,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTet4::_residualIncr[] = {
+ 0.0, 0.0, 0.0,
+ +7.7/3.0, +8.7/3.0, +9.7/3.0, // 3
+ +7.9/3.0, +8.9/3.0, +9.9/3.0, // 4
+ +7.1/3.0, +8.1/3.0, +9.1/3.0, // 5
+ 0.0, 0.0, 0.0,
+ -7.7/3.0, -8.7/3.0, -9.7/3.0, // 7
+ -7.9/3.0, -8.9/3.0, -9.9/3.0, // 8
+ -7.1/3.0, -8.1/3.0, -9.1/3.0, // 9
+ -1.0/3.0*(7.6-7.2 - 1.2), // 10
+ -1.0/3.0*(8.6-8.2 + 0.0),
+ -1.0/3.0*(9.6-9.2 + 0.0),
+ -1.0/3.0*(7.8-7.3 + 0.0), // 11
+ -1.0/3.0*(8.8-8.3 + 0.0),
+ -1.0/3.0*(9.8-9.3 + 0.0),
+ -1.0/3.0*(7.0-7.4 + 0.0), // 12
+ -1.0/3.0*(8.0-8.4 + 0.0),
+ -1.0/3.0*(9.0-9.4 + 0.0),
+};
+
+pylith::faults::CohesiveImpulsesDataTet4::CohesiveImpulsesDataTet4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ cellDim = _cellDim;
+ numBasis = _numBasis;
+ numQuadPts = _numQuadPts;
+ quadPts = const_cast<PylithScalar*>(_quadPts);
+ quadWts = const_cast<PylithScalar*>(_quadWts);
+ basis = const_cast<PylithScalar*>(_basis);
+ basisDeriv = const_cast<PylithScalar*>(_basisDeriv);
+ verticesRef = const_cast<PylithScalar*>(_verticesRef);
+ id = _id;
+ label = const_cast<char*>(_label);
+ impulseAmpFilename = const_cast<char*>(_impulseAmpFilename);
+ impulseDOF = const_cast<int*>(_impulseDOF);
+ numComponents = _numComponents;
+ fieldT = const_cast<PylithScalar*>(_fieldT);
+ fieldIncr = const_cast<PylithScalar*>(_fieldIncr);
+ orientation = const_cast<PylithScalar*>(_orientation);
+ area = const_cast<PylithScalar*>(_area);
+ amplitude = const_cast<PylithScalar*>(_amplitude);
+ numImpulses = _numImpulses;
+ residualIncr = const_cast<PylithScalar*>(_residualIncr);
+ constraintVertices = const_cast<int*>(_constraintVertices);
+ numConstraintVert = _numConstraintVert;
+} // constructor
+
+pylith::faults::CohesiveImpulsesDataTet4::~CohesiveImpulsesDataTet4(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.hh (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTet4.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,82 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesiveimpulsesdatatet4_hh)
+#define pylith_faults_cohesiveimpulsesdatatet4_hh
+
+#include "CohesiveImpulsesData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveImpulsesDataTet4;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveImpulsesDataTet4 : public CohesiveImpulsesData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveImpulsesDataTet4(void);
+
+ /// Destructor
+ ~CohesiveImpulsesDataTet4(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _cellDim; ///< Number of dimensions associated with cell
+
+ static const int _numBasis; ///< Number of vertices in cell
+ static const int _numQuadPts; ///< Number of quadrature points
+ static const PylithScalar _quadPts[]; ///< Coordinates of quad pts in ref cell
+ static const PylithScalar _quadWts[]; ///< Weights of quadrature points
+ static const PylithScalar _basis[]; ///< Basis fns at quadrature points
+ static const PylithScalar _basisDeriv[]; ///< Derivatives of basis fns at quad pts
+ static const PylithScalar _verticesRef[]; ///< Coordinates of vertices in ref cell (dual basis)
+
+ static const int _id; ///< Fault material identifier
+ static const char* _label; ///< Label for fault
+ static const char* _impulseAmpFilename; ///< Name of db for impulse amplitude
+ static const int _impulseDOF[]; ///< Fault components associated with impulses.
+ static const int _numComponents; ///< Number of components;
+ //@}
+
+ static const PylithScalar _fieldT[]; ///< Field over domain at time t.
+ static const PylithScalar _fieldIncr[]; ///< Solution increment field over domain at time t.
+
+ static const PylithScalar _orientation[]; ///< Expected values for fault orientation.
+ static const PylithScalar _area[]; ///< Expected values for fault area.
+ static const PylithScalar _amplitude[]; ///< Expected values for impulse amplitude.
+ static const int _numImpulses; ///< Number of impulses.
+ static const PylithScalar _residualIncr[]; ///< Expected values from residual calculation with solution increment.
+
+ static const int _constraintVertices[]; ///< Expected points for constraint vertices
+ static const int _numConstraintVert; ///< Number of constraint vertices
+
+};
+
+#endif // pylith_faults_cohesiveimpulsesdatatet4_hh
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.cc
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.cc (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.cc 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,193 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+/* Original mesh
+ *
+ * Cells are 0-1, vertices are 2-5.
+ *
+ * 3
+ * /|\
+ * / | \
+ * / | \
+ * / | \
+ * 2 | 5
+ * \ | /
+ * \ | /
+ * \ | /
+ * \|/
+ * 4
+ *
+ *
+ * After adding cohesive elements
+ *
+ * Cells are 0-1, 10, vertices are 2-7.
+ *
+ * 6 -8- 3
+ * /| |\
+ * / | | \
+ * / | | \
+ * / | | \
+ * 2 | | 5
+ * \ | | /
+ * \ | | /
+ * \ | | /
+ * \| |/
+ * 7 -9- 4
+ */
+
+#include "CohesiveImpulsesDataTri3.hh"
+
+const char* pylith::faults::CohesiveImpulsesDataTri3::_meshFilename =
+ "data/tri3.mesh";
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_spaceDim = 2;
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_cellDim = 1;
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_numBasis = 2;
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_numQuadPts = 2;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_quadPts[] = {
+ -1.0, 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_quadWts[] = {
+ 1.0, 1.0
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_basis[] = {
+ 1.0, 0.0,
+ 0.0, 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_basisDeriv[] = {
+ -0.5, 0.5,
+ -0.5, 0.5,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_verticesRef[] = {
+ -1.0, 1.0
+};
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_id = 10;
+
+const char* pylith::faults::CohesiveImpulsesDataTri3::_label = "fault";
+
+const char* pylith::faults::CohesiveImpulsesDataTri3::_impulseAmpFilename =
+ "data/tri3_impulses.spatialdb";
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_impulseDOF[1] = {
+ 1,
+};
+const int pylith::faults::CohesiveImpulsesDataTri3::_numComponents = 1;
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_fieldT[] = {
+ 8.1, 9.1,
+ 8.2, 9.2, // 3
+ 8.3, 9.3, // 4
+ 8.4, 9.4,
+ 8.5, 9.5, // 6
+ 8.7, 9.7, // 7
+ 8.6, 9.6, // 8
+ 8.8, 9.8, // 9
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_fieldIncr[] = {
+ 3.1, 4.1,
+ 3.2, 4.2, // 3
+ 3.3, 4.3, // 4
+ 3.4, 4.4,
+ 3.5, 4.5, // 6
+ 3.7, 4.7, // 7
+ 3.6, 4.6, // 8
+ 3.8, 4.8, // 9
+};
+
+// ----------------------------------------------------------------------
+// Computed values
+// ----------------------------------------------------------------------
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_orientation[] = {
+ 0.0, -1.0, -1.0, 0.0,
+ 0.0, -1.0, -1.0, 0.0
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_area[] = {
+ 1.0,
+ 1.0,
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_amplitude[] = {
+ 2.0,
+ 2.1,
+};
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_numImpulses = 2;
+
+const int pylith::faults::CohesiveImpulsesDataTri3::_numConstraintVert = 2;
+const int pylith::faults::CohesiveImpulsesDataTri3::_constraintVertices[] = {
+ 8, 9
+};
+
+const PylithScalar pylith::faults::CohesiveImpulsesDataTri3::_residualIncr[] = {
+ 0.0, 0.0,
+ +8.6, +9.6, // 3
+ +8.8, +9.8, // 4
+ 0.0, 0.0,
+ -8.6, -9.6, // 6
+ -8.8, -9.8, // 7
+ -(8.5-8.2) - (0),
+ -(9.5-9.2) - (0), // 8
+ -(8.7-8.3) - (2.1),
+ -(9.7-9.3) - (0), // 9
+};
+
+pylith::faults::CohesiveImpulsesDataTri3::CohesiveImpulsesDataTri3(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ cellDim = _cellDim;
+ numBasis = _numBasis;
+ numQuadPts = _numQuadPts;
+ quadPts = const_cast<PylithScalar*>(_quadPts);
+ quadWts = const_cast<PylithScalar*>(_quadWts);
+ basis = const_cast<PylithScalar*>(_basis);
+ basisDeriv = const_cast<PylithScalar*>(_basisDeriv);
+ verticesRef = const_cast<PylithScalar*>(_verticesRef);
+ id = _id;
+ label = const_cast<char*>(_label);
+ impulseAmpFilename = const_cast<char*>(_impulseAmpFilename);
+ impulseDOF = const_cast<int*>(_impulseDOF);
+ numComponents = _numComponents;
+ fieldT = const_cast<PylithScalar*>(_fieldT);
+ fieldIncr = const_cast<PylithScalar*>(_fieldIncr);
+ orientation = const_cast<PylithScalar*>(_orientation);
+ area = const_cast<PylithScalar*>(_area);
+ amplitude = const_cast<PylithScalar*>(_amplitude);
+ numImpulses = _numImpulses;
+ residualIncr = const_cast<PylithScalar*>(_residualIncr);
+ constraintVertices = const_cast<int*>(_constraintVertices);
+ numConstraintVert = _numConstraintVert;
+} // constructor
+
+pylith::faults::CohesiveImpulsesDataTri3::~CohesiveImpulsesDataTri3(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.hh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.hh (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/CohesiveImpulsesDataTri3.hh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,82 @@
+// -*- 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.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_faults_cohesiveimpulsesdatatri3_hh)
+#define pylith_faults_cohesiveimpulsesdatatri3_hh
+
+#include "CohesiveImpulsesData.hh"
+
+namespace pylith {
+ namespace faults {
+ class CohesiveImpulsesDataTri3;
+ } // pylith
+} // faults
+
+class pylith::faults::CohesiveImpulsesDataTri3 : public CohesiveImpulsesData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ CohesiveImpulsesDataTri3(void);
+
+ /// Destructor
+ ~CohesiveImpulsesDataTri3(void);
+
+// PRIVATE MEMBERS //////////////////////////////////////////////////////
+private:
+
+ static const char* _meshFilename; ///< Filename of input mesh
+
+ static const int _spaceDim; ///< Number of dimensions in vertex coordinates
+ static const int _cellDim; ///< Number of dimensions associated with cell
+
+ static const int _numBasis; ///< Number of vertices in cell
+ static const int _numQuadPts; ///< Number of quadrature points
+ static const PylithScalar _quadPts[]; ///< Coordinates of quad pts in ref cell
+ static const PylithScalar _quadWts[]; ///< Weights of quadrature points
+ static const PylithScalar _basis[]; ///< Basis fns at quadrature points
+ static const PylithScalar _basisDeriv[]; ///< Derivatives of basis fns at quad pts
+ static const PylithScalar _verticesRef[]; ///< Coordinates of vertices in ref cell (dual basis)
+
+ static const int _id; ///< Fault material identifier
+ static const char* _label; ///< Label for fault
+ static const char* _impulseAmpFilename; ///< Name of db for impulse amplitude
+ static const int _impulseDOF[]; ///< Fault components associated with impulses.
+ static const int _numComponents; ///< Number of components;
+ //@}
+
+ static const PylithScalar _fieldT[]; ///< Field over domain at time t.
+ static const PylithScalar _fieldIncr[]; ///< Solution increment field over domain at time t.
+
+ static const PylithScalar _orientation[]; ///< Expected values for fault orientation.
+ static const PylithScalar _area[]; ///< Expected values for fault area.
+ static const PylithScalar _amplitude[]; ///< Expected values for impulse amplitude.
+ static const int _numImpulses; ///< Number of impulses.
+ static const PylithScalar _residualIncr[]; ///< Expected values from residual calculation with solution increment.
+
+ static const int _constraintVertices[]; ///< Expected points for constraint vertices
+ static const int _numConstraintVert; ///< Number of constraint vertices
+
+};
+
+#endif // pylith_faults_cohesiveimpulsesdatatri3_hh
+
+
+// End of file
Modified: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/Makefile.am
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/Makefile.am 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/Makefile.am 2012-05-02 23:32:42 UTC (rev 20025)
@@ -41,6 +41,7 @@
tri3d_risetime.spatialdb \
tri3_initialtract.spatialdb \
tri3d_initialtract.spatialdb \
+ tri3_impulses.spatialdb \
quad4.mesh \
quad4b.mesh \
quad4c.mesh \
@@ -56,6 +57,7 @@
quad4e_sliptime.spatialdb \
quad4e_risetime.spatialdb \
quad4_initialtract.spatialdb \
+ quad4_impulses.spatialdb \
tet4.mesh \
tet4b.mesh \
tet4c.mesh \
@@ -74,6 +76,7 @@
tet4e_sliptime.spatialdb \
tet4e_risetime.spatialdb \
tet4_initialtract.spatialdb \
+ tet4_impulses.spatialdb \
hex8.mesh \
hex8b.mesh \
hex8c.mesh \
@@ -87,10 +90,7 @@
hex8_sliptime.spatialdb \
hex8_risetime.spatialdb \
hex8_initialtract.spatialdb \
- tri3traction.mesh \
- quad4traction.mesh \
- tet4traction.mesh \
- hex8traction.mesh
+ hex8_impulses.spatialdb
noinst_TMP =
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8_impulses.spatialdb
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8_impulses.spatialdb (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8_impulses.spatialdb 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,17 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 1
+ value-names = slip
+ value-units = m
+ num-locs = 4
+ data-dim = 2
+ space-dim = 3
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 3
+ }
+}
+0.0 -1.0 -1.0 0.8
+0.0 1.0 -1.0 1.6
+0.0 -1.0 1.0 0.0
+0.0 1.0 1.0 1.2
Deleted: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8traction.mesh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8traction.mesh 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/hex8traction.mesh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -1,64 +0,0 @@
-mesh = {
- dimension = 3
- use-index-zero = true
- vertices = {
- dimension = 3
- count = 12
- coordinates = {
- 0 -2.0 -1.0 -1.0
- 1 -2.0 1.0 -1.0
- 2 -2.0 -1.0 1.0
- 3 -2.0 1.0 1.0
- 4 0.0 -1.0 -1.0
- 5 0.0 1.0 -1.0
- 6 0.0 -1.0 1.0
- 7 0.0 1.0 1.0
- 8 2.0 -1.0 -1.0
- 9 2.0 1.0 -1.0
- 10 2.0 -1.0 1.0
- 11 2.0 1.0 1.0
- }
- }
- cells = {
- count = 2
- num-corners = 8
- simplices = {
- 0 0 1 3 2 4 5 7 6
- 1 4 5 7 6 8 9 11 10
- }
- material-ids = {
- 0 0
- 1 0
- }
- }
- group = {
- name = fault
- type = vertices
- count = 4
- indices = {
- 4
- 5
- 6
- 7
- }
- }
- group = {
- name = traction
- type = vertices
- count = 12
- indices = {
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- }
- }
-}
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4_impulses.spatialdb
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4_impulses.spatialdb (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4_impulses.spatialdb 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,15 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 1
+ value-names = slip
+ value-units = m
+ num-locs = 2
+ data-dim = 1
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 2
+ }
+}
+0.0 +1.0 1.5
+0.0 -1.0 0.0
Deleted: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4traction.mesh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4traction.mesh 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/quad4traction.mesh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -1,50 +0,0 @@
-mesh = {
- dimension = 2
- use-index-zero = true
- vertices = {
- dimension = 2
- count = 6
- coordinates = {
- 0 -2.0 -1.0
- 1 -2.0 1.0
- 2 0.0 -1.0
- 3 0.0 1.0
- 4 2.0 -1.0
- 5 2.0 1.0
- }
- }
- cells = {
- count = 2
- num-corners = 4
- simplices = {
- 0 0 2 3 1
- 1 4 5 3 2
- }
- material-ids = {
- 0 0
- 1 0
- }
- }
- group = {
- name = fault
- type = vertices
- count = 2
- indices = {
- 2
- 3
- }
- }
- group = {
- name = traction
- type = vertices
- count = 6
- indices = {
- 0
- 1
- 2
- 3
- 4
- 5
- }
- }
-}
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4_impulses.spatialdb
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4_impulses.spatialdb (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4_impulses.spatialdb 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,16 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 1
+ value-names = slip
+ value-units = m
+ num-locs = 3
+ data-dim = 2
+ space-dim = 3
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 3
+ }
+}
+0.0 -1.0 0.0 1.2
+0.0 0.0 1.0 0.0
+0.0 1.0 0.0 1.5
Deleted: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4traction.mesh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4traction.mesh 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tet4traction.mesh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -1,49 +0,0 @@
-mesh = {
- dimension = 3
- use-index-zero = true
- vertices = {
- dimension = 3
- count = 5
- coordinates = {
- 0 -1.0 0.0 0.0
- 1 0.0 -1.0 0.0
- 2 0.0 0.0 1.0
- 3 0.0 1.0 0.0
- 4 1.0 0.0 0.0
- }
- }
- cells = {
- count = 2
- num-corners = 4
- simplices = {
- 0 1 2 3 0
- 1 1 3 2 4
- }
- material-ids = {
- 0 0
- 1 0
- }
- }
- group = {
- name = fault
- type = vertices
- count = 3
- indices = {
- 1
- 2
- 3
- }
- }
- group = {
- name = traction
- type = vertices
- count = 5
- indices = {
- 0
- 1
- 2
- 3
- 4
- }
- }
-}
Added: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3_impulses.spatialdb
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3_impulses.spatialdb (rev 0)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3_impulses.spatialdb 2012-05-02 23:32:42 UTC (rev 20025)
@@ -0,0 +1,15 @@
+#SPATIAL.ascii 1
+SimpleDB {
+ num-values = 1
+ value-names = slip
+ value-units = m
+ num-locs = 2
+ data-dim = 1
+ space-dim = 2
+ cs-data = cartesian {
+ to-meters = 1.0
+ space-dim = 2
+ }
+}
+0.0 +1.0 2.0
+0.0 -1.0 2.1
Deleted: short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3traction.mesh
===================================================================
--- short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3traction.mesh 2012-05-02 17:22:04 UTC (rev 20024)
+++ short/3D/PyLith/branches/v1.7-trunk/unittests/libtests/faults/data/tri3traction.mesh 2012-05-02 23:32:42 UTC (rev 20025)
@@ -1,56 +0,0 @@
-mesh = {
- dimension = 2
- use-index-zero = true
- vertices = {
- dimension = 2
- count = 4
- coordinates = {
- 0 -1.0 0.0
- 1 0.0 1.0
- 2 0.0 -1.0
- 3 1.0 0.0
- }
- }
- cells = {
- count = 2
- num-corners = 3
- simplices = {
- 0 0 2 1
- 1 1 2 3
- }
- material-ids = {
- 0 0
- 1 0
- }
- }
- group = {
- name = fault
- type = vertices
- count = 2
- indices = {
- 1
- 2
- }
- }
- group = {
- name = output
- type = vertices
- count = 3
- indices = {
- 1
- 2
- 3
- }
- }
- group = {
- name = traction
- type = vertices
- count = 4
- indices = {
- 0
- 1
- 3
- 2
- }
- }
-}
More information about the CIG-COMMITS
mailing list