FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

gmvOutputHeader.H

Go to the documentation of this file.
00001 const pointField& points = mesh.points();
00002 label nPoints = points.size();
00003 const cellShapeList& cells = mesh.cellShapes();
00004 
00005 gmvFile << "gmvinput " << format << nl;
00006 gmvFile << "nodes   " << nPoints << nl;
00007 for(label indx=0;indx<nPoints;indx++)
00008 {
00009     gmvFile << points[indx].x() << " ";
00010 }
00011 gmvFile << nl;
00012 for(label indx=0;indx<nPoints;indx++)
00013 {
00014     gmvFile << points[indx].y() << " ";
00015 }
00016 gmvFile << nl;
00017 for(label indx=0;indx<nPoints;indx++)
00018 {
00019     gmvFile << points[indx].z() << " ";
00020 }
00021 gmvFile << nl;
00022 gmvFile << "cells   " << cells.size() << nl;
00023 for(label indx=0;indx<cells.size();indx++)
00024 {
00025     label nNodes = cells[indx].size();
00026     if (nNodes == 8)
00027     {
00028         gmvFile << "hex     " << 8 << " ";
00029         for(label ip=0; ip<nNodes; ip++)
00030         {
00031             gmvFile << cells[indx][ip] + 1 << " ";        
00032         }
00033         gmvFile << nl;
00034     }
00035     else if (nNodes == 4)
00036     {
00037         gmvFile << "tet     " << 4 << " ";
00038         for(label ip=0; ip<nNodes; ip++)
00039         {
00040             gmvFile << cells[indx][ip] + 1 << " ";        
00041         }
00042         gmvFile << nl;
00043     }
00044     else if (nNodes == 6)
00045     {
00046         gmvFile << "prism   " << 6 << " ";
00047         for(label ip=0; ip<nNodes; ip++)
00048         {
00049             gmvFile << cells[indx][ip] + 1 << " ";        
00050         }
00051         gmvFile << nl;
00052     }
00053 }
00054 
00055 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines