/************************************* * Write Gmsh file * First issue the 04/26/2004 by Paul CARRICO (paul.carrico@free.fr) * At the moment, the GMSH format is available for * linear tetrahedron elements i.e. in 3D * (based on Neutral Format) * * Second issue the 05/05/2004 by Paul CARRICO * Thanks to Joachim Schoeberl for the correction of a minor bug * the 2 initial Gmsh Format (i.e. volume format and surface format) are group together) * in only one file **************************************/ #include #include #include #include #include namespace netgen { #include "writeuser.hpp" extern MeshingParameters mparam; /* * VTK mesh format * points, elements, surface elements */ void WriteVtkFormat (const Mesh & mesh, const string & filename) { ofstream outfile (filename.c_str()); outfile.precision(6); outfile.setf (ios::fixed, ios::floatfield); outfile.setf (ios::showpoint); int np = mesh.GetNP(); /// number of point int ne = mesh.GetNE(); /// number of element int nse = mesh.GetNSE(); /// number of surface element (BC) outfile << "# vtk DataFile Version 2.0\n"; outfile << "Created with netgen\n"; outfile << "ASCII\n"; outfile << "DATASET UNSTRUCTURED_GRID\n"; outfile << "POINTS " << np << " double\n"; for (int i=0; i types; if (ne > 0) { unsigned int size = 0; for (int i=0; i