[cig-commits] r19672 - in short/3D/PyLith/branches/v1.6-stable: libsrc/pylith/meshio unittests/libtests/meshio/data

brad at geodynamics.org brad at geodynamics.org
Fri Feb 24 12:48:35 PST 2012


Author: brad
Date: 2012-02-24 12:48:35 -0800 (Fri, 24 Feb 2012)
New Revision: 19672

Modified:
   short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/Xdmf.cc
   short/3D/PyLith/branches/v1.6-stable/unittests/libtests/meshio/data/tri3_vertex.xmf
Log:
Switch to writing components of fields with 'other' type (not scalars, vectors, or tensors) in Xdmf files so they can be visualized in ParaView.

Modified: short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/Xdmf.cc
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/Xdmf.cc	2012-02-24 17:22:14 UTC (rev 19671)
+++ short/3D/PyLith/branches/v1.6-stable/libsrc/pylith/meshio/Xdmf.cc	2012-02-24 20:48:35 UTC (rev 19672)
@@ -159,7 +159,8 @@
       for (int iField=0; iField < numFields; ++iField) {
 	if (2 == spaceDim && 
 	    (std::string("Vector") == fieldsMetadata[iField].vectorFieldType ||
-	     std::string("Tensor6") == fieldsMetadata[iField].vectorFieldType) ) {
+	     std::string("Tensor6") == fieldsMetadata[iField].vectorFieldType  ||
+	     std::string("Matrix") == fieldsMetadata[iField].vectorFieldType) ) {
 	  const int fiberDim = fieldsMetadata[iField].fiberDim;
 	  for (int component=0; component < fiberDim; ++component)
 	    _writeGridAttributeComponent(fieldsMetadata[iField],
@@ -181,7 +182,8 @@
     for (int iField=0; iField < numFields; ++iField) {
       if (2 == spaceDim && 
 	    (std::string("Vector") == fieldsMetadata[iField].vectorFieldType ||
-	     std::string("Tensor6") == fieldsMetadata[iField].vectorFieldType) ) {
+	     std::string("Tensor6") == fieldsMetadata[iField].vectorFieldType  ||
+	     std::string("Matrix") == fieldsMetadata[iField].vectorFieldType) ) {
 	const int fiberDim = fieldsMetadata[iField].fiberDim;
 	for (int component=0; component < fiberDim; ++component)
 	  _writeGridAttributeComponent(fieldsMetadata[iField],
@@ -552,6 +554,10 @@
 	throw std::logic_error(msg.str());
       } // default
     } // switch
+  } else if (std::string("Matrix") == metadata.vectorFieldType) {
+    std::ostringstream sname;
+    sname << metadata.name << "_" << component;
+    componentName = sname.str();
   } else {
     std::ostringstream msg;
     msg << "Unknown vector field type " << metadata.vectorFieldType

Modified: short/3D/PyLith/branches/v1.6-stable/unittests/libtests/meshio/data/tri3_vertex.xmf
===================================================================
--- short/3D/PyLith/branches/v1.6-stable/unittests/libtests/meshio/data/tri3_vertex.xmf	2012-02-24 17:22:14 UTC (rev 19671)
+++ short/3D/PyLith/branches/v1.6-stable/unittests/libtests/meshio/data/tri3_vertex.xmf	2012-02-24 20:48:35 UTC (rev 19672)
@@ -76,18 +76,18 @@
 	  </DataItem>
 	</Attribute>
 	<Attribute
-	   Name="other"
-	   Type="Matrix"
+	   Name="other_0"
+	   Type="Scalar"
 	   Center="Node">
           <DataItem ItemType="HyperSlab"
-		    Dimensions="1 6 2"
+		    Dimensions="1 6 1"
 		    Type="HyperSlab">
             <DataItem
 	       Dimensions="3 3"
 	       Format="XML">
               0 0 0
               1 1 1
-              1 6 2
+              1 6 1
 	    </DataItem>
 	    <DataItem
 	       DataType="Float" Precision="8"
@@ -98,6 +98,28 @@
 	  </DataItem>
 	</Attribute>
 	<Attribute
+	   Name="other_1"
+	   Type="Scalar"
+	   Center="Node">
+          <DataItem ItemType="HyperSlab"
+		    Dimensions="1 6 1"
+		    Type="HyperSlab">
+            <DataItem
+	       Dimensions="3 3"
+	       Format="XML">
+              0 0 1
+              1 1 1
+              1 6 1
+	    </DataItem>
+	    <DataItem
+	       DataType="Float" Precision="8"
+	       Dimensions="1 6 2"
+	       Format="HDF">
+	      &HeavyData;:/vertex_fields/other
+	    </DataItem>
+	  </DataItem>
+	</Attribute>
+	<Attribute
 	   Name="pressure"
 	   Type="Scalar"
 	   Center="Node">



More information about the CIG-COMMITS mailing list