[cig-commits] r5115 - in short/3D/PyLith/trunk: libsrc/feassemble
unittests/libtests/feassemble unittests/libtests/feassemble/data
brad at geodynamics.org
brad at geodynamics.org
Sun Oct 29 14:21:15 PST 2006
Author: brad
Date: 2006-10-29 14:21:14 -0800 (Sun, 29 Oct 2006)
New Revision: 5115
Added:
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.hh
Modified:
short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.hh
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DLinear.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DQuadratic.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DOne.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DThree.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DTwo.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DLinear.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DQuadratic.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/Quadrature3DLinear.py
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/QuadratureData3DLinear.cc
short/3D/PyLith/trunk/unittests/libtests/feassemble/data/feutils.py
Log:
Added unit tests for formulation of lumped mass matrix. Fixed bugs associated with formulating lumped mass matrix.
Modified: short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/libsrc/feassemble/IntegratorInertia.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -230,33 +230,27 @@
const int numBasis = _quadrature->numCorners();
const int spaceDim = _quadrature->spaceDim();
- // FIX THIS
- // Hardwire mass density
+ // :TODO: Get mass density at quadrature points from material database
+ // For now, hardwire mass density
const double density = 1.0;
// Compute lumped mass matrix for cell
- double sumdiag = 0;
- double diagScale = 0;
for (int iQuad=0; iQuad < numQuadPts; ++iQuad) {
const double wt = quadWts[iQuad] * jacobianDet[iQuad] * density;
for (int iBasis=0, iQ=iQuad*numBasis; iBasis < numBasis; ++iBasis) {
const int iBlock = iBasis * spaceDim;
- const double val = wt*basis[iQ+iBasis]*basis[iQ+iBasis];
- for (int iDim=0; iDim < spaceDim; ++iDim)
- _cellVector[iBlock+iDim] += val;
- sumdiag += val;
+ const double valI = wt*basis[iQ+iBasis];
+ for (int jBasis=0; jBasis < numBasis; ++jBasis) {
+ const int jBlock = jBasis * spaceDim;
+ const double val = valI*basis[iQ+jBasis];
+ for (int iDim=0; iDim < spaceDim; ++iDim)
+ _cellVector[iBlock+iDim] += val;
+ } // for
} // for
- diagScale += numBasis*wt;
} // for
- diagScale /= sumdiag*numBasis;
- for (int iBasis=0; iBasis < numBasis; ++iBasis) {
- const int iBlock = iBasis * spaceDim;
- for (int iDim=0; iDim < numBasis; ++iDim)
- _cellVector[iBlock+iDim] *= diagScale;
- } // for
PetscErrorCode err =
- PetscLogFlops(numQuadPts*(3+numBasis*(3+spaceDim)) + numBasis*spaceDim);
+ PetscLogFlops(numQuadPts*(2+numBasis*(1+numBasis*(1+spaceDim))));
if (err)
throw std::runtime_error("Logging PETSc flops failed.");
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/Makefile.am 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/Makefile.am 2006-10-29 22:21:14 UTC (rev 5115)
@@ -20,6 +20,7 @@
# Primary source files
testfeassemble_SOURCES = \
TestIntegrator.cc \
+ TestIntegratorInertia.cc \
TestIntegratorInertia1D.cc \
TestIntegratorInertia2D.cc \
TestIntegratorInertia3D.cc \
@@ -33,6 +34,7 @@
noinst_HEADERS = \
TestIntegrator.hh \
+ TestIntegratorInertia.hh \
TestIntegratorInertia1D.hh \
TestIntegratorInertia2D.hh \
TestIntegratorInertia3D.hh \
Added: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -0,0 +1,126 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestIntegratorInertia.hh" // Implementation of class methods
+
+#include "pylith/feassemble/IntegratorInertia.hh" // USES IntegratorInertia
+#include "data/IntegratorData.hh" // USES IntegratorData
+
+// ----------------------------------------------------------------------
+namespace pylith {
+ namespace feassemble {
+ class _TestIntegratorInertia;
+ } // feassemble
+} // pylith
+
+/// Helper class for TestIntegrator
+class pylith::feassemble::_TestIntegratorInertia {
+
+public :
+ /** Setup mesh.
+ *
+ * @param data Integrator data
+ */
+ static
+ ALE::Obj<ALE::Mesh>
+ _setupMesh(const IntegratorData& data);
+}; // _TestIntegrator
+
+// ----------------------------------------------------------------------
+// Test integrateLumped()
+void
+pylith::feassemble::TestIntegratorInertia::_testIntegrateLumped(
+ IntegratorInertia* integrator,
+ const IntegratorData& data) const
+{ // _testIntegrateLumped
+ typedef ALE::Mesh::real_section_type real_section_type;
+ typedef ALE::Mesh::topology_type topology_type;
+
+ ALE::Obj<ALE::Mesh> mesh = _TestIntegratorInertia::_setupMesh(data);
+ const ALE::Mesh::int_section_type::patch_type patch = 0;
+
+ // Fiber dimension (number of values in field per vertex) for fields
+ const int fiberDim = data.fiberDim;
+
+ // Setup field for action result
+ const ALE::Obj<real_section_type>& fieldOut =
+ mesh->getRealSection("fieldOut");
+ fieldOut->setName("fieldOut");
+ fieldOut->setFiberDimensionByDepth(patch, 0, fiberDim);
+ fieldOut->allocate();
+
+ // Integrate action
+ const ALE::Obj<real_section_type>& coordinates =
+ mesh->getRealSection("coordinates");
+ integrator->integrateLumped(fieldOut, coordinates);
+ //fieldOut->view("field out");
+
+ // Check values in output field
+ int iVertex = 0;
+ const ALE::Obj<topology_type::label_sequence>& vertices =
+ mesh->getTopology()->depthStratum(patch, 0);
+ const topology_type::label_sequence::iterator verticesEnd =
+ vertices->end();
+ const double tolerance = 1.0e-06;
+ for (topology_type::label_sequence::iterator vIter=vertices->begin();
+ vIter != verticesEnd;
+ ++vIter, ++iVertex) {
+ const real_section_type::value_type* vals =
+ fieldOut->restrict(patch, *vIter);
+ const double* valsE = &data.valsLumped[iVertex*fiberDim];
+ const int dim = fieldOut->getFiberDimension(patch, *vIter);
+ CPPUNIT_ASSERT_EQUAL(fiberDim, dim);
+ for (int iDim=0; iDim < fiberDim; ++iDim)
+ CPPUNIT_ASSERT_DOUBLES_EQUAL(1.0, vals[iDim]/valsE[iDim], tolerance);
+ } // for
+} // _testIntegrateLumped
+
+
+// ----------------------------------------------------------------------
+// Setup mesh.
+ALE::Obj<ALE::Mesh>
+pylith::feassemble::_TestIntegratorInertia::_setupMesh(const IntegratorData& data)
+{ // _setupMesh
+ typedef ALE::Mesh::topology_type topology_type;
+ typedef topology_type::sieve_type sieve_type;
+
+ const int cellDim = data.cellDim;
+ const int numCorners = data.numCorners;
+ const int spaceDim = data.spaceDim;
+ const int numVertices = data.numVertices;
+ const int numCells = data.numCells;
+ const double* vertCoords = data.vertices;
+ const int* cells = data.cells;
+ CPPUNIT_ASSERT(0 != vertCoords);
+ CPPUNIT_ASSERT(0 != cells);
+
+ ALE::Obj<ALE::Mesh> mesh = new ALE::Mesh(PETSC_COMM_WORLD, cellDim);
+ ALE::Obj<sieve_type> sieve = new sieve_type(mesh->comm());
+ ALE::Obj<topology_type> topology = new topology_type(mesh->comm());
+
+ const bool interpolate = false;
+ ALE::New::SieveBuilder<sieve_type>::buildTopology(sieve, cellDim, numCells,
+ const_cast<int*>(cells), numVertices, interpolate, numCorners);
+ sieve->stratify();
+ topology->setPatch(0, sieve);
+ topology->stratify();
+ mesh->setTopology(topology);
+ ALE::New::SieveBuilder<sieve_type>::buildCoordinates(
+ mesh->getRealSection("coordinates"), spaceDim, vertCoords);
+
+ return mesh;
+} // _setupMesh
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -0,0 +1,54 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/feassemble/TestIntegratorInertia.hh
+ *
+ * @brief C++ TestIntegratorInertia object
+ *
+ * C++ unit testing for IntegratorInertia.
+ */
+
+#if !defined(pylith_feassemble_testintegratorinertia_hh)
+#define pylith_feassemble_testintegratorinertia_hh
+
+#include "TestIntegrator.hh"
+
+/// Namespace for spatialdata package
+namespace pylith {
+ namespace feassemble {
+ class TestIntegratorInertia;
+
+ class IntegratorInertia; // USES IntegratorInertia
+ } // feassemble
+} // pylith
+
+/// C++ unit testing for IntegratorInertia
+class pylith::feassemble::TestIntegratorInertia : public TestIntegrator
+{ // class TestIntegratorInertia1D
+
+ // PROTECTED METHODS //////////////////////////////////////////////////
+protected :
+
+ /** Test integrateLumped()
+ *
+ * @param integrator Pointer to integrator
+ * @param data Data for testing integrator
+ */
+ void _testIntegrateLumped(IntegratorInertia* integrator,
+ const IntegratorData& data) const;
+
+}; // class TestIntegratorInertia
+
+#endif // pylith_feassemble_testintegratorinertia_hh
+
+// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -32,10 +32,10 @@
} // testConstructor
// ----------------------------------------------------------------------
-// Test integrate() & integrateAction() w/linear basis fns
+// Test integrateAction() w/linear basis fns
void
-pylith::feassemble::TestIntegratorInertia1D::testLinear(void)
-{ // testLinear
+pylith::feassemble::TestIntegratorInertia1D::testActionLinear(void)
+{ // testActionLinear
IntegratorDataInertia1DLinear data;
Quadrature1D q;
@@ -52,15 +52,59 @@
integrator.quadrature(&q);
_testIntegrateAction(&integrator, data);
+} // testActionLinear
+// ----------------------------------------------------------------------
+// Test integrate() w/linear basis fns
+void
+pylith::feassemble::TestIntegratorInertia1D::testIntegrateLinear(void)
+{ // testIntegrateLinear
+ IntegratorDataInertia1DLinear data;
+
+ Quadrature1D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
_testIntegrate(&integrator, data);
-} // testLinear
+} // testIntegrateLinear
// ----------------------------------------------------------------------
-// Test integrate() & integrateAction() w/quadratic basis fns
+// Test integrateLumped() w/linear basis fns
void
-pylith::feassemble::TestIntegratorInertia1D::testQuadratic(void)
-{ // testQuadratic
+pylith::feassemble::TestIntegratorInertia1D::testLumpedLinear(void)
+{ // testLumpedLinear
+ IntegratorDataInertia1DLinear data;
+
+ Quadrature1D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
+ _testIntegrateLumped(&integrator, data);
+} // testLumpedLinear
+
+// ----------------------------------------------------------------------
+// Test integrateAction() w/quadratic basis fns
+void
+pylith::feassemble::TestIntegratorInertia1D::testActionQuadratic(void)
+{ // testActionQuadratic
IntegratorDataInertia1DQuadratic data;
Quadrature1D q;
@@ -77,8 +121,52 @@
integrator.quadrature(&q);
_testIntegrateAction(&integrator, data);
+} // testActionQuadratic
+// ----------------------------------------------------------------------
+// Test integrate() w/quadratic basis fns
+void
+pylith::feassemble::TestIntegratorInertia1D::testIntegrateQuadratic(void)
+{ // testIntegrateQuadratic
+ IntegratorDataInertia1DQuadratic data;
+
+ Quadrature1D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
_testIntegrate(&integrator, data);
-} // testQuadratic
+} // testIntegrateQuadratic
+// ----------------------------------------------------------------------
+// Test integrateLumped() w/quadratic basis fns
+void
+pylith::feassemble::TestIntegratorInertia1D::testLumpedQuadratic(void)
+{ // testLumpedQuadratic
+ IntegratorDataInertia1DQuadratic data;
+
+ Quadrature1D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
+ _testIntegrateLumped(&integrator, data);
+} // testLumpedQuadratic
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia1D.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -21,7 +21,7 @@
#if !defined(pylith_feassemble_testintegratorinertia1d_hh)
#define pylith_feassemble_testintegratorinertia1d_hh
-#include "TestIntegrator.hh"
+#include "TestIntegratorInertia.hh"
/// Namespace for spatialdata package
namespace pylith {
@@ -31,14 +31,19 @@
} // pylith
/// C++ unit testing for IntegratorInertia1D
-class pylith::feassemble::TestIntegratorInertia1D : public TestIntegrator
+class pylith::feassemble::TestIntegratorInertia1D :
+ public TestIntegratorInertia
{ // class TestIntegratorInertia1D
// CPPUNIT TEST SUITE /////////////////////////////////////////////////
CPPUNIT_TEST_SUITE( TestIntegratorInertia1D );
CPPUNIT_TEST( testConstructor );
- CPPUNIT_TEST( testLinear );
- CPPUNIT_TEST( testQuadratic );
+ CPPUNIT_TEST( testActionLinear );
+ CPPUNIT_TEST( testIntegrateLinear );
+ CPPUNIT_TEST( testLumpedLinear );
+ CPPUNIT_TEST( testActionQuadratic );
+ CPPUNIT_TEST( testIntegrateQuadratic );
+ CPPUNIT_TEST( testLumpedQuadratic );
CPPUNIT_TEST_SUITE_END();
// PUBLIC METHODS /////////////////////////////////////////////////////
@@ -47,12 +52,24 @@
/// Test constructor
void testConstructor(void);
- /// Test integrate() & integrateAction() w/linear basis fns
- void testLinear(void);
+ /// Test integrateAction() w/linear basis fns
+ void testActionLinear(void);
- /// Test integrate() & integrateAction() w/quadratic basis fns
- void testQuadratic(void);
+ /// Test integrate() w/linear basis fns
+ void testIntegrateLinear(void);
+ /// Test integrateLumped() w/linear basis fns
+ void testLumpedLinear(void);
+
+ /// Test integrateAction() w/quadratic basis fns
+ void testActionQuadratic(void);
+
+ /// Test integrate() w/quadratic basis fns
+ void testIntegrateQuadratic(void);
+
+ /// Test integrateLumped() w/quadratic basis fns
+ void testLumpedQuadratic(void);
+
}; // class TestIntegratorInertia1D
#endif // pylith_feassemble_testintegratorinertia1d_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -25,10 +25,10 @@
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::feassemble::TestIntegratorInertia2D );
// ----------------------------------------------------------------------
-// Test integrate() & integrateAction() w/linear basis fns (1 cell)
+// Test integrateAction() w/linear basis fns (1 cell)
void
-pylith::feassemble::TestIntegratorInertia2D::testOne(void)
-{ // testOne
+pylith::feassemble::TestIntegratorInertia2D::testActionOne(void)
+{ // testActionOne
IntegratorDataInertia2Din3DOne data;
Quadrature2Din3D q;
@@ -45,16 +45,59 @@
integrator.quadrature(&q);
_testIntegrateAction(&integrator, data);
+} // testActionLinear
+// ----------------------------------------------------------------------
+// Test integrate() w/linear basis fns (1 cell)
+void
+pylith::feassemble::TestIntegratorInertia2D::testIntegrateOne(void)
+{ // testIntegrateOne
+ IntegratorDataInertia2Din3DOne data;
+
+ Quadrature2Din3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
_testIntegrate(&integrator, data);
-} // testLinear
+} // testIntegrateLinear
// ----------------------------------------------------------------------
-// Test integrate() & integrateAction() w/linear basis fns
-// (2 cells sharing 1 vertex)
+// Test integrateLumped() w/linear basis fns (1 cell)
void
-pylith::feassemble::TestIntegratorInertia2D::testOverlap1(void)
-{ // testOverlap1
+pylith::feassemble::TestIntegratorInertia2D::testLumpedOne(void)
+{ // testLumpedOne
+ IntegratorDataInertia2Din3DOne data;
+
+ Quadrature2Din3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
+ _testIntegrateLumped(&integrator, data);
+} // testLumpedLinear
+
+// ----------------------------------------------------------------------
+// Test integrateAction() w/linear basis fns (2 cells sharing 1 vertex)
+void
+pylith::feassemble::TestIntegratorInertia2D::testActionOverlap1(void)
+{ // testActionOverlap1
IntegratorDataInertia2Din3DTwo data;
Quadrature2Din3D q;
@@ -71,16 +114,59 @@
integrator.quadrature(&q);
_testIntegrateAction(&integrator, data);
+} // testActionOverlap1
+// ----------------------------------------------------------------------
+// Test integrateAction() w/linear basis fns (2 cells sharing 1 vertex)
+void
+pylith::feassemble::TestIntegratorInertia2D::testIntegrateOverlap1(void)
+{ // testIntegrateOverlap1
+ IntegratorDataInertia2Din3DTwo data;
+
+ Quadrature2Din3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
_testIntegrate(&integrator, data);
-} // testOverlap1
+} // testIntegrateOverlap1
// ----------------------------------------------------------------------
-// Test integrate() & integrateAction() w/linear basis fns
-// (2 cells sharing 2 vertices)
+// Test integrateLumped() w/linear basis fns (2 cells sharing 1 vertex)
void
-pylith::feassemble::TestIntegratorInertia2D::testOverlap2(void)
-{ // testOverlap2
+pylith::feassemble::TestIntegratorInertia2D::testLumpedOverlap1(void)
+{ // testLumpedOverlap1
+ IntegratorDataInertia2Din3DTwo data;
+
+ Quadrature2Din3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
+ _testIntegrateLumped(&integrator, data);
+} // testLumpedOverlap1
+
+// ----------------------------------------------------------------------
+// Test integrateAction() w/linear basis fns (2 cells sharing 2 vertices)
+void
+pylith::feassemble::TestIntegratorInertia2D::testActionOverlap2(void)
+{ // testActionOverlap2
IntegratorDataInertia2Din3DThree data;
Quadrature2Din3D q;
@@ -97,8 +183,52 @@
integrator.quadrature(&q);
_testIntegrateAction(&integrator, data);
+} // testActionOverlap2
+// ----------------------------------------------------------------------
+// Test integrate() w/linear basis fns (2 cells sharing 2 vertices)
+void
+pylith::feassemble::TestIntegratorInertia2D::testIntegrateOverlap2(void)
+{ // testIntegrateOverlap2
+ IntegratorDataInertia2Din3DThree data;
+
+ Quadrature2Din3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
_testIntegrate(&integrator, data);
-} // testOverlap2
+} // testIntegrateOverlap2
+// ----------------------------------------------------------------------
+// Test integrateLumped() w/linear basis fns (2 cells sharing 2 vertices)
+void
+pylith::feassemble::TestIntegratorInertia2D::testLumpedOverlap2(void)
+{ // testLumpedOverlap2
+ IntegratorDataInertia2Din3DThree data;
+
+ Quadrature2Din3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
+ _testIntegrateLumped(&integrator, data);
+} // testLumpedOverlap2
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia2D.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -21,7 +21,7 @@
#if !defined(pylith_feassemble_testintegratorinertia2d_hh)
#define pylith_feassemble_testintegratorinertia2d_hh
-#include "TestIntegrator.hh"
+#include "TestIntegratorInertia.hh"
/// Namespace for spatialdata package
namespace pylith {
@@ -31,31 +31,57 @@
} // pylith
/// C++ unit testing for IntegratorInertia2D
-class pylith::feassemble::TestIntegratorInertia2D : public TestIntegrator
+class pylith::feassemble::TestIntegratorInertia2D :
+ public TestIntegratorInertia
{ // class TestIntegratorInertia2D
// CPPUNIT TEST SUITE /////////////////////////////////////////////////
CPPUNIT_TEST_SUITE( TestIntegratorInertia2D );
- CPPUNIT_TEST( testOne );
- CPPUNIT_TEST( testOverlap1 );
- CPPUNIT_TEST( testOverlap2 );
+
+ CPPUNIT_TEST( testActionOne );
+ CPPUNIT_TEST( testIntegrateOne );
+ CPPUNIT_TEST( testLumpedOne );
+
+ CPPUNIT_TEST( testActionOverlap1 );
+ CPPUNIT_TEST( testIntegrateOverlap1 );
+ CPPUNIT_TEST( testLumpedOverlap1 );
+
+ CPPUNIT_TEST( testActionOverlap2 );
+ CPPUNIT_TEST( testIntegrateOverlap2 );
+ CPPUNIT_TEST( testLumpedOverlap2 );
+
CPPUNIT_TEST_SUITE_END();
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
- /// Test integrate() & integrateAction() w/linear basis fns
- /// (1 cell)
- void testOne(void);
+ /// Test integrateAction() w/linear basis fns (1 cell)
+ void testActionOne(void);
- /// Test integrate() & integrateAction() w/linear basis fns
- /// (2 cells sharing 1 vertex)
- void testOverlap1(void);
+ /// Test integrate() w/linear basis fns (1 cell)
+ void testIntegrateOne(void);
- /// Test integrate() & integrateAction() w/linear basis fns
- /// (2 cells sharing 2 vertices)
- void testOverlap2(void);
+ /// Test integrateLumped() w/linear basis fns (1 cell)
+ void testLumpedOne(void);
+ /// Test integrateAction() w/linear basis fns (2 cells sharing 1 vertex)
+ void testActionOverlap1(void);
+
+ /// Test integrate() w/linear basis fns (2 cells sharing 1 vertex)
+ void testIntegrateOverlap1(void);
+
+ /// Test integrateLumped() w/linear basis fns (2 cells sharing 1 vertex)
+ void testLumpedOverlap1(void);
+
+ /// Test integrateAction() w/linear basis fns (2 cells sharing 2 vertices)
+ void testActionOverlap2(void);
+
+ /// Test integrate() w/linear basis fns (2 cells sharing 2 vertices)
+ void testIntegrateOverlap2(void);
+
+ /// Test integrateLumped() w/linear basis fns (2 cells sharing 2 vertices)
+ void testLumpedOverlap2(void);
+
}; // class TestIntegratorInertia2D
#endif // pylith_feassemble_testintegratorinertia2d_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -24,10 +24,10 @@
CPPUNIT_TEST_SUITE_REGISTRATION( pylith::feassemble::TestIntegratorInertia3D );
// ----------------------------------------------------------------------
-// Test integrate() & integrateAction() w/linear basis fns
+// Test integrateAction() w/linear basis fns
void
-pylith::feassemble::TestIntegratorInertia3D::testLinear(void)
-{ // testLinear
+pylith::feassemble::TestIntegratorInertia3D::testActionLinear(void)
+{ // testActionLinear
IntegratorDataInertia3DLinear data;
Quadrature3D q;
@@ -44,15 +44,59 @@
integrator.quadrature(&q);
_testIntegrateAction(&integrator, data);
+} // testActionLinear
+// ----------------------------------------------------------------------
+// Test integrate() w/linear basis fns
+void
+pylith::feassemble::TestIntegratorInertia3D::testIntegrateLinear(void)
+{ // testIntegrateLinear
+ IntegratorDataInertia3DLinear data;
+
+ Quadrature3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
_testIntegrate(&integrator, data);
-} // testLinear
+} // testIntegrateLinear
// ----------------------------------------------------------------------
-// Test integrate() & integrateAction() w/quadratic basis fns
+// Test integrateLumped() w/linear basis fns
void
-pylith::feassemble::TestIntegratorInertia3D::testQuadratic(void)
-{ // testQuadratic
+pylith::feassemble::TestIntegratorInertia3D::testLumpedLinear(void)
+{ // testLumpedLinear
+ IntegratorDataInertia3DLinear data;
+
+ Quadrature3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
+ _testIntegrateLumped(&integrator, data);
+} // testLumpedLinear
+
+// ----------------------------------------------------------------------
+// Test integrateAction() w/quadratic basis fns
+void
+pylith::feassemble::TestIntegratorInertia3D::testActionQuadratic(void)
+{ // testActionQuadratic
IntegratorDataInertia3DQuadratic data;
Quadrature3D q;
@@ -69,8 +113,52 @@
integrator.quadrature(&q);
_testIntegrateAction(&integrator, data);
+} // testActionQuadratic
+// ----------------------------------------------------------------------
+// Test integrate() w/quadratic basis fns
+void
+pylith::feassemble::TestIntegratorInertia3D::testIntegrateQuadratic(void)
+{ // testIntegrateQuadratic
+ IntegratorDataInertia3DQuadratic data;
+
+ Quadrature3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
_testIntegrate(&integrator, data);
-} // testQuadratic
+} // testIntegrateQuadratic
+// ----------------------------------------------------------------------
+// Test integrateLumped() w/quadratic basis fns
+void
+pylith::feassemble::TestIntegratorInertia3D::testLumpedQuadratic(void)
+{ // testLumpedQuadratic
+ IntegratorDataInertia3DQuadratic data;
+
+ Quadrature3D q;
+ q.initialize(data.basis,
+ data.basisDeriv,
+ data.quadPts,
+ data.quadWts,
+ data.cellDim,
+ data.numCorners,
+ data.numQuadPts,
+ data.spaceDim);
+
+ IntegratorInertia integrator;
+ integrator.quadrature(&q);
+
+ _testIntegrateLumped(&integrator, data);
+} // testLumpedQuadratic
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/TestIntegratorInertia3D.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -21,7 +21,7 @@
#if !defined(pylith_feassemble_testintegratorinertia3d_hh)
#define pylith_feassemble_testintegratorinertia3d_hh
-#include "TestIntegrator.hh"
+#include "TestIntegratorInertia.hh"
/// Namespace for spatialdata package
namespace pylith {
@@ -31,24 +31,44 @@
} // pylith
/// C++ unit testing for IntegratorInertia3D
-class pylith::feassemble::TestIntegratorInertia3D : public TestIntegrator
+class pylith::feassemble::TestIntegratorInertia3D :
+ public TestIntegratorInertia
{ // class TestIntegratorInertia3D
// CPPUNIT TEST SUITE /////////////////////////////////////////////////
CPPUNIT_TEST_SUITE( TestIntegratorInertia3D );
- CPPUNIT_TEST( testLinear );
- CPPUNIT_TEST( testQuadratic );
+
+ CPPUNIT_TEST( testActionLinear );
+ CPPUNIT_TEST( testIntegrateLinear );
+ CPPUNIT_TEST( testLumpedLinear );
+
+ CPPUNIT_TEST( testActionQuadratic );
+ CPPUNIT_TEST( testIntegrateQuadratic );
+ CPPUNIT_TEST( testLumpedQuadratic );
+
CPPUNIT_TEST_SUITE_END();
// PUBLIC METHODS /////////////////////////////////////////////////////
public :
- /// Test integrate() & integrateAction() w/linear basis fns
- void testLinear(void);
+ /// Test integrateAction() w/linear basis fns
+ void testActionLinear(void);
- /// Test integrate() & integrateAction() w/quadratic basis fns
- void testQuadratic(void);
+ /// Test integrate() w/linear basis fns
+ void testIntegrateLinear(void);
+ /// Test integrateLumped() w/linear basis fns
+ void testLumpedLinear(void);
+
+ /// Test integrateAction() w/quadratic basis fns
+ void testActionQuadratic(void);
+
+ /// Test integrate() w/quadratic basis fns
+ void testIntegrateQuadratic(void);
+
+ /// Test integrateLumped() w/quadratic basis fns
+ void testLumpedQuadratic(void);
+
}; // class TestIntegratorInertia3D
#endif // pylith_feassemble_testintegratorinertia3d_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -30,7 +30,8 @@
basisDeriv(0),
fieldIn(0),
valsAction(0),
- valsMatrix(0)
+ valsMatrix(0),
+ valsLumped(0)
{ // constructor
} // constructor
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorData.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -61,6 +61,7 @@
double* fieldIn; ///< Input field for integration action
double* valsAction; ///< Expected output for integration action
double* valsMatrix; ///< Expected output for integration
+ double* valsLumped; ///< Expected output for lumped integration
//@}
};
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia1dlinear.
+// This file was generated from python application integratorinertia1dlinear.
#include "IntegratorDataInertia1DLinear.hh"
@@ -73,6 +73,11 @@
5.62500000e-01,
};
+const double pylith::feassemble::IntegratorDataInertia1DLinear::_valsLumped[] = {
+ 1.12500000e+00,
+ 1.12500000e+00,
+};
+
pylith::feassemble::IntegratorDataInertia1DLinear::IntegratorDataInertia1DLinear(void)
{ // constructor
numVertices = _numVertices;
@@ -91,6 +96,7 @@
fieldIn = const_cast<double*>(_fieldIn);
valsAction = const_cast<double*>(_valsAction);
valsMatrix = const_cast<double*>(_valsMatrix);
+ valsLumped = const_cast<double*>(_valsLumped);
} // constructor
pylith::feassemble::IntegratorDataInertia1DLinear::~IntegratorDataInertia1DLinear(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DLinear.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia1dlinear.
+// This file was generated from python application integratorinertia1dlinear.
#if !defined(pylith_feassemble_integratordatainertia1dlinear_hh)
#define pylith_feassemble_integratordatainertia1dlinear_hh
@@ -69,6 +69,8 @@
static const double _valsMatrix[];
+ static const double _valsLumped[];
+
};
#endif // pylith_feassemble_integratordatainertia1dlinear_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia1dquadratic.
+// This file was generated from python application integratorinertia1dquadratic.
#include "IntegratorDataInertia1DQuadratic.hh"
@@ -90,6 +90,12 @@
2.50000000e-01,
};
+const double pylith::feassemble::IntegratorDataInertia1DQuadratic::_valsLumped[] = {
+ 3.75000000e-01,
+ 1.50000000e+00,
+ 3.75000000e-01,
+};
+
pylith::feassemble::IntegratorDataInertia1DQuadratic::IntegratorDataInertia1DQuadratic(void)
{ // constructor
numVertices = _numVertices;
@@ -108,6 +114,7 @@
fieldIn = const_cast<double*>(_fieldIn);
valsAction = const_cast<double*>(_valsAction);
valsMatrix = const_cast<double*>(_valsMatrix);
+ valsLumped = const_cast<double*>(_valsLumped);
} // constructor
pylith::feassemble::IntegratorDataInertia1DQuadratic::~IntegratorDataInertia1DQuadratic(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia1DQuadratic.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia1dquadratic.
+// This file was generated from python application integratorinertia1dquadratic.
#if !defined(pylith_feassemble_integratordatainertia1dquadratic_hh)
#define pylith_feassemble_integratordatainertia1dquadratic_hh
@@ -69,6 +69,8 @@
static const double _valsMatrix[];
+ static const double _valsLumped[];
+
};
#endif // pylith_feassemble_integratordatainertia1dquadratic_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia2din3done.
+// This file was generated from python application integratorinertia2din3done.
#include "IntegratorDataInertia2Din3DOne.hh"
@@ -99,6 +99,12 @@
0.00000000e+00, 0.00000000e+00, 1.13668486e+00,
};
+const double pylith::feassemble::IntegratorDataInertia2Din3DOne::_valsLumped[] = {
+ 3.41005458e+00, 3.41005458e+00, 3.41005458e+00,
+ 3.41005458e+00, 3.41005458e+00, 3.41005458e+00,
+ 3.41005458e+00, 3.41005458e+00, 3.41005458e+00,
+};
+
pylith::feassemble::IntegratorDataInertia2Din3DOne::IntegratorDataInertia2Din3DOne(void)
{ // constructor
numVertices = _numVertices;
@@ -117,6 +123,7 @@
fieldIn = const_cast<double*>(_fieldIn);
valsAction = const_cast<double*>(_valsAction);
valsMatrix = const_cast<double*>(_valsMatrix);
+ valsLumped = const_cast<double*>(_valsLumped);
} // constructor
pylith::feassemble::IntegratorDataInertia2Din3DOne::~IntegratorDataInertia2Din3DOne(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DOne.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia2din3done.
+// This file was generated from python application integratorinertia2din3done.
#if !defined(pylith_feassemble_integratordatainertia2din3done_hh)
#define pylith_feassemble_integratordatainertia2din3done_hh
@@ -69,6 +69,8 @@
static const double _valsMatrix[];
+ static const double _valsLumped[];
+
};
#endif // pylith_feassemble_integratordatainertia2din3done_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia2din3dthree.
+// This file was generated from python application integratorinertia2din3dthree.
#include "IntegratorDataInertia2Din3DThree.hh"
@@ -123,6 +123,13 @@
0.00000000e+00, 0.00000000e+00, 1.10938755e+00,
};
+const double pylith::feassemble::IntegratorDataInertia2Din3DThree::_valsLumped[] = {
+ 6.65632531e+00, 6.65632531e+00, 6.65632531e+00,
+ 3.32816266e+00, 3.32816266e+00, 3.32816266e+00,
+ 6.65632531e+00, 6.65632531e+00, 6.65632531e+00,
+ 3.32816266e+00, 3.32816266e+00, 3.32816266e+00,
+};
+
pylith::feassemble::IntegratorDataInertia2Din3DThree::IntegratorDataInertia2Din3DThree(void)
{ // constructor
numVertices = _numVertices;
@@ -141,6 +148,7 @@
fieldIn = const_cast<double*>(_fieldIn);
valsAction = const_cast<double*>(_valsAction);
valsMatrix = const_cast<double*>(_valsMatrix);
+ valsLumped = const_cast<double*>(_valsLumped);
} // constructor
pylith::feassemble::IntegratorDataInertia2Din3DThree::~IntegratorDataInertia2Din3DThree(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DThree.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia2din3dthree.
+// This file was generated from python application integratorinertia2din3dthree.
#if !defined(pylith_feassemble_integratordatainertia2din3dthree_hh)
#define pylith_feassemble_integratordatainertia2din3dthree_hh
@@ -69,6 +69,8 @@
static const double _valsMatrix[];
+ static const double _valsLumped[];
+
};
#endif // pylith_feassemble_integratordatainertia2din3dthree_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia2din3dtwo.
+// This file was generated from python application integratorinertia2din3dtwo.
#include "IntegratorDataInertia2Din3DTwo.hh"
@@ -153,6 +153,14 @@
0.00000000e+00, 0.00000000e+00, 1.13668486e+00,
};
+const double pylith::feassemble::IntegratorDataInertia2Din3DTwo::_valsLumped[] = {
+ 3.41005458e+00, 3.41005458e+00, 3.41005458e+00,
+ 6.82010916e+00, 6.82010916e+00, 6.82010916e+00,
+ 3.41005458e+00, 3.41005458e+00, 3.41005458e+00,
+ 3.41005458e+00, 3.41005458e+00, 3.41005458e+00,
+ 3.41005458e+00, 3.41005458e+00, 3.41005458e+00,
+};
+
pylith::feassemble::IntegratorDataInertia2Din3DTwo::IntegratorDataInertia2Din3DTwo(void)
{ // constructor
numVertices = _numVertices;
@@ -171,6 +179,7 @@
fieldIn = const_cast<double*>(_fieldIn);
valsAction = const_cast<double*>(_valsAction);
valsMatrix = const_cast<double*>(_valsMatrix);
+ valsLumped = const_cast<double*>(_valsLumped);
} // constructor
pylith::feassemble::IntegratorDataInertia2Din3DTwo::~IntegratorDataInertia2Din3DTwo(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia2Din3DTwo.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia2din3dtwo.
+// This file was generated from python application integratorinertia2din3dtwo.
#if !defined(pylith_feassemble_integratordatainertia2din3dtwo_hh)
#define pylith_feassemble_integratordatainertia2din3dtwo_hh
@@ -69,6 +69,8 @@
static const double _valsMatrix[];
+ static const double _valsLumped[];
+
};
#endif // pylith_feassemble_integratordatainertia2din3dtwo_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia3dlinear.
+// This file was generated from python application integratorinertia3dlinear.
#include "IntegratorDataInertia3DLinear.hh"
@@ -41,7 +41,7 @@
};
const double pylith::feassemble::IntegratorDataInertia3DLinear::_quadPts[] = {
- 3.33333333e-01, 3.33333333e-01, 3.33333333e-01,
+ 2.50000000e-01, 2.50000000e-01, 2.50000000e-01,
};
const double pylith::feassemble::IntegratorDataInertia3DLinear::_quadWts[] = {
@@ -49,8 +49,8 @@
};
const double pylith::feassemble::IntegratorDataInertia3DLinear::_basis[] = {
- 1.11022302e-16, 3.33333333e-01, 3.33333333e-01,
- 3.33333333e-01,};
+ 2.50000000e-01, 2.50000000e-01, 2.50000000e-01,
+ 2.50000000e-01,};
const double pylith::feassemble::IntegratorDataInertia3DLinear::_basisDeriv[] = {
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
@@ -67,63 +67,70 @@
};
const double pylith::feassemble::IntegratorDataInertia3DLinear::_valsAction[] = {
- 5.17659989e-17, 7.96399983e-18, 7.56579984e-17,
- 1.55422222e-01, 2.39111111e-02, 2.27155556e-01,
- 1.55422222e-01, 2.39111111e-02, 2.27155556e-01,
- 1.55422222e-01, 2.39111111e-02, 2.27155556e-01,
+ 1.27775000e-01, 1.68125000e-02, 1.17687500e-01,
+ 1.27775000e-01, 1.68125000e-02, 1.17687500e-01,
+ 1.27775000e-01, 1.68125000e-02, 1.17687500e-01,
+ 1.27775000e-01, 1.68125000e-02, 1.17687500e-01,
};
const double pylith::feassemble::IntegratorDataInertia3DLinear::_valsMatrix[] = {
- 6.63136198e-33, 0.00000000e+00, 0.00000000e+00,
- 1.99099996e-17, 0.00000000e+00, 0.00000000e+00,
- 1.99099996e-17, 0.00000000e+00, 0.00000000e+00,
- 1.99099996e-17, 0.00000000e+00, 0.00000000e+00,
- 0.00000000e+00, 6.63136198e-33, 0.00000000e+00,
- 0.00000000e+00, 1.99099996e-17, 0.00000000e+00,
- 0.00000000e+00, 1.99099996e-17, 0.00000000e+00,
- 0.00000000e+00, 1.99099996e-17, 0.00000000e+00,
- 0.00000000e+00, 0.00000000e+00, 6.63136198e-33,
- 0.00000000e+00, 0.00000000e+00, 1.99099996e-17,
- 0.00000000e+00, 0.00000000e+00, 1.99099996e-17,
- 0.00000000e+00, 0.00000000e+00, 1.99099996e-17,
- 1.99099996e-17, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 0.00000000e+00, 1.99099996e-17, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 0.00000000e+00, 1.99099996e-17,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 1.99099996e-17, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 0.00000000e+00, 1.99099996e-17, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 0.00000000e+00, 1.99099996e-17,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 1.99099996e-17, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 5.97777778e-02, 0.00000000e+00, 0.00000000e+00,
- 0.00000000e+00, 1.99099996e-17, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 5.97777778e-02, 0.00000000e+00,
- 0.00000000e+00, 0.00000000e+00, 1.99099996e-17,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
- 0.00000000e+00, 0.00000000e+00, 5.97777778e-02,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 3.36250000e-02, 0.00000000e+00, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 3.36250000e-02, 0.00000000e+00,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
+ 0.00000000e+00, 0.00000000e+00, 3.36250000e-02,
};
+const double pylith::feassemble::IntegratorDataInertia3DLinear::_valsLumped[] = {
+ 1.34500000e-01, 1.34500000e-01, 1.34500000e-01,
+ 1.34500000e-01, 1.34500000e-01, 1.34500000e-01,
+ 1.34500000e-01, 1.34500000e-01, 1.34500000e-01,
+ 1.34500000e-01, 1.34500000e-01, 1.34500000e-01,
+};
+
pylith::feassemble::IntegratorDataInertia3DLinear::IntegratorDataInertia3DLinear(void)
{ // constructor
numVertices = _numVertices;
@@ -142,6 +149,7 @@
fieldIn = const_cast<double*>(_fieldIn);
valsAction = const_cast<double*>(_valsAction);
valsMatrix = const_cast<double*>(_valsMatrix);
+ valsLumped = const_cast<double*>(_valsLumped);
} // constructor
pylith::feassemble::IntegratorDataInertia3DLinear::~IntegratorDataInertia3DLinear(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DLinear.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia3dlinear.
+// This file was generated from python application integratorinertia3dlinear.
#if !defined(pylith_feassemble_integratordatainertia3dlinear_hh)
#define pylith_feassemble_integratordatainertia3dlinear_hh
@@ -69,6 +69,8 @@
static const double _valsMatrix[];
+ static const double _valsLumped[];
+
};
#endif // pylith_feassemble_integratordatainertia3dlinear_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia3dquadratic.
+// This file was generated from python application integratorinertia3dquadratic.
#include "IntegratorDataInertia3DQuadratic.hh"
@@ -445,6 +445,19 @@
0.00000000e+00, 0.00000000e+00, 2.88387231e-01,
};
+const double pylith::feassemble::IntegratorDataInertia3DQuadratic::_valsLumped[] = {
+ 3.83033951e-01, 3.83033951e-01, 3.83033951e-01,
+ 2.35346708e-01, 2.35346708e-01, 2.35346708e-01,
+ 2.46622428e-01, 2.46622428e-01, 2.46622428e-01,
+ 5.84663580e-01, 5.84663580e-01, 5.84663580e-01,
+ 1.15482922e+00, 1.15482922e+00, 1.15482922e+00,
+ 1.16046708e+00, 1.16046708e+00, 1.16046708e+00,
+ 1.32948765e+00, 1.32948765e+00, 1.32948765e+00,
+ 1.08662346e+00, 1.08662346e+00, 1.08662346e+00,
+ 1.26128189e+00, 1.26128189e+00, 1.26128189e+00,
+ 1.25564403e+00, 1.25564403e+00, 1.25564403e+00,
+};
+
pylith::feassemble::IntegratorDataInertia3DQuadratic::IntegratorDataInertia3DQuadratic(void)
{ // constructor
numVertices = _numVertices;
@@ -463,6 +476,7 @@
fieldIn = const_cast<double*>(_fieldIn);
valsAction = const_cast<double*>(_valsAction);
valsMatrix = const_cast<double*>(_valsMatrix);
+ valsLumped = const_cast<double*>(_valsLumped);
} // constructor
pylith::feassemble::IntegratorDataInertia3DQuadratic::~IntegratorDataInertia3DQuadratic(void)
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.hh 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorDataInertia3DQuadratic.hh 2006-10-29 22:21:14 UTC (rev 5115)
@@ -11,7 +11,7 @@
//
// DO NOT EDIT THIS FILE
-// This file was generated from python application itnegratorinertia3dquadratic.
+// This file was generated from python application integratorinertia3dquadratic.
#if !defined(pylith_feassemble_integratordatainertia3dquadratic_hh)
#define pylith_feassemble_integratordatainertia3dquadratic_hh
@@ -69,6 +69,8 @@
static const double _valsMatrix[];
+ static const double _valsLumped[];
+
};
#endif // pylith_feassemble_integratordatainertia3dquadratic_hh
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -30,14 +30,24 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia"):
+ def __init__(self, name="integratorinertia"):
"""
Constructor.
"""
IntegratorApp.__init__(self, name)
+
+ self.valsLumped = None
return
+ def _initData(self):
+ IntegratorApp._initData(self)
+ self.data.addArray(vtype="double", name="_valsLumped",
+ values=self.valsLumped,
+ format="%16.8e", ncols=self.spaceDim)
+ return
+
+
# PRIVATE METHODS ////////////////////////////////////////////////////
def _calculateMatrix(self):
@@ -46,16 +56,18 @@
"""
import feutils
- self.valsMatrix = numpy.zeros( (self.spaceDim*self.numVertices,
- self.spaceDim*self.numVertices),
+ self.valsMatrix = numpy.zeros( (self.fiberDim*self.numVertices,
+ self.fiberDim*self.numVertices),
dtype=numpy.float64)
+ self.valsLumped = numpy.zeros( (self.fiberDim*self.numVertices,),
+ dtype=numpy.float64)
- n = numpy.zeros( (self.spaceDim, self.spaceDim*self.numCorners),
+ n = numpy.zeros( (self.fiberDim, self.fiberDim*self.numCorners),
dtype=numpy.float64)
for cell in self.cells:
- cellMatrix = numpy.zeros( (self.spaceDim*self.numCorners,
- self.spaceDim*self.numCorners),
+ cellMatrix = numpy.zeros( (self.fiberDim*self.numCorners,
+ self.fiberDim*self.numCorners),
dtype=numpy.float64)
vertices = self.vertices[cell, :]
@@ -65,13 +77,33 @@
for iQuad in xrange(self.numQuadPts):
n *= 0.0
for iBasis in xrange(self.numCorners):
- for iDim in xrange(self.spaceDim):
- n[iDim, iBasis*self.spaceDim+iDim] = self.basis[iQuad, iBasis]
+ for iDim in xrange(self.fiberDim):
+ n[iDim, iBasis*self.fiberDim+iDim] = self.basis[iQuad, iBasis]
wt = density * self.quadWts[iQuad] * jacobianDet[iQuad]
cellMatrix[:] += wt * numpy.dot(n.transpose(), n)
- feutils.assembleMat(self.valsMatrix, cellMatrix, cell)
+ feutils.assembleMat(self.valsMatrix, cellMatrix, cell, self.fiberDim)
+
+ cellVec = self._calculateMatrixLumped(cellMatrix)
+ feutils.assembleVec(self.valsLumped, cellVec, cell, self.fiberDim)
return
+ def _calculateMatrixLumped(self, matrix):
+ """
+ Calculate lumped matrix associated with integration.
+ """
+
+ (nrows, ncols) = matrix.shape
+ lumped = numpy.zeros( (ncols), dtype=numpy.float64)
+
+ for iVertex in xrange(self.numCorners):
+ i = numpy.asarray(range(self.numCorners))
+ for iDim in xrange(self.fiberDim):
+ iR = iVertex * self.fiberDim + iDim
+ indices = self.fiberDim * i + iDim
+ lumped[iR] = sum(matrix[iR, indices])
+ return lumped
+
+
# End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DLinear.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DLinear.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DLinear.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -31,7 +31,7 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia1dlinear"):
+ def __init__(self, name="integratorinertia1dlinear"):
"""
Constructor.
"""
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DQuadratic.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DQuadratic.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia1DQuadratic.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -31,7 +31,7 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia1dquadratic"):
+ def __init__(self, name="integratorinertia1dquadratic"):
"""
Constructor.
"""
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DOne.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DOne.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DOne.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -32,7 +32,7 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia2din3done"):
+ def __init__(self, name="integratorinertia2din3done"):
"""
Constructor.
"""
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DThree.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DThree.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DThree.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -32,7 +32,7 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia2din3dthree"):
+ def __init__(self, name="integratorinertia2din3dthree"):
"""
Constructor.
"""
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DTwo.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DTwo.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia2Din3DTwo.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -32,7 +32,7 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia2din3dtwo"):
+ def __init__(self, name="integratorinertia2din3dtwo"):
"""
Constructor.
"""
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DLinear.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DLinear.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DLinear.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -31,7 +31,7 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia3dlinear"):
+ def __init__(self, name="integratorinertia3dlinear"):
"""
Constructor.
"""
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DQuadratic.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DQuadratic.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/IntegratorInertia3DQuadratic.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -31,7 +31,7 @@
# PUBLIC METHODS /////////////////////////////////////////////////////
- def __init__(self, name="itnegratorinertia3dquadratic"):
+ def __init__(self, name="integratorinertia3dquadratic"):
"""
Constructor.
"""
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/Quadrature3DLinear.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/Quadrature3DLinear.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/Quadrature3DLinear.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -92,7 +92,7 @@
self.numCorners = 4
self.numQuadPts = 1
- self.quadPtsRef = numpy.array( [[1.0/3.0, 1.0/3.0, 1.0/3.0]],
+ self.quadPtsRef = numpy.array( [[1.0/4.0, 1.0/4.0, 1.0/4.0]],
dtype=numpy.float64)
self.quadWts = numpy.array([1.0/6.0], dtype=numpy.float64)
self.vertices = numpy.array( [[-0.5, -1.0, -0.5],
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/QuadratureData3DLinear.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/QuadratureData3DLinear.cc 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/QuadratureData3DLinear.cc 2006-10-29 22:21:14 UTC (rev 5115)
@@ -39,7 +39,7 @@
};
const double pylith::feassemble::QuadratureData3DLinear::_quadPtsRef[] = {
- 3.33333333e-01, 3.33333333e-01, 3.33333333e-01,
+ 2.50000000e-01, 2.50000000e-01, 2.50000000e-01,
};
const double pylith::feassemble::QuadratureData3DLinear::_quadWts[] = {
@@ -47,8 +47,8 @@
};
const double pylith::feassemble::QuadratureData3DLinear::_basis[] = {
- 1.11022302e-16, 3.33333333e-01, 3.33333333e-01,
- 3.33333333e-01,};
+ 2.50000000e-01, 2.50000000e-01, 2.50000000e-01,
+ 2.50000000e-01,};
const double pylith::feassemble::QuadratureData3DLinear::_basisDeriv[] = {
-1.00000000e+00, -1.00000000e+00, -1.00000000e+00,
@@ -58,7 +58,7 @@
};
const double pylith::feassemble::QuadratureData3DLinear::_quadPts[] = {
- 9.33333333e-01, -3.33333333e-02, 4.33333333e-01,
+ 5.75000000e-01, -2.75000000e-01, 2.00000000e-01,
};
const double pylith::feassemble::QuadratureData3DLinear::_jacobian[] = {
Modified: short/3D/PyLith/trunk/unittests/libtests/feassemble/data/feutils.py
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/feassemble/data/feutils.py 2006-10-29 07:09:11 UTC (rev 5114)
+++ short/3D/PyLith/trunk/unittests/libtests/feassemble/data/feutils.py 2006-10-29 22:21:14 UTC (rev 5115)
@@ -106,19 +106,17 @@
# ----------------------------------------------------------------------
-def assembleMat(globalMat, cellMat, cell):
+def assembleMat(globalMat, cellMat, cell, fiberDim):
"""
Assemble cell matrix into global matrix.
"""
(nrows, ncols) = cellMat.shape
- numCorners = len(cell)
- fiberDim = nrows / numCorners
- for iR in xrange(numCorners):
+ for iR in xrange(nrows/fiberDim):
ibeginL = iR * fiberDim
iendL = ibeginL + fiberDim
ibeginG = cell[iR] * fiberDim
iendG = ibeginG + fiberDim
- for iC in xrange(numCorners):
+ for iC in xrange(ncols/fiberDim):
jbeginL = iC * fiberDim
jendL = jbeginL + fiberDim
jbeginG = cell[iC] * fiberDim
@@ -128,4 +126,19 @@
return
+# ----------------------------------------------------------------------
+def assembleVec(globalVec, cellVec, cell, fiberDim):
+ """
+ Assemble cell vector into global vector.
+ """
+ (nrows,) = cellVec.shape
+ for iR in xrange(nrows/fiberDim):
+ ibeginL = iR * fiberDim
+ iendL = ibeginL + fiberDim
+ ibeginG = cell[iR] * fiberDim
+ iendG = ibeginG + fiberDim
+ globalVec[ibeginG:iendG] += cellVec[ibeginL:iendL]
+ return
+
+
# End of file
More information about the cig-commits
mailing list