[cig-commits] r13742 - cs/cigma/trunk/src

luis at geodynamics.org luis at geodynamics.org
Wed Dec 17 02:32:50 PST 2008


Author: luis
Date: 2008-12-17 02:32:49 -0800 (Wed, 17 Dec 2008)
New Revision: 13742

Modified:
   cs/cigma/trunk/src/io_vtk_writer.cpp
   cs/cigma/trunk/src/io_vtk_writer.h
Log:
Simplify VtkWriter::_writeCellTypes

Modified: cs/cigma/trunk/src/io_vtk_writer.cpp
===================================================================
--- cs/cigma/trunk/src/io_vtk_writer.cpp	2008-12-17 10:32:47 UTC (rev 13741)
+++ cs/cigma/trunk/src/io_vtk_writer.cpp	2008-12-17 10:32:49 UTC (rev 13742)
@@ -91,6 +91,19 @@
     }
 }
 
+void VtkWriter::_writeCellTypes(int nel, int cellType)
+{
+    assert(fp != NULL);
+    
+    fprintf(fp, "CELL_TYPES %d\n", nel);
+
+    for (int i = 0; i < nel; i++)
+    {
+        fprintf(fp, "%d\n", cellType);
+    }
+}
+
+/*
 void VtkWriter::_writeCellTypes(int nsd, int nel, int ndofs)
 {
     assert(fp != NULL);
@@ -127,6 +140,7 @@
         fprintf(fp, "%d\n", vtkType);
     }
 }
+*/
 
 void VtkWriter::_writePointData(const char *name, const double *data, int nno, int nsd)
 {

Modified: cs/cigma/trunk/src/io_vtk_writer.h
===================================================================
--- cs/cigma/trunk/src/io_vtk_writer.h	2008-12-17 10:32:47 UTC (rev 13741)
+++ cs/cigma/trunk/src/io_vtk_writer.h	2008-12-17 10:32:49 UTC (rev 13742)
@@ -26,12 +26,13 @@
     int writeCoordinates(const char *loc, const double *coordinates, int nno, int nsd);
     int writeConnectivity(const char *loc, const int *connectivity, int nel, int ndofs);
 
-private:
+public:
     /* XXX: turn these methods into functions and move to io_vtk.h */
     void _writeHeader();
     void _writePoints(const double *points, int npts, int ndim);
     void _writeCells(const int *cells, int nel, int ndofs);
-    void _writeCellTypes(int nsd, int nel, int ndofs);
+    void _writeCellTypes(int nel, int cellType);
+    //void _writeCellTypes(int nsd, int nel, int ndofs);
     void _writePointData(const char *name, const double *data, int nno, int nsd);
     void _writeCellData(const char *name, const double *data, int nel, int ndofs);
 



More information about the CIG-COMMITS mailing list