[cig-commits] r11305 - in short/3D/PyLith/trunk/unittests/libtests: bc meshio meshio/data

brad at geodynamics.org brad at geodynamics.org
Sun Mar 2 20:08:29 PST 2008


Author: brad
Date: 2008-03-02 20:08:29 -0800 (Sun, 02 Mar 2008)
New Revision: 11305

Added:
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.hh
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_cell_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_vertex_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_cell_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_t10.vtk
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_vertex_t10.vtk
Modified:
   short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc
   short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
   short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am
Log:
Finished C++ unit tests for DataWriterVTK (boundary mesh).

Modified: short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc	2008-03-03 00:43:23 UTC (rev 11304)
+++ short/3D/PyLith/trunk/unittests/libtests/bc/TestBoundaryMesh.cc	2008-03-03 04:08:29 UTC (rev 11305)
@@ -58,7 +58,7 @@
     ALE::Selection<ALE::Mesh>::submesh(mesh, mesh->getIntSection(label));
   CPPUNIT_ASSERT(!subMesh.isNull());
 
-  subMesh->view("SUBMESH WITHOUT FAULT");
+  //subMesh->view("SUBMESH WITHOUT FAULT");
 
   const ALE::Obj<Mesh::label_sequence>& vertices = subMesh->depthStratum(0);
   const Mesh::label_sequence::iterator verticesEnd = vertices->end();
@@ -124,7 +124,7 @@
     ALE::Selection<ALE::Mesh>::submesh(mesh, mesh->getIntSection(label));
   CPPUNIT_ASSERT(!subMesh.isNull());
 
-  subMesh->view("SUBMESH WITH FAULT");
+  //subMesh->view("SUBMESH WITH FAULT");
 
   const ALE::Obj<Mesh::label_sequence>& vertices = subMesh->depthStratum(0);
   const Mesh::label_sequence::iterator verticesEnd = vertices->end();

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am	2008-03-03 00:43:23 UTC (rev 11304)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/Makefile.am	2008-03-03 04:08:29 UTC (rev 11305)
@@ -39,14 +39,15 @@
 	TestDataWriterVTKFaultMeshTet4.cc \
 	TestDataWriterVTKFaultMeshHex8.cc \
 	TestDataWriterVTKBCMesh.cc \
+	TestDataWriterVTKBCMeshTri3.cc \
 	TestDataWriterVTKBCMeshQuad4.cc \
+	TestDataWriterVTKBCMeshTet4.cc \
+	TestDataWriterVTKBCMeshHex8.cc \
 	TestMeshIO.cc \
 	TestMeshIOAscii.cc \
 	TestMeshIOLagrit.cc \
 	test_meshio.cc
 
-# Need to determine proper behavior for submesh w/cohesive cells()
-#	TestDataWriterVTKBCMeshTri3.cc 
 
 noinst_HEADERS = \
 	TestDataWriterVTK.hh \
@@ -67,13 +68,14 @@
 	TestDataWriterVTKFaultMeshTet4.hh \
 	TestDataWriterVTKFaultMeshHex8.hh \
 	TestDataWriterVTKBCMesh.hh \
+	TestDataWriterVTKBCMeshTri3.hh \
 	TestDataWriterVTKBCMeshQuad4.hh \
+	TestDataWriterVTKBCMeshTet4.hh \
+	TestDataWriterVTKBCMeshHex8.hh \
 	TestMeshIO.hh \
 	TestMeshIOAscii.hh \
 	TestMeshIOLagrit.hh
 
-# Need to determine proper behavior for submesh w/cohesive cells()
-#	TestDataWriterVTKBCMeshTri3.hh
 
 # Source files associated with testing data
 testmeshio_SOURCES += \
@@ -94,6 +96,8 @@
 	data/DataWriterVTKDataFaultMeshHex8.cc \
 	data/DataWriterVTKDataBCMeshTri3.cc \
 	data/DataWriterVTKDataBCMeshQuad4.cc \
+	data/DataWriterVTKDataBCMeshTet4.cc \
+	data/DataWriterVTKDataBCMeshHex8.cc \
 	data/MeshData.cc \
 	data/MeshData1D.cc \
 	data/MeshData1Din3D.cc \
@@ -126,6 +130,8 @@
 	data/DataWriterVTKDataFaultMeshHex8.hh \
 	data/DataWriterVTKDataBCMeshTri3.hh \
 	data/DataWriterVTKDataBCMeshQuad4.hh \
+	data/DataWriterVTKDataBCMeshTet4.hh \
+	data/DataWriterVTKDataBCMeshHex8.hh \
 	data/MeshData.hh \
 	data/MeshData1D.hh \
 	data/MeshData1Din2D.hh \
@@ -209,9 +215,18 @@
 	hex8_fault_t10.vtk \
 	hex8_fault_vertex_t10.vtk \
 	hex8_fault_cell_t10.vtk \
+	tri3_bc_t10.vtk \
+	tri3_bc_vertex_t10.vtk \
+	tri3_bc_cell_t10.vtk \
 	quad4_bc_t10.vtk \
 	quad4_bc_vertex_t10.vtk \
-	quad4_bc_cell_t10.vtk
+	quad4_bc_cell_t10.vtk \
+	tet4_bc_t10.vtk \
+	tet4_bc_vertex_t10.vtk \
+	tet4_bc_cell_t10.vtk \
+	hex8_bc_t10.vtk \
+	hex8_bc_vertex_t10.vtk \
+	hex8_bc_cell_t10.vtk 
 
 CLEANFILES = $(noinst_tmp)
 

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.cc	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDataWriterVTKBCMeshHex8.hh" // Implementation of class methods
+
+#include "data/DataWriterVTKDataBCMeshHex8.hh" // USES DataWriterVTKDataBCMeshHex8
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKBCMeshHex8 );
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterVTKBCMeshHex8::setUp(void)
+{ // setUp
+  TestDataWriterVTKBCMesh::setUp();
+  _data = new DataWriterVTKDataBCMeshHex8;
+  _initialize();
+} // setUp
+
+
+// End of file 

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.hh	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/meshio/TestDataWriterVTKBCMeshHex8.hh
+ *
+ * @brief C++ TestDataWriterVTKBCMeshHex8 object
+ *
+ * C++ unit testing for DataWriterVTKBCMeshHex8.
+ */
+
+#if !defined(pylith_meshio_testdatawritervtkbcmeshhex8_hh)
+#define pylith_meshio_testdatawritervtkbcmeshhex8_hh
+
+#include "TestDataWriterVTKBCMesh.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace meshio {
+    class TestDataWriterVTKBCMeshHex8;
+  } // meshio
+} // pylith
+
+/// C++ unit testing for DataWriterVTK
+class pylith::meshio::TestDataWriterVTKBCMeshHex8 : public TestDataWriterVTKBCMesh
+{ // class TestDataWriterVTKBCMeshHex8
+
+  // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+  CPPUNIT_TEST_SUITE( TestDataWriterVTKBCMeshHex8 );
+
+  CPPUNIT_TEST( testTimeStep );
+  CPPUNIT_TEST( testWriteVertexField );
+  CPPUNIT_TEST( testWriteCellField );
+
+  CPPUNIT_TEST_SUITE_END();
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Setup testing data.
+  void setUp(void);
+
+}; // class TestDataWriterVTKBCMeshHex8
+
+#endif // pylith_meshio_testdatawritervtkbcmeshhex8_hh
+
+
+// End of file 

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.cc	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+#include <portinfo>
+
+#include "TestDataWriterVTKBCMeshTet4.hh" // Implementation of class methods
+
+#include "data/DataWriterVTKDataBCMeshTet4.hh" // USES DataWriterVTKDataBCMeshTet4
+
+// ----------------------------------------------------------------------
+CPPUNIT_TEST_SUITE_REGISTRATION( pylith::meshio::TestDataWriterVTKBCMeshTet4 );
+
+// ----------------------------------------------------------------------
+// Setup testing data.
+void
+pylith::meshio::TestDataWriterVTKBCMeshTet4::setUp(void)
+{ // setUp
+  TestDataWriterVTKBCMesh::setUp();
+  _data = new DataWriterVTKDataBCMeshTet4;
+  _initialize();
+} // setUp
+
+
+// End of file 

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.hh	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+//
+// ----------------------------------------------------------------------
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ----------------------------------------------------------------------
+//
+
+/**
+ * @file unittests/libtests/meshio/TestDataWriterVTKBCMeshTet4.hh
+ *
+ * @brief C++ TestDataWriterVTKBCMeshTet4 object
+ *
+ * C++ unit testing for DataWriterVTKBCMeshTet4.
+ */
+
+#if !defined(pylith_meshio_testdatawritervtkbcmeshtet4_hh)
+#define pylith_meshio_testdatawritervtkbcmeshtet4_hh
+
+#include "TestDataWriterVTKBCMesh.hh"
+
+/// Namespace for pylith package
+namespace pylith {
+  namespace meshio {
+    class TestDataWriterVTKBCMeshTet4;
+  } // meshio
+} // pylith
+
+/// C++ unit testing for DataWriterVTK
+class pylith::meshio::TestDataWriterVTKBCMeshTet4 : public TestDataWriterVTKBCMesh
+{ // class TestDataWriterVTKBCMeshTet4
+
+  // CPPUNIT TEST SUITE /////////////////////////////////////////////////
+  CPPUNIT_TEST_SUITE( TestDataWriterVTKBCMeshTet4 );
+
+  CPPUNIT_TEST( testTimeStep );
+  CPPUNIT_TEST( testWriteVertexField );
+  CPPUNIT_TEST( testWriteCellField );
+
+  CPPUNIT_TEST_SUITE_END();
+
+  // PUBLIC METHODS /////////////////////////////////////////////////////
+public :
+
+  /// Setup testing data.
+  void setUp(void);
+
+}; // class TestDataWriterVTKBCMeshTet4
+
+#endif // pylith_meshio_testdatawritervtkbcmeshtet4_hh
+
+
+// End of file 

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.cc	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataBCMeshHex8.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshHex8::_meshFilename = 
+  "data/hex8.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshHex8::_bcLabel = 
+  "top";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshHex8::_faultLabel = 
+  "fault";
+const int pylith::meshio::DataWriterVTKDataBCMeshHex8::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshHex8::_timestepFilename = 
+  "hex8_bc.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshHex8::_vertexFilename = 
+  "hex8_bc_vertex.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshHex8::_cellFilename = 
+  "hex8_bc_cell.vtk";
+
+const double pylith::meshio::DataWriterVTKDataBCMeshHex8::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshHex8::_timeFormat = 
+  "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataBCMeshHex8::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataBCMeshHex8::_numVertices = 8;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataBCMeshHex8::_vertexFields[] = {
+  { "displacements", VECTOR_FIELD, 3 },
+  { "pressure", SCALAR_FIELD, 1 },
+  { "other", OTHER_FIELD, 2 },
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshHex8::_vertexField0[] = {
+  1.1, 2.2, 3.3,
+  4.4, 5.5, 6.6,
+  7.7, 8.8, 9.9,
+  10.1, 11.2, 12.3,
+  1.2, 2.3, 3.4,
+  4.5, 5.6, 6.7,
+  7.8, 8.9, 9.0,
+  10.2, 11.3, 12.4,
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshHex8::_vertexField1[] = {
+  2.1, 3.2, 4.3, 5.4, 6.5, 7.6, 8.7, 9.8,
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshHex8::_vertexField2[] = {
+  1.2, 2.3,
+  3.4, 4.5,
+  5.6, 6.7,
+  7.8, 8.9,
+  1.3, 2.4,
+  3.5, 4.6,
+  5.7, 6.8,
+  7.9, 8.0,
+};
+
+const int pylith::meshio::DataWriterVTKDataBCMeshHex8::_numCellFields = 3;
+const int pylith::meshio::DataWriterVTKDataBCMeshHex8::_numCells = 2;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataBCMeshHex8::_cellFields[] = {
+  { "traction", VECTOR_FIELD, 3 },
+  { "pressure", SCALAR_FIELD, 1 },
+  { "other", TENSOR_FIELD, 6 },
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshHex8::_cellField0[] = {
+  1.1, 2.2, 3.3,
+  4.4, 5.5, 6.6
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshHex8::_cellField1[] = {
+  2.1, 3.2,
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshHex8::_cellField2[] = {
+  1.2, 2.3, 3.4, 4.5, 5.6, 6.7,
+  7.8, 8.9, 9.0, 10.1, 11.2, 12.3
+};
+
+pylith::meshio::DataWriterVTKDataBCMeshHex8::DataWriterVTKDataBCMeshHex8(void)
+{ // constructor
+  meshFilename = const_cast<char*>(_meshFilename);
+  bcLabel = const_cast<char*>(_bcLabel);
+  faultLabel = const_cast<char*>(_faultLabel);
+  faultId = _faultId;
+
+  timestepFilename = const_cast<char*>(_timestepFilename);
+  vertexFilename = const_cast<char*>(_vertexFilename);
+  cellFilename = const_cast<char*>(_cellFilename);
+
+  time = _time;
+  timeFormat = const_cast<char*>(_timeFormat);
+  
+  numVertexFields = _numVertexFields;
+  numVertices = _numVertices;
+  assert(3 == numVertexFields);
+  vertexFieldsInfo = const_cast<DataWriterVTKData::FieldStruct*>(_vertexFields);
+  vertexFields[0] = const_cast<double*>(_vertexField0);
+  vertexFields[1] = const_cast<double*>(_vertexField1);
+  vertexFields[2] = const_cast<double*>(_vertexField2);
+
+  numCellFields = _numCellFields;
+  numCells = _numCells;
+  assert(3 == numCellFields);
+  cellFieldsInfo = const_cast<DataWriterVTKData::FieldStruct*>(_cellFields);
+  cellFields[0] = const_cast<double*>(_cellField0);
+  cellFields[1] = const_cast<double*>(_cellField1);
+  cellFields[2] = const_cast<double*>(_cellField2);
+} // constructor
+
+pylith::meshio::DataWriterVTKDataBCMeshHex8::~DataWriterVTKDataBCMeshHex8(void)
+{}
+
+
+// End of file

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshHex8.hh	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatabcmeshhex8_hh)
+#define pylith_meshio_datawritervtkdatabcmeshhex8_hh
+
+#include "DataWriterVTKData.hh" // ISA DataWriterVTKData
+
+namespace pylith {
+  namespace meshio {
+     class DataWriterVTKDataBCMeshHex8;
+  } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataBCMeshHex8 : public DataWriterVTKData
+{ // DataWriterVTKDataBCMeshHex8
+
+public: 
+
+  /// Constructor
+  DataWriterVTKDataBCMeshHex8(void);
+
+  /// Destructor
+  ~DataWriterVTKDataBCMeshHex8(void);
+
+private:
+
+  static const char* _meshFilename; ///< Name of mesh file.
+  static const char* _bcLabel; ///< Label defining boundary vertices.
+  static const char* _faultLabel; ///< Name of group of vertices for fault.
+  static const int _faultId; ///< Material identifier for fault.
+
+  static const char* _timestepFilename; ///< Name of VTK file without fields.
+  static const char* _vertexFilename; ///< Name of VTK file for vertex fields.
+  static const char* _cellFilename; ///< Name of VTK file for cell fields.
+
+  static const double _time; ///< Time for fields.
+  static const char* _timeFormat; ///< Format for time stamp.
+
+  /// @name Vertex field information.
+  //@{
+  static const int _numVertexFields; ///< Number of vertex fields.
+  static const int _numVertices; ///< Number of vertices.
+  static const FieldStruct _vertexFields[]; ///< Array of vertex fields.
+
+  static const double _vertexField0[]; ///< Values for vertex field 0.
+  static const double _vertexField1[]; ///< Values for vertex field 1.
+  static const double _vertexField2[]; ///< Values for vertex field 2.
+  //@}
+
+  /// @name Cell field information.
+  //@{
+  static const int _numCellFields; ///< Number of cell fields.
+  static const int _numCells; ///< Number of cells.
+  static const FieldStruct _cellFields[]; ///< Array of cell fields.
+
+  static const double _cellField0[]; ///< Values for cell field 0.
+  static const double _cellField1[]; ///< Values for cell field 1.
+  static const double _cellField2[]; ///< Values for cell field 2.
+  //@}
+
+}; // DataWriterVTKDataBCMeshHex8
+
+#endif // pylith_meshio_datawritervtkdatabcmeshhex8_hh
+
+// End of file

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.cc	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.cc	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,126 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataBCMeshTet4.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshTet4::_meshFilename = 
+  "data/tet4.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshTet4::_bcLabel = 
+  "boundary";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshTet4::_faultLabel = 
+  "fault";
+const int pylith::meshio::DataWriterVTKDataBCMeshTet4::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshTet4::_timestepFilename = 
+  "tet4_bc.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshTet4::_vertexFilename = 
+  "tet4_bc_vertex.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshTet4::_cellFilename = 
+  "tet4_bc_cell.vtk";
+
+const double pylith::meshio::DataWriterVTKDataBCMeshTet4::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataBCMeshTet4::_timeFormat = 
+  "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataBCMeshTet4::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataBCMeshTet4::_numVertices = 6;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataBCMeshTet4::_vertexFields[] = {
+  { "displacements", VECTOR_FIELD, 3 },
+  { "pressure", SCALAR_FIELD, 1 },
+  { "other", OTHER_FIELD, 2 },
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshTet4::_vertexField0[] = {
+  1.1, 2.2, 3.3,
+  4.4, 5.5, 6.6,
+  7.7, 8.8, 9.9,
+  10.0, 11.1, 12.2,
+  13.3, 14.4, 15.5,
+  16.6, 17.7, 18.8,
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshTet4::_vertexField1[] = {
+  2.1, 3.2, 4.3, 5.4, 6.5, 7.6,
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshTet4::_vertexField2[] = {
+  1.2, 2.3,
+  3.4, 4.5,
+  5.6, 6.7,
+  7.8, 8.9,
+  9.0, 10.1,
+  11.2, 12.3,
+};
+
+const int pylith::meshio::DataWriterVTKDataBCMeshTet4::_numCellFields = 3;
+const int pylith::meshio::DataWriterVTKDataBCMeshTet4::_numCells = 2;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataBCMeshTet4::_cellFields[] = {
+  { "traction", VECTOR_FIELD, 3 },
+  { "pressure", SCALAR_FIELD, 1 },
+  { "other", TENSOR_FIELD, 6 },
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshTet4::_cellField0[] = {
+  1.1, 2.2, 3.3,
+  4.4, 5.5, 6.6,
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshTet4::_cellField1[] = {
+  2.1, 3.2
+};
+const double pylith::meshio::DataWriterVTKDataBCMeshTet4::_cellField2[] = {
+  1.2, 2.3, 3.4, 4.5, 5.6, 6.7,
+  7.8, 8.9, 9.0, 10.1, 11.2, 12.3,
+};
+
+pylith::meshio::DataWriterVTKDataBCMeshTet4::DataWriterVTKDataBCMeshTet4(void)
+{ // constructor
+  meshFilename = const_cast<char*>(_meshFilename);
+  bcLabel = const_cast<char*>(_bcLabel);
+  faultLabel = const_cast<char*>(_faultLabel);
+  faultId = _faultId;
+
+  timestepFilename = const_cast<char*>(_timestepFilename);
+  vertexFilename = const_cast<char*>(_vertexFilename);
+  cellFilename = const_cast<char*>(_cellFilename);
+
+  time = _time;
+  timeFormat = const_cast<char*>(_timeFormat);
+  
+  numVertexFields = _numVertexFields;
+  assert(3 == numVertexFields);
+  numVertices = _numVertices;
+  vertexFieldsInfo = const_cast<DataWriterVTKData::FieldStruct*>(_vertexFields);
+  vertexFields[0] = const_cast<double*>(_vertexField0);
+  vertexFields[1] = const_cast<double*>(_vertexField1);
+  vertexFields[2] = const_cast<double*>(_vertexField2);
+
+  numCellFields = _numCellFields;
+  assert(3 == numCellFields);
+  numCells = _numCells;
+  cellFieldsInfo = const_cast<DataWriterVTKData::FieldStruct*>(_cellFields);
+  cellFields[0] = const_cast<double*>(_cellField0);
+  cellFields[1] = const_cast<double*>(_cellField1);
+  cellFields[2] = const_cast<double*>(_cellField2);
+} // constructor
+
+pylith::meshio::DataWriterVTKDataBCMeshTet4::~DataWriterVTKDataBCMeshTet4(void)
+{}
+
+
+// End of file

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.hh
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.hh	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/DataWriterVTKDataBCMeshTet4.hh	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+//                           Brad T. Aagaard
+//                        U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatabcmeshtet4_hh)
+#define pylith_meshio_datawritervtkdatabcmeshtet4_hh
+
+#include "DataWriterVTKData.hh" // ISA DataWriterVTKData
+
+namespace pylith {
+  namespace meshio {
+     class DataWriterVTKDataBCMeshTet4;
+  } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataBCMeshTet4 : public DataWriterVTKData
+{ // DataWriterVTKDataBCMeshTet4
+
+public: 
+
+  /// Constructor
+  DataWriterVTKDataBCMeshTet4(void);
+
+  /// Destructor
+  ~DataWriterVTKDataBCMeshTet4(void);
+
+private:
+
+  static const char* _meshFilename; ///< Name of mesh file.
+  static const char* _bcLabel; ///< Label defining boundary vertices.
+  static const char* _faultLabel; ///< Name of group of vertices for fault.
+  static const int _faultId; ///< Material identifier for fault.
+
+  static const char* _timestepFilename; ///< Name of VTK file without fields.
+  static const char* _vertexFilename; ///< Name of VTK file for vertex fields.
+  static const char* _cellFilename; ///< Name of VTK file for cell fields.
+
+  static const double _time; ///< Time for fields.
+  static const char* _timeFormat; ///< Format for time stamp.
+
+  /// @name Vertex field information.
+  //@{
+  static const int _numVertexFields; ///< Number of vertex fields.
+  static const int _numVertices; ///< Number of vertices.
+  static const FieldStruct _vertexFields[]; ///< Array of vertex fields.
+
+  static const double _vertexField0[]; ///< Values for vertex field 0.
+  static const double _vertexField1[]; ///< Values for vertex field 1.
+  static const double _vertexField2[]; ///< Values for vertex field 2.
+  //@}
+
+  /// @name Cell field information.
+  //@{
+  static const int _numCellFields; ///< Number of cell fields.
+  static const int _numCells; ///< Number of cells.
+  static const FieldStruct _cellFields[]; ///< Array of cell fields.
+
+  static const double _cellField0[]; ///< Values for cell field 0.
+  static const double _cellField1[]; ///< Values for cell field 1.
+  static const double _cellField2[]; ///< Values for cell field 2.
+  //@}
+
+}; // DataWriterVTKDataBCMeshTet4
+
+#endif // pylith_meshio_datawritervtkdatabcmeshtet4_hh
+
+// End of file

Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am	2008-03-03 00:43:23 UTC (rev 11304)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/Makefile.am	2008-03-03 04:08:29 UTC (rev 11305)
@@ -68,9 +68,18 @@
 	hex8_fault_t10.vtk \
 	hex8_fault_vertex_t10.vtk \
 	hex8_fault_cell_t10.vtk \
+	tri3_bc_t10.vtk \
+	tri3_bc_vertex_t10.vtk \
+	tri3_bc_cell_t10.vtk \
 	quad4_bc_t10.vtk \
 	quad4_bc_vertex_t10.vtk \
-	quad4_bc_cell_t10.vtk
+	quad4_bc_cell_t10.vtk \
+	tet4_bc_t10.vtk \
+	tet4_bc_vertex_t10.vtk \
+	tet4_bc_cell_t10.vtk \
+	hex8_bc_t10.vtk \
+	hex8_bc_vertex_t10.vtk \
+	hex8_bc_cell_t10.vtk 
 
 noinst_TMP =
 

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_cell_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_cell_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_cell_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,31 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 8 double
+-1 -1 1
+-1 1 1
+0 -1 1
+0 1 1
+1 -1 1
+1 1 1
+0 -1 1
+0 1 1
+CELLS 2 10
+4  6 7 1 0
+4  4 5 3 2
+CELL_TYPES 2
+9
+9
+CELL_DATA 2
+VECTORS traction double
+1.1 2.2 3.3
+4.4 5.5 6.6
+SCALARS pressure double 1
+LOOKUP_TABLE default
+2.1
+3.2
+SCALARS other double 6
+LOOKUP_TABLE default
+1.2 2.3 3.4 4.5 5.6 6.7
+7.8 8.9 9 10.1 11.2 12.3

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,19 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 8 double
+-1 -1 1
+-1 1 1
+0 -1 1
+0 1 1
+1 -1 1
+1 1 1
+0 -1 1
+0 1 1
+CELLS 2 10
+4  6 7 1 0
+4  4 5 3 2
+CELL_TYPES 2
+9
+9

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_vertex_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_vertex_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/hex8_bc_vertex_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,49 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 8 double
+-1 -1 1
+-1 1 1
+0 -1 1
+0 1 1
+1 -1 1
+1 1 1
+0 -1 1
+0 1 1
+CELLS 2 10
+4  6 7 1 0
+4  4 5 3 2
+CELL_TYPES 2
+9
+9
+POINT_DATA 8
+VECTORS displacements double
+1.1 2.2 3.3
+4.4 5.5 6.6
+7.7 8.8 9.9
+10.1 11.2 12.3
+1.2 2.3 3.4
+4.5 5.6 6.7
+7.8 8.9 9
+10.2 11.3 12.4
+SCALARS pressure double 1
+LOOKUP_TABLE default
+2.1
+3.2
+4.3
+5.4
+6.5
+7.6
+8.7
+9.8
+SCALARS other double 2
+LOOKUP_TABLE default
+1.2 2.3
+3.4 4.5
+5.6 6.7
+7.8 8.9
+1.3 2.4
+3.5 4.6
+5.7 6.8
+7.9 8

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_cell_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,29 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 6 double
+-1 0 0
+0 -1 0
+0 1 0
+1 0 0
+0 -1 0
+0 1 0
+CELLS 2 8
+3  0 2 1
+3  4 5 3
+CELL_TYPES 2
+5
+5
+CELL_DATA 2
+VECTORS traction double
+1.1 2.2 3.3
+4.4 5.5 6.6
+SCALARS pressure double 1
+LOOKUP_TABLE default
+2.1
+3.2
+SCALARS other double 6
+LOOKUP_TABLE default
+1.2 2.3 3.4 4.5 5.6 6.7
+7.8 8.9 9 10.1 11.2 12.3

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,17 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 6 double
+-1 0 0
+0 -1 0
+0 1 0
+1 0 0
+0 -1 0
+0 1 0
+CELLS 2 8
+3  0 2 1
+3  4 5 3
+CELL_TYPES 2
+5
+5

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tet4_bc_vertex_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,41 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 6 double
+-1 0 0
+0 -1 0
+0 1 0
+1 0 0
+0 -1 0
+0 1 0
+CELLS 2 8
+3  0 2 1
+3  4 5 3
+CELL_TYPES 2
+5
+5
+POINT_DATA 6
+VECTORS displacements double
+1.1 2.2 3.3
+4.4 5.5 6.6
+7.7 8.8 9.9
+10 11.1 12.2
+13.3 14.4 15.5
+16.6 17.7 18.8
+SCALARS pressure double 1
+LOOKUP_TABLE default
+2.1
+3.2
+4.3
+5.4
+6.5
+7.6
+SCALARS other double 2
+LOOKUP_TABLE default
+1.2 2.3
+3.4 4.5
+5.6 6.7
+7.8 8.9
+9 10.1
+11.2 12.3

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_cell_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_cell_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_cell_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,19 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 2 double
+0 -1 0.0
+1 0 0.0
+CELLS 1 3
+2  0 1
+CELL_TYPES 1
+3
+CELL_DATA 1
+VECTORS traction double
+1.1 2.2 0.0
+SCALARS pressure double 1
+LOOKUP_TABLE default
+2.1
+VECTORS other double
+1.2 2.3 3.4

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,11 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 2 double
+0 -1 0.0
+1 0 0.0
+CELLS 1 3
+2  0 1
+CELL_TYPES 1
+3

Added: short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_vertex_t10.vtk
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_vertex_t10.vtk	                        (rev 0)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/data/tri3_bc_vertex_t10.vtk	2008-03-03 04:08:29 UTC (rev 11305)
@@ -0,0 +1,23 @@
+# vtk DataFile Version 2.0
+Simplicial Mesh Example
+ASCII
+DATASET UNSTRUCTURED_GRID
+POINTS 2 double
+0 -1 0.0
+1 0 0.0
+CELLS 1 3
+2  0 1
+CELL_TYPES 1
+3
+POINT_DATA 2
+VECTORS displacements double
+1.1 2.2 0.0
+3.3 4.4 0.0
+SCALARS pressure double 1
+LOOKUP_TABLE default
+2.1
+3.2
+SCALARS other double 2
+LOOKUP_TABLE default
+1.2 2.3
+3.4 4.5



More information about the cig-commits mailing list