[cig-commits] r14844 - short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data
brad at geodynamics.org
brad at geodynamics.org
Fri May 1 17:54:59 PDT 2009
Author: brad
Date: 2009-05-01 17:54:59 -0700 (Fri, 01 May 2009)
New Revision: 14844
Added:
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.hh
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.cc
short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.hh
Log:
Started adding missing output unit tests.
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.cc 2009-05-02 00:54:59 UTC (rev 14844)
@@ -0,0 +1,130 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataSubMeshHex8.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshHex8::_meshFilename =
+ "data/hex8.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshHex8::_bcLabel =
+ "top";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshHex8::_faultLabel =
+ "fault";
+const int pylith::meshio::DataWriterVTKDataSubMeshHex8::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshHex8::_timestepFilename =
+ "hex8_bc.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshHex8::_vertexFilename =
+ "hex8_bc_vertex.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshHex8::_cellFilename =
+ "hex8_bc_cell.vtk";
+
+const double pylith::meshio::DataWriterVTKDataSubMeshHex8::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshHex8::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataSubMeshHex8::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshHex8::_numVertices = 8;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshHex8::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 3 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshHex8::_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::DataWriterVTKDataSubMeshHex8::_vertexField1[] = {
+ 2.1, 3.2, 4.3, 5.4, 6.5, 7.6, 8.7, 9.8,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshHex8::_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::DataWriterVTKDataSubMeshHex8::_numCellFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshHex8::_numCells = 2;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshHex8::_cellFields[] = {
+ { "traction", topology::FieldBase::VECTOR, 3 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::TENSOR, 6 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshHex8::_cellField0[] = {
+ 1.1, 2.2, 3.3,
+ 4.4, 5.5, 6.6
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshHex8::_cellField1[] = {
+ 2.1, 3.2,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshHex8::_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::DataWriterVTKDataSubMeshHex8::DataWriterVTKDataSubMeshHex8(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::DataWriterVTKDataSubMeshHex8::~DataWriterVTKDataSubMeshHex8(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshHex8.hh 2009-05-02 00:54:59 UTC (rev 14844)
@@ -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 DataWriterVTKDataSubMeshHex8;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataSubMeshHex8 : public DataWriterVTKData
+{ // DataWriterVTKDataSubMeshHex8
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataSubMeshHex8(void);
+
+ /// Destructor
+ ~DataWriterVTKDataSubMeshHex8(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.
+ //@}
+
+}; // DataWriterVTKDataSubMeshHex8
+
+#endif // pylith_meshio_datawritervtkdatabcmeshhex8_hh
+
+// End of file
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.cc 2009-05-02 00:54:59 UTC (rev 14844)
@@ -0,0 +1,114 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataSubMeshQuad4.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshQuad4::_meshFilename =
+ "data/quad4.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshQuad4::_bcLabel =
+ "bc3";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshQuad4::_timestepFilename =
+ "quad4_bc.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshQuad4::_vertexFilename =
+ "quad4_bc_vertex.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshQuad4::_cellFilename =
+ "quad4_bc_cell.vtk";
+
+const double pylith::meshio::DataWriterVTKDataSubMeshQuad4::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshQuad4::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataSubMeshQuad4::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshQuad4::_numVertices = 3;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshQuad4::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 2 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshQuad4::_vertexField0[] = {
+ 1.1, 2.2,
+ 3.3, 4.4,
+ 5.5, 6.6,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshQuad4::_vertexField1[] = {
+ 2.1, 3.2, 4.3,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshQuad4::_vertexField2[] = {
+ 1.2, 2.3,
+ 3.4, 4.5,
+ 5.6, 6.7,
+};
+
+const int pylith::meshio::DataWriterVTKDataSubMeshQuad4::_numCellFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshQuad4::_numCells = 2;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshQuad4::_cellFields[] = {
+ { "traction", topology::FieldBase::VECTOR, 2 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::TENSOR, 3 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshQuad4::_cellField0[] = {
+ 1.1, 2.2,
+ 3.3, 4.4,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshQuad4::_cellField1[] = {
+ 2.1, 3.2,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshQuad4::_cellField2[] = {
+ 1.2, 2.3, 3.4,
+ 4.5, 5.6, 6.7,
+};
+
+pylith::meshio::DataWriterVTKDataSubMeshQuad4::DataWriterVTKDataSubMeshQuad4(void)
+{ // constructor
+ meshFilename = const_cast<char*>(_meshFilename);
+ bcLabel = const_cast<char*>(_bcLabel);
+
+ 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::DataWriterVTKDataSubMeshQuad4::~DataWriterVTKDataSubMeshQuad4(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshQuad4.hh 2009-05-02 00:54:59 UTC (rev 14844)
@@ -0,0 +1,73 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatabcmeshquad4_hh)
+#define pylith_meshio_datawritervtkdatabcmeshquad4_hh
+
+#include "DataWriterVTKData.hh" // ISA DataWriterVTKData
+
+namespace pylith {
+ namespace meshio {
+ class DataWriterVTKDataSubMeshQuad4;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataSubMeshQuad4 : public DataWriterVTKData
+{ // DataWriterVTKDataSubMeshQuad4
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataSubMeshQuad4(void);
+
+ /// Destructor
+ ~DataWriterVTKDataSubMeshQuad4(void);
+
+private:
+
+ static const char* _meshFilename; ///< Name of mesh file.
+ static const char* _bcLabel; ///< Label defining group of vertices for bc.
+
+ 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.
+ //@}
+
+}; // DataWriterVTKDataSubMeshQuad4
+
+#endif // pylith_meshio_datawritervtkdatabcmeshquad4_hh
+
+// End of file
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.cc 2009-05-02 00:54:59 UTC (rev 14844)
@@ -0,0 +1,126 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataSubMeshTet4.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTet4::_meshFilename =
+ "data/tet4.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTet4::_bcLabel =
+ "boundary";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTet4::_faultLabel =
+ "fault";
+const int pylith::meshio::DataWriterVTKDataSubMeshTet4::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTet4::_timestepFilename =
+ "tet4_bc.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTet4::_vertexFilename =
+ "tet4_bc_vertex.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTet4::_cellFilename =
+ "tet4_bc_cell.vtk";
+
+const double pylith::meshio::DataWriterVTKDataSubMeshTet4::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTet4::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataSubMeshTet4::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshTet4::_numVertices = 6;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshTet4::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 3 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTet4::_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::DataWriterVTKDataSubMeshTet4::_vertexField1[] = {
+ 2.1, 3.2, 4.3, 5.4, 6.5, 7.6,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTet4::_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::DataWriterVTKDataSubMeshTet4::_numCellFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshTet4::_numCells = 2;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshTet4::_cellFields[] = {
+ { "traction", topology::FieldBase::VECTOR, 3 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::TENSOR, 6 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTet4::_cellField0[] = {
+ 1.1, 2.2, 3.3,
+ 4.4, 5.5, 6.6,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTet4::_cellField1[] = {
+ 2.1, 3.2
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTet4::_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::DataWriterVTKDataSubMeshTet4::DataWriterVTKDataSubMeshTet4(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::DataWriterVTKDataSubMeshTet4::~DataWriterVTKDataSubMeshTet4(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTet4.hh 2009-05-02 00:54:59 UTC (rev 14844)
@@ -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 DataWriterVTKDataSubMeshTet4;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataSubMeshTet4 : public DataWriterVTKData
+{ // DataWriterVTKDataSubMeshTet4
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataSubMeshTet4(void);
+
+ /// Destructor
+ ~DataWriterVTKDataSubMeshTet4(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.
+ //@}
+
+}; // DataWriterVTKDataSubMeshTet4
+
+#endif // pylith_meshio_datawritervtkdatabcmeshtet4_hh
+
+// End of file
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.cc
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.cc (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.cc 2009-05-02 00:54:59 UTC (rev 14844)
@@ -0,0 +1,116 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#include "DataWriterVTKDataSubMeshTri3.hh"
+
+#include <assert.h> // USES assert()
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTri3::_meshFilename =
+ "data/tri3.mesh";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTri3::_bcLabel =
+ "bc";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTri3::_faultLabel =
+ "fault";
+const int pylith::meshio::DataWriterVTKDataSubMeshTri3::_faultId = 100;
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTri3::_timestepFilename =
+ "tri3_bc.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTri3::_vertexFilename =
+ "tri3_bc_vertex.vtk";
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTri3::_cellFilename =
+ "tri3_bc_cell.vtk";
+
+const double pylith::meshio::DataWriterVTKDataSubMeshTri3::_time = 1.0;
+
+const char* pylith::meshio::DataWriterVTKDataSubMeshTri3::_timeFormat =
+ "%3.1f";
+
+const int pylith::meshio::DataWriterVTKDataSubMeshTri3::_numVertexFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshTri3::_numVertices = 2;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshTri3::_vertexFields[] = {
+ { "displacements", topology::FieldBase::VECTOR, 2 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::OTHER, 2 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTri3::_vertexField0[] = {
+ 1.1, 2.2,
+ 3.3, 4.4,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTri3::_vertexField1[] = {
+ 2.1, 3.2,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTri3::_vertexField2[] = {
+ 1.2, 2.3,
+ 3.4, 4.5,
+};
+
+const int pylith::meshio::DataWriterVTKDataSubMeshTri3::_numCellFields = 3;
+const int pylith::meshio::DataWriterVTKDataSubMeshTri3::_numCells = 1;
+
+const pylith::meshio::DataWriterVTKData::FieldStruct
+pylith::meshio::DataWriterVTKDataSubMeshTri3::_cellFields[] = {
+ { "traction", topology::FieldBase::VECTOR, 2 },
+ { "pressure", topology::FieldBase::SCALAR, 1 },
+ { "other", topology::FieldBase::TENSOR, 3 },
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTri3::_cellField0[] = {
+ 1.1, 2.2,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTri3::_cellField1[] = {
+ 2.1,
+};
+const double pylith::meshio::DataWriterVTKDataSubMeshTri3::_cellField2[] = {
+ 1.2, 2.3, 3.4,
+};
+
+pylith::meshio::DataWriterVTKDataSubMeshTri3::DataWriterVTKDataSubMeshTri3(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::DataWriterVTKDataSubMeshTri3::~DataWriterVTKDataSubMeshTri3(void)
+{}
+
+
+// End of file
Added: short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.hh
===================================================================
--- short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.hh (rev 0)
+++ short/3D/PyLith/branches/pylith-swig/unittests/libtests/meshio/data/DataWriterVTKDataSubMeshTri3.hh 2009-05-02 00:54:59 UTC (rev 14844)
@@ -0,0 +1,75 @@
+// -*- C++ -*-
+//
+// ======================================================================
+//
+// Brad T. Aagaard
+// U.S. Geological Survey
+//
+// {LicenseText}
+//
+// ======================================================================
+//
+
+#if !defined(pylith_meshio_datawritervtkdatabcmeshtri3_hh)
+#define pylith_meshio_datawritervtkdatabcmeshtri3_hh
+
+#include "DataWriterVTKData.hh" // ISA DataWriterVTKData
+
+namespace pylith {
+ namespace meshio {
+ class DataWriterVTKDataSubMeshTri3;
+ } // meshio
+} // pylith
+
+class pylith::meshio::DataWriterVTKDataSubMeshTri3 : public DataWriterVTKData
+{ // DataWriterVTKDataSubMeshTri3
+
+public:
+
+ /// Constructor
+ DataWriterVTKDataSubMeshTri3(void);
+
+ /// Destructor
+ ~DataWriterVTKDataSubMeshTri3(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.
+ //@}
+
+}; // DataWriterVTKDataSubMeshTri3
+
+#endif // pylith_meshio_datawritervtkdatabcmeshtri3_hh
+
+// End of file
More information about the CIG-COMMITS
mailing list