[cig-commits] r19611 - in short/3D/PyLith/trunk: pylith/meshio unittests/libtests/meshio unittests/libtests/meshio/data
brad at geodynamics.org
brad at geodynamics.org
Fri Feb 10 12:29:34 PST 2012
Author: brad
Date: 2012-02-10 12:29:33 -0800 (Fri, 10 Feb 2012)
New Revision: 19611
Added:
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.hh
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh
Modified:
short/3D/PyLith/trunk/pylith/meshio/PointsList.py
short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.hh
Log:
More work on OutputSolnPoints unit tests.
Modified: short/3D/PyLith/trunk/pylith/meshio/PointsList.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/PointsList.py 2012-02-10 17:10:11 UTC (rev 19610)
+++ short/3D/PyLith/trunk/pylith/meshio/PointsList.py 2012-02-10 20:29:33 UTC (rev 19611)
@@ -57,7 +57,8 @@
import pyre.inventory
- filename = pyre.inventory.str("filename", default="", validator=validateFilename)
+ filename = pyre.inventory.str("filename", default="",
+ validator=validateFilename)
filename.meta['tip'] = "Filename for list of points."
commentDelimiter = pyre.inventory.str("comment_delimiter", default="#")
@@ -86,7 +87,8 @@
points = numpy.loadtxt(self.filename, comments=self.commentDelimiter)
else:
points = numpy.loadtxt(self.filename,
- comments=self.commentDelimiter, delimiter=self.valueDelimiter)
+ comments=self.commentDelimiter,
+ delimiter=self.valueDelimiter)
return points
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am 2012-02-10 17:10:11 UTC (rev 19610)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am 2012-02-10 20:29:33 UTC (rev 19611)
@@ -126,6 +126,11 @@
data/DataWriterHDF5DataFaultMeshQuad4.cc \
data/DataWriterHDF5DataFaultMeshTet4.cc \
data/DataWriterHDF5DataFaultMeshHex8.cc \
+ data/OutputSolnPointsData.cc \
+ data/OutputSolnPointsDataTri3.cc \
+ data/OutputSolnPointsDataQuad4.cc \
+ data/OutputSolnPointsDataTet4.cc \
+ data/OutputSolnPointsDataHex8.cc \
data/MeshData.cc \
data/MeshData1D.cc \
data/MeshData1Din3D.cc \
@@ -189,6 +194,11 @@
data/DataWriterHDF5DataFaultMeshQuad4.hh \
data/DataWriterHDF5DataFaultMeshTet4.hh \
data/DataWriterHDF5DataFaultMeshHex8.hh \
+ data/OutputSolnPointsData.hh \
+ data/OutputSolnPointsDataTri3.hh \
+ data/OutputSolnPointsDataQuad4.hh \
+ data/OutputSolnPointsDataTet4.hh \
+ data/OutputSolnPointsDataHex8.hh \
data/MeshData.hh \
data/MeshData1D.hh \
data/MeshData1Din2D.hh \
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc 2012-02-10 17:10:11 UTC (rev 19610)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.cc 2012-02-10 20:29:33 UTC (rev 19611)
@@ -28,6 +28,11 @@
#include "spatialdata/geocoords/CSCart.hh" // USES CSCart
+#include "data/OutputSolnPointsDataTri3.hh"
+#include "data/OutputSolnPointsDataQuad4.hh"
+#include "data/OutputSolnPointsDataTet4.hh"
+#include "data/OutputSolnPointsDataHex8.hh"
+
#include <string.h> // USES strcmp()
// ----------------------------------------------------------------------
@@ -47,131 +52,96 @@
// ----------------------------------------------------------------------
-// Test setupInterpolator() for 2D points.
+// Test setupInterpolator for tri3 mesh.
void
-pylith::meshio::TestOutputSolnPoints::testSetupInterpolator2D(void)
-{ // testSetupInterpolator2D
- const char* meshFilename = "data/quad4.mesh";
- const int numPoints = 7;
- const PylithScalar points[14] = {
- 0.0, 0.1, // interior points
- 0.3, 0.4,
- -0.6, -0.7,
- -1.0, 0.9,
- -0.3, 0.8,
- 0.3, 0.99999, // edge point
- -0.999999, 0.99999, // vertex point
- };
- const int nvertices = numPoints;
- const int verticesE[7] = { 7, 8, 9, 10, 11, 12, 13 };
- const int ncells = numPoints;
- const int ncorners = 1;
- const int cellsE[7] = { 7, 8, 9, 10, 11, 12, 13 };
- const int spaceDim = 2;
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorTri3(void)
+{ // testSetupInterpolatorTri3
+ OutputSolnPoints output;
+ OutputSolnPointsDataTri3 data;
- topology::Mesh mesh;
- spatialdata::geocoords::CSCart cs;
- cs.setSpaceDim(spaceDim);
- cs.initialize();
- mesh.coordsys(&cs);
- MeshIOAscii iohandler;
- iohandler.filename(meshFilename);
- iohandler.read(&mesh);
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorTri3
+
+// ----------------------------------------------------------------------
+// Test setupInterpolator for quad4 mesh.
+void
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorQuad4(void)
+{ // testSetupInterpolatorQuad4
OutputSolnPoints output;
- output.setupInterpolator(&mesh, points, numPoints, spaceDim);
+ OutputSolnPointsDataQuad4 data;
- const topology::Mesh& pointsMesh = output.pointsMesh();
- const ALE::Obj<SieveMesh>& sievePointsMesh = pointsMesh.sieveMesh();
- CPPUNIT_ASSERT(!sievePointsMesh.isNull());
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorQuad4
- pointsMesh.view("POINTS MESH");
- // Check vertices
- const ALE::Obj<SieveMesh::label_sequence>& vertices =
- sievePointsMesh->depthStratum(0);
- const SieveMesh::label_sequence::iterator verticesEnd = vertices->end();
- CPPUNIT_ASSERT_EQUAL(nvertices, int(vertices->size()));
- int ipt = 0;
- for (SieveMesh::label_sequence::iterator v_iter=vertices->begin();
- v_iter != verticesEnd;
- ++v_iter, ++ipt)
- CPPUNIT_ASSERT_EQUAL(verticesE[ipt], *v_iter);
+// ----------------------------------------------------------------------
+// Test setupInterpolator for tet4 mesh.
+void
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorTet4(void)
+{ // testSetupInterpolatorTet4
+ OutputSolnPoints output;
+ OutputSolnPointsDataTet4 data;
- // Check cells
- const ALE::Obj<SieveMesh::label_sequence>& cells =
- sievePointsMesh->heightStratum(0);
- const SieveMesh::label_sequence::iterator cellsEnd = cells->end();
- const ALE::Obj<SieveMesh::sieve_type>& sieve = sievePointsMesh->getSieve();
- assert(!sieve.isNull());
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorTet4
- CPPUNIT_ASSERT_EQUAL(ncells, int(cells->size()));
- ALE::ISieveVisitor::PointRetriever<SieveMesh::sieve_type> pV(sieve->getMaxConeSize());
- int i = 0;
- for (SieveMesh::label_sequence::iterator c_iter=cells->begin(); c_iter != cellsEnd; ++c_iter) {
- sieve->cone(*c_iter, pV);
- const SieveMesh::point_type* cone = pV.getPoints();
- CPPUNIT_ASSERT_EQUAL(ncorners, (int) pV.getSize());
- for(int p = 0; p < pV.getSize(); ++p, ++i) {
- CPPUNIT_ASSERT_EQUAL(cellsE[i], cone[p]);
- }
- pV.clear();
- } // for
-} // testSetupInterpolator2D
+// ----------------------------------------------------------------------
+// Test setupInterpolator for hex8 mesh.
+void
+pylith::meshio::TestOutputSolnPoints::testSetupInterpolatorHex8(void)
+{ // testSetupInterpolatorHex8
+ OutputSolnPoints output;
+ OutputSolnPointsDataHex8 data;
+ _testSetupInterpolator(data);
+} // testSetupInterpolatorHex8
+
// ----------------------------------------------------------------------
-// Test setupInterpolator() for 3D points.
+// Test setupInterpolator().
void
-pylith::meshio::TestOutputSolnPoints::testSetupInterpolator3D(void)
-{ // testSetupInterpolator3D
- const char* meshFilename = "data/hex8.mesh";
- const int numPoints = 7;
- const PylithScalar points[21] = {
- 0.0001, 0.1, 0.2, // interior points
- 0.3, -0.4, 0.5,
- 0.6, 0.7, -0.8,
- -0.9999, 0.1, -0.3,
- 0.3, 0.8, 0.5,
- 0.3, 0.9999, 0.9999, // edge point
- 0.000001, 0.9999, -0.999999, // vertex point
- };
- const int nvertices = numPoints;
- const int verticesE[7] = { 7, 8, 9, 10, 11, 12, 13 };
- const int ncells = numPoints;
- const int ncorners = 1;
- const int cellsE[7] = { 7, 8, 9, 10, 11, 12, 13 };
- const int spaceDim = 3;
+pylith::meshio::TestOutputSolnPoints::_testSetupInterpolator(const OutputSolnPointsData& data)
+{ // _testSetupInterpolator
+ const int numPoints = data.numPoints;
+ const int spaceDim = data.spaceDim;
+ const int numVerticesE = numPoints;
+ const int numCellsE = numPoints;
+ const int numCornersE = 1;
+
topology::Mesh mesh;
spatialdata::geocoords::CSCart cs;
cs.setSpaceDim(spaceDim);
cs.initialize();
mesh.coordsys(&cs);
MeshIOAscii iohandler;
- iohandler.filename(meshFilename);
+ iohandler.filename(data.meshFilename);
iohandler.read(&mesh);
OutputSolnPoints output;
- output.setupInterpolator(&mesh, points, numPoints, spaceDim);
+ CPPUNIT_ASSERT(data.points);
+ output.setupInterpolator(&mesh, data.points, numPoints, spaceDim);
const topology::Mesh& pointsMesh = output.pointsMesh();
const ALE::Obj<SieveMesh>& sievePointsMesh = pointsMesh.sieveMesh();
CPPUNIT_ASSERT(!sievePointsMesh.isNull());
- pointsMesh.view("POINTS MESH");
+ pointsMesh.view("POINTS MESH"); // DEBUGGING
// Check vertices
const ALE::Obj<SieveMesh::label_sequence>& vertices =
sievePointsMesh->depthStratum(0);
const SieveMesh::label_sequence::iterator verticesEnd = vertices->end();
- CPPUNIT_ASSERT_EQUAL(nvertices, int(vertices->size()));
+ CPPUNIT_ASSERT_EQUAL(numVerticesE, int(vertices->size()));
int ipt = 0;
for (SieveMesh::label_sequence::iterator v_iter=vertices->begin();
v_iter != verticesEnd;
- ++v_iter, ++ipt)
- CPPUNIT_ASSERT_EQUAL(verticesE[ipt], *v_iter);
+ ++v_iter, ++ipt) {
+ const int vertexE = numCellsE + ipt;
+ CPPUNIT_ASSERT_EQUAL(vertexE, *v_iter);
+ } // for
// Check cells
const ALE::Obj<SieveMesh::label_sequence>& cells =
@@ -180,20 +150,22 @@
const ALE::Obj<SieveMesh::sieve_type>& sieve = sievePointsMesh->getSieve();
assert(!sieve.isNull());
- CPPUNIT_ASSERT_EQUAL(ncells, int(cells->size()));
+ CPPUNIT_ASSERT_EQUAL(numCellsE, int(cells->size()));
ALE::ISieveVisitor::PointRetriever<SieveMesh::sieve_type> pV(sieve->getMaxConeSize());
int i = 0;
for (SieveMesh::label_sequence::iterator c_iter=cells->begin(); c_iter != cellsEnd; ++c_iter) {
sieve->cone(*c_iter, pV);
- const SieveMesh::point_type *cone = pV.getPoints();
- CPPUNIT_ASSERT_EQUAL(ncorners, (int) pV.getSize());
+ const SieveMesh::point_type* cone = pV.getPoints();
+ CPPUNIT_ASSERT_EQUAL(numCornersE, (int) pV.getSize());
for(int p = 0; p < pV.getSize(); ++p, ++i) {
- CPPUNIT_ASSERT_EQUAL(cellsE[i], cone[p]);
- }
+ const int coneE = numCellsE+i;
+ CPPUNIT_ASSERT_EQUAL(coneE, cone[p]);
+ } // for
pV.clear();
} // for
-} // testSetupInterpolator3D
+} // _testSetupInterpolator
+
// End of file
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.hh 2012-02-10 17:10:11 UTC (rev 19610)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputSolnPoints.hh 2012-02-10 20:29:33 UTC (rev 19611)
@@ -33,6 +33,8 @@
namespace pylith {
namespace meshio {
class TestOutputSolnPoints;
+
+ class OutputSolnPointsData;
} // meshio
} // pylith
@@ -44,9 +46,12 @@
CPPUNIT_TEST_SUITE( TestOutputSolnPoints );
CPPUNIT_TEST( testConstructor );
- CPPUNIT_TEST( testSetupInterpolator2D );
- CPPUNIT_TEST( testSetupInterpolator3D );
+ CPPUNIT_TEST( testSetupInterpolatorTri3 );
+ CPPUNIT_TEST( testSetupInterpolatorQuad4 );
+ CPPUNIT_TEST( testSetupInterpolatorTet4 );
+ CPPUNIT_TEST( testSetupInterpolatorHex8 );
+
CPPUNIT_TEST_SUITE_END();
// PUBLIC METHODS /////////////////////////////////////////////////////
@@ -55,12 +60,27 @@
/// Test constructor
void testConstructor(void);
- /// Test setupInterpolator for 2D mesh()
- void testSetupInterpolator2D(void);
+ /// Test setupInterpolator for tri3 mesh.
+ void testSetupInterpolatorTri3(void);
- /// Test setupInterpolator for 3D mesh()
- void testSetupInterpolator3D(void);
+ /// Test setupInterpolator for quad4 mesh.
+ void testSetupInterpolatorQuad4(void);
+ /// Test setupInterpolator for tet4 mesh.
+ void testSetupInterpolatorTet4(void);
+
+ /// Test setupInterpolator for hex8 mesh.
+ void testSetupInterpolatorHex8(void);
+
+ // PRIVATE METHODS ////////////////////////////////////////////////////
+private :
+
+ /** Test setupInterpolator.
+ *
+ * @param data Test data.
+ */
+ void _testSetupInterpolator(const OutputSolnPointsData& data);
+
}; // class TestOutputSolnPoints
#endif // pylith_meshio_testoutputsolnpoints_hh
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.cc 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,42 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsData.hh"
+
+// ----------------------------------------------------------------------
+// Constructor
+pylith::meshio::OutputSolnPointsData::OutputSolnPointsData(void) :
+ meshFilename(0),
+ spaceDim(0),
+ numPoints(0),
+ points(0),
+ numVertices(0),
+ fiberDim(0),
+ field(0),
+ fieldInterp(0)
+{ // constructor
+} // constructor
+
+// ----------------------------------------------------------------------
+// Destructor
+pylith::meshio::OutputSolnPointsData::~OutputSolnPointsData(void)
+{ // destructor
+} // destructor
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsData.hh 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,70 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointsdata_hh)
+#define pylith_meshio_outputsolnpointsdata_hh
+
+#include "pylith/utils/types.hh" // HASA PylithScalar
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsData;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public :
+
+ /// Constructor
+ OutputSolnPointsData(void);
+
+ /// Destructor
+ ~OutputSolnPointsData(void);
+
+// PUBLIC MEMBERS ///////////////////////////////////////////////////////
+public:
+
+ char* meshFilename; ///< Filename for input mesh
+
+ /// @name Point information.
+ //@{
+ int spaceDim; ///< Number of dimensions in vertex coordinates
+ int numPoints; ///< Number of points.
+ PylithScalar* points; ///< Coordinates of points.
+ //@}
+
+ /// @name Input data.
+ //@{
+ int numVertices;
+ int fiberDim;
+ PylithScalar* field; ///< Field over mesh.
+ //@}
+
+ /// @name Calculated values.
+ //@{
+ PylithScalar* fieldInterp; ///< Field interpolate to points.
+ //@}
+
+};
+
+#endif // pylith_meshio_outputsolnpointsdata_hh
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.cc 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,79 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataHex8.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataHex8::_meshFilename =
+ "data/hex8.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataHex8::_spaceDim = 2;
+const int pylith::meshio::OutputSolnPointsDataHex8::_numPoints = 4;
+const PylithScalar pylith::meshio::OutputSolnPointsDataHex8::_points[] = {
+ 0.1, 0.4, 0.2,// interior points
+ 0.3, 0.1, 0.8,
+ 0.001, 0.75, -0.0,// edge
+ 0.999, 0.0, 0.0, // vertex
+};
+
+const int pylith::meshio::OutputSolnPointsDataHex8::_numVertices = 12;
+const int pylith::meshio::OutputSolnPointsDataHex8::_fiberDim = 1;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataHex8::_field[] = {
+ 1.0,
+ 1.1,
+ 1.2,
+ 1.3,
+ 1.4,
+ 1.5,
+ 1.6,
+ 1.7,
+ 1.8,
+ 1.9,
+ 2.0,
+ 2.1,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataHex8::_fieldInterp[] = {
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataHex8::OutputSolnPointsDataHex8(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataHex8::~OutputSolnPointsDataHex8(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataHex8.hh 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointshex8_hh)
+#define pylith_meshio_outputsolnpointshex8_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataHex8;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataHex8 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataHex8(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataHex8(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 _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointshex8_hh
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.cc 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,79 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataQuad4.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataQuad4::_meshFilename =
+ "data/quad4.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataQuad4::_spaceDim = 2;
+const int pylith::meshio::OutputSolnPointsDataQuad4::_numPoints = 7;
+const PylithScalar pylith::meshio::OutputSolnPointsDataQuad4::_points[] = {
+ 0.0, 0.1, // interior points
+ 0.3, 0.4,
+ -0.6, -0.7,
+ -1.0, 0.9,
+ -0.3, 0.8,
+ 0.3, 0.99999, // edge point
+ -0.999999, 0.99999, // vertex point
+};
+
+const int pylith::meshio::OutputSolnPointsDataQuad4::_numVertices = 6;
+const int pylith::meshio::OutputSolnPointsDataQuad4::_fiberDim = 3;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataQuad4::_field[] = {
+ 1.0, 2.1, 3.2,
+ 1.1, 2.0, 3.3,
+ 1.2, 1.9, 3.4,
+ 1.3, 1.8, 3.5,
+ 1.4, 1.7, 3.6,
+ 1.5, 1.6, 3.7,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataQuad4::_fieldInterp[] = {
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+ 0.0, 0.0, 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataQuad4::OutputSolnPointsDataQuad4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataQuad4::~OutputSolnPointsDataQuad4(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataQuad4.hh 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointsquad4_hh)
+#define pylith_meshio_outputsolnpointsquad4_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataQuad4;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataQuad4 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataQuad4(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataQuad4(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 _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointsquad4_hh
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.cc 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,74 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataTet4.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataTet4::_meshFilename =
+ "data/tet4.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataTet4::_spaceDim = 3;
+const int pylith::meshio::OutputSolnPointsDataTet4::_numPoints = 5;
+const PylithScalar pylith::meshio::OutputSolnPointsDataTet4::_points[] = {
+ 0.1, 0.4, 0.1, // interior points
+ -0.2, 0.3, 0.2,
+ 0.3, 0.1, -0.0,
+ 0.001, 0.75, 0.0001, // edge
+ 0.999, 0.0, 0.0, // vertex
+};
+
+const int pylith::meshio::OutputSolnPointsDataTet4::_numVertices = 5;
+const int pylith::meshio::OutputSolnPointsDataTet4::_fiberDim = 2;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTet4::_field[] = {
+ 1.0, 2.5,
+ 1.1, 2.4,
+ 1.2, 2.3,
+ 1.3, 2.2,
+ 1.4, 2.1,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTet4::_fieldInterp[] = {
+ 0.0, 0.0,
+ 0.0, 0.0,
+ 0.0, 0.0,
+ 0.0, 0.0,
+ 0.0, 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataTet4::OutputSolnPointsDataTet4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataTet4::~OutputSolnPointsDataTet4(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTet4.hh 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointstet4_hh)
+#define pylith_meshio_outputsolnpointstet4_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataTet4;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataTet4 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataTet4(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataTet4(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 _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointstet4_hh
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.cc 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,73 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#include "OutputSolnPointsDataTri3.hh"
+
+const char* pylith::meshio::OutputSolnPointsDataTri3::_meshFilename =
+ "data/tri3.mesh";
+
+const int pylith::meshio::OutputSolnPointsDataTri3::_spaceDim = 2;
+const int pylith::meshio::OutputSolnPointsDataTri3::_numPoints = 5;
+const PylithScalar pylith::meshio::OutputSolnPointsDataTri3::_points[] = {
+ 0.1, 0.4, // interior points
+ -0.2, 0.3,
+ 0.3, 0.1,
+ 0.001, 0.75, // edge
+ 0.999, 0.0, // vertex
+};
+
+const int pylith::meshio::OutputSolnPointsDataTri3::_numVertices = 4;
+const int pylith::meshio::OutputSolnPointsDataTri3::_fiberDim = 1;
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTri3::_field[] = {
+ 1.0,
+ 1.1,
+ 1.2,
+ 1.3,
+};
+
+const PylithScalar pylith::meshio::OutputSolnPointsDataTri3::_fieldInterp[] = {
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+ 0.0,
+};
+
+
+// ----------------------------------------------------------------------
+pylith::meshio::OutputSolnPointsDataTri3::OutputSolnPointsDataTri3(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ spaceDim = _spaceDim;
+ numPoints = _numPoints;
+ points = const_cast<PylithScalar*>(_points);
+
+ numVertices = _numVertices;
+ fiberDim = _fiberDim;
+ field = const_cast<PylithScalar*>(_field);
+
+ fieldInterp = const_cast<PylithScalar*>(_fieldInterp);
+
+} // constructor
+
+pylith::meshio::OutputSolnPointsDataTri3::~OutputSolnPointsDataTri3(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/OutputSolnPointsDataTri3.hh 2012-02-10 20:29:33 UTC (rev 19611)
@@ -0,0 +1,61 @@
+// -*- 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-2011 University of California, Davis
+//
+// See COPYING for license information.
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_outputsolnpointstri3_hh)
+#define pylith_meshio_outputsolnpointstri3_hh
+
+#include "OutputSolnPointsData.hh"
+
+namespace pylith {
+ namespace meshio {
+ class OutputSolnPointsDataTri3;
+ } // pylith
+} // meshio
+
+class pylith::meshio::OutputSolnPointsDataTri3 : public OutputSolnPointsData
+{
+
+// PUBLIC METHODS ///////////////////////////////////////////////////////
+public:
+
+ /// Constructor
+ OutputSolnPointsDataTri3(void);
+
+ /// Destructor
+ ~OutputSolnPointsDataTri3(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 _numPoints; ///< Number of points.
+ static const PylithScalar _points[]; ///< Coordinates of points.
+
+ static const int _numVertices; ///< Number of points in mesh.
+ static const int _fiberDim; ///< Fiber dimension of field.
+ static const PylithScalar _field[]; ///< Field over mesh.
+ static const PylithScalar _fieldInterp[]; ///< Field interpolated to points.
+
+};
+
+#endif // pylith_meshio_outputsolnpointstri3_hh
+
+
+// End of file
More information about the CIG-COMMITS
mailing list