[cig-commits] r14917 - in short/3D/PyLith/trunk: libsrc/meshio modulesrc/meshio pylith/meshio unittests/libtests/meshio
brad at geodynamics.org
brad at geodynamics.org
Thu May 7 11:42:43 PDT 2009
Author: brad
Date: 2009-05-07 11:42:42 -0700 (Thu, 07 May 2009)
New Revision: 14917
Modified:
short/3D/PyLith/trunk/libsrc/meshio/DataWriter.hh
short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc
short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.hh
short/3D/PyLith/trunk/libsrc/meshio/OutputManager.cc
short/3D/PyLith/trunk/libsrc/meshio/OutputManager.hh
short/3D/PyLith/trunk/modulesrc/meshio/DataWriter.i
short/3D/PyLith/trunk/modulesrc/meshio/DataWriterVTK.i
short/3D/PyLith/trunk/modulesrc/meshio/OutputManager.i
short/3D/PyLith/trunk/modulesrc/meshio/OutputSolnSubset.i
short/3D/PyLith/trunk/pylith/meshio/OutputManager.py
short/3D/PyLith/trunk/pylith/meshio/OutputManagerMesh.py
short/3D/PyLith/trunk/pylith/meshio/OutputManagerSubMesh.py
short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py
short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc
short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputManager.cc
Log:
Fixed output for domain vertex field over submesh.
Modified: short/3D/PyLith/trunk/libsrc/meshio/DataWriter.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/DataWriter.hh 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/libsrc/meshio/DataWriter.hh 2009-05-07 18:42:42 UTC (rev 14917)
@@ -86,10 +86,12 @@
*
* @param t Time associated with field.
* @param field Field over vertices.
- */
+ * @param mesh Mesh associated with output.
+ */
virtual
void writeVertexField(const double t,
- const field_type& field) = 0;
+ const field_type& field,
+ const mesh_type& mesh) = 0;
/** Write field over cells to file.
*
Modified: short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.cc 2009-05-07 18:42:42 UTC (rev 14917)
@@ -150,17 +150,18 @@
template<typename mesh_type, typename field_type>
void
pylith::meshio::DataWriterVTK<mesh_type,field_type>::writeVertexField(
- const double t,
- const field_type& field)
+ const double t,
+ const field_type& field,
+ const mesh_type& mesh)
{ // writeVertexField
- typedef typename field_type::Mesh::SieveMesh SieveMesh;
+ typedef typename mesh_type::SieveMesh SieveMesh;
typedef typename field_type::Mesh::RealSection RealSection;
try {
int rank = 0;
MPI_Comm_rank(field.mesh().comm(), &rank);
- const ALE::Obj<SieveMesh>& sieveMesh = field.mesh().sieveMesh();
+ const ALE::Obj<SieveMesh>& sieveMesh = mesh.sieveMesh();
assert(!sieveMesh.isNull());
const std::string labelName =
(sieveMesh->hasLabel("censored depth")) ? "censored depth" : "depth";
Modified: short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.hh 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/libsrc/meshio/DataWriterVTK.hh 2009-05-07 18:42:42 UTC (rev 14917)
@@ -87,9 +87,11 @@
*
* @param t Time associated with field.
* @param field Field over vertices.
+ * @param mesh Mesh associated with output.
*/
void writeVertexField(const double t,
- const field_type& field);
+ const field_type& field,
+ const mesh_type& mesh);
/** Write field over cells to file.
*
Modified: short/3D/PyLith/trunk/libsrc/meshio/OutputManager.cc
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/OutputManager.cc 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/libsrc/meshio/OutputManager.cc 2009-05-07 18:42:42 UTC (rev 14917)
@@ -135,12 +135,13 @@
void
pylith::meshio::OutputManager<mesh_type, field_type>::appendVertexField(
const double t,
- const field_type& field)
+ const field_type& field,
+ const mesh_type& mesh)
{ // appendVertexField
const field_type& fieldFiltered =
(0 == _vertexFilter) ? field : _vertexFilter->filter(field);
- _writer->writeVertexField(t, fieldFiltered);
+ _writer->writeVertexField(t, fieldFiltered, mesh);
} // appendVertexField
// ----------------------------------------------------------------------
Modified: short/3D/PyLith/trunk/libsrc/meshio/OutputManager.hh
===================================================================
--- short/3D/PyLith/trunk/libsrc/meshio/OutputManager.hh 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/libsrc/meshio/OutputManager.hh 2009-05-07 18:42:42 UTC (rev 14917)
@@ -102,9 +102,11 @@
*
* @param t Time associated with field.
* @param field Vertex field.
+ * @param mesh Mesh for output.
*/
void appendVertexField(const double t,
- const field_type& field);
+ const field_type& field,
+ const mesh_type& mesh);
/** Append finite-element cell field to file.
*
Modified: short/3D/PyLith/trunk/modulesrc/meshio/DataWriter.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/DataWriter.i 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/modulesrc/meshio/DataWriter.i 2009-05-07 18:42:42 UTC (rev 14917)
@@ -80,10 +80,12 @@
*
* @param t Time associated with field.
* @param field Field over vertices.
+ * @param mesh Mesh for output.
*/
virtual
void writeVertexField(const double t,
- const field_type& field) = 0;
+ const field_type& field,
+ const mesh_type& mesh) = 0;
/** Write field over cells to file.
*
Modified: short/3D/PyLith/trunk/modulesrc/meshio/DataWriterVTK.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/DataWriterVTK.i 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/modulesrc/meshio/DataWriterVTK.i 2009-05-07 18:42:42 UTC (rev 14917)
@@ -80,9 +80,11 @@
*
* @param t Time associated with field.
* @param field Field over vertices.
+ * @param mesh Mesh for output.
*/
void writeVertexField(const double t,
- const field_type& field);
+ const field_type& field,
+ const mesh_type& mesh);
/** Write field over cells to file.
*
Modified: short/3D/PyLith/trunk/modulesrc/meshio/OutputManager.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/OutputManager.i 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/modulesrc/meshio/OutputManager.i 2009-05-07 18:42:42 UTC (rev 14917)
@@ -94,9 +94,11 @@
*
* @param t Time associated with field.
* @param field Vertex field.
+ * @param mesh Mesh for output.
*/
void appendVertexField(const double t,
- const field_type& field);
+ const field_type& field,
+ const mesh_type& mesh);
/** Append finite-element cell field to file.
*
Modified: short/3D/PyLith/trunk/modulesrc/meshio/OutputSolnSubset.i
===================================================================
--- short/3D/PyLith/trunk/modulesrc/meshio/OutputSolnSubset.i 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/modulesrc/meshio/OutputSolnSubset.i 2009-05-07 18:42:42 UTC (rev 14917)
@@ -55,9 +55,11 @@
*
* @param t Time associated with field.
* @param field Vertex field.
+ * @param mesh Mesh for output.
*/
void appendVertexField(const double t,
- const pylith::topology::Field<pylith::topology::Mesh>& field);
+ const pylith::topology::Field<pylith::topology::Mesh>& field,
+ const pylith::topology::SubMesh& mesh);
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputManager.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputManager.py 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputManager.py 2009-05-07 18:42:42 UTC (rev 14917)
@@ -194,7 +194,7 @@
for name in self.vertexInfoFields:
field = self.dataProvider.getVertexField(name)
- self._appendVertexField(t, field)
+ self._appendVertexField(t, field, mesh)
for name in self.cellInfoFields:
field = self.dataProvider.getCellField(name)
@@ -223,7 +223,7 @@
for name in self.vertexDataFields:
field = self.dataProvider.getVertexField(name, fields)
- self._appendVertexField(t, field)
+ self._appendVertexField(t, field, mesh)
for name in self.cellDataFields:
field = self.dataProvider.getCellField(name, fields)
@@ -355,15 +355,15 @@
raise NotImplementedError("Implement _open() in derived class.")
- def _openTimeStep(self):
+ def _openTimeStep(self, t, mesh, label, labelId):
raise NotImplementedError("Implement _openTimeStep() in derived class.")
- def _appendVertexField(self):
+ def _appendVertexField(self, t, field, mesh):
raise NotImplementedError("Implement _appendVertexField() in derived class.")
- def _appendCellField(self):
+ def _appendCellField(self, t, field, label, labelId):
raise NotImplementedError("Implement _appendCellField() in derived class.")
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputManagerMesh.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputManagerMesh.py 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputManagerMesh.py 2009-05-07 18:42:42 UTC (rev 14917)
@@ -101,11 +101,11 @@
return
- def _appendVertexField(self, t, field):
+ def _appendVertexField(self, t, field, mesh):
"""
Call C++ appendVertexField();
"""
- ModuleOutputManager.appendVertexField(self, t, field)
+ ModuleOutputManager.appendVertexField(self, t, field, mesh)
return
def _appendCellField(self, t, field, label, labelId):
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputManagerSubMesh.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputManagerSubMesh.py 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputManagerSubMesh.py 2009-05-07 18:42:42 UTC (rev 14917)
@@ -100,11 +100,11 @@
return
- def _appendVertexField(self, t, field):
+ def _appendVertexField(self, t, field, mesh):
"""
Call C++ appendVertexField();
"""
- ModuleOutputManager.appendVertexField(self, t, field)
+ ModuleOutputManager.appendVertexField(self, t, field, mesh)
return
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputSolnSubset.py 2009-05-07 18:42:42 UTC (rev 14917)
@@ -171,11 +171,11 @@
return
- def _appendVertexField(self, t, field):
+ def _appendVertexField(self, t, field, mesh):
"""
Call C++ appendVertexField();
"""
- ModuleOutputSolnSubset.appendVertexField(self, t, field)
+ ModuleOutputSolnSubset.appendVertexField(self, t, field, mesh)
return
def _appendCellField(self, t, field):
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKBCMesh.cc 2009-05-07 18:42:42 UTC (rev 14917)
@@ -133,7 +133,7 @@
} // else
for (int i=0; i < nfields; ++i) {
const SubMeshField& field = vertexFields.get(_data->vertexFieldsInfo[i].name);
- writer.writeVertexField(t, field);
+ writer.writeVertexField(t, field, *_submesh);
CPPUNIT_ASSERT(writer._wroteVertexHeader);
CPPUNIT_ASSERT(false == writer._wroteCellHeader);
} // for
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKFaultMesh.cc 2009-05-07 18:42:42 UTC (rev 14917)
@@ -136,7 +136,7 @@
} // else
for (int i=0; i < nfields; ++i) {
const MeshField& field = vertexFields.get(_data->vertexFieldsInfo[i].name);
- writer.writeVertexField(t, field);
+ writer.writeVertexField(t, field, *_faultMesh);
CPPUNIT_ASSERT(writer._wroteVertexHeader);
CPPUNIT_ASSERT(false == writer._wroteCellHeader);
} // for
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKMesh.cc 2009-05-07 18:42:42 UTC (rev 14917)
@@ -167,7 +167,7 @@
} // else
for (int i=0; i < nfields; ++i) {
const MeshField& field = vertexFields.get(_data->vertexFieldsInfo[i].name);
- writer.writeVertexField(t, field);
+ writer.writeVertexField(t, field, *_mesh);
CPPUNIT_ASSERT(writer._wroteVertexHeader);
CPPUNIT_ASSERT(false == writer._wroteCellHeader);
} // for
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestDataWriterVTKSubMesh.cc 2009-05-07 18:42:42 UTC (rev 14917)
@@ -134,7 +134,7 @@
} // else
for (int i=0; i < nfields; ++i) {
const MeshField& field = vertexFields.get(_data->vertexFieldsInfo[i].name);
- writer.writeVertexField(t, field);
+ writer.writeVertexField(t, field, *_submesh);
CPPUNIT_ASSERT(writer._wroteVertexHeader);
CPPUNIT_ASSERT(false == writer._wroteCellHeader);
} // for
Modified: short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputManager.cc
===================================================================
--- short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputManager.cc 2009-05-07 16:45:27 UTC (rev 14916)
+++ short/3D/PyLith/trunk/unittests/libtests/meshio/TestOutputManager.cc 2009-05-07 18:42:42 UTC (rev 14917)
@@ -225,7 +225,7 @@
manager.writer(&writer);
manager.open(mesh, numTimeSteps);
manager.openTimeStep(t, mesh);
- manager.appendVertexField(t, field);
+ manager.appendVertexField(t, field, mesh);
manager.closeTimeStep();
manager.close();
@@ -238,7 +238,7 @@
manager.open(mesh, numTimeSteps);
manager.openTimeStep(t, mesh);
- manager.appendVertexField(t, field);
+ manager.appendVertexField(t, field, mesh);
manager.closeTimeStep();
manager.close();
More information about the CIG-COMMITS
mailing list