Select Git revision
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Christophe Geuzaine authoredChristophe Geuzaine authored
Print_Mesh.cpp 52.07 KiB
// $Id: Print_Mesh.cpp,v 1.75 2006-05-14 00:48:20 geuzaine Exp $
//
// Copyright (C) 1997-2006 C. Geuzaine, J.-F. Remacle
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA.
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include "Gmsh.h"
#include "Numeric.h"
#include "Geo.h"
#include "CAD.h"
#include "Mesh.h"
#include "Create.h"
#include "Context.h"
#include <list>
#include <map>
extern Context_T CTX;
extern Mesh *THEM;
// Write mesh in native MSH format
#define LINE 1
#define TRIANGLE 2
#define QUADRANGLE 3
#define TETRAHEDRON 4
#define HEXAHEDRON 5
#define PRISM 6
#define PYRAMID 7
#define LINE_2 8
#define TRIANGLE_2 9
#define QUADRANGLE_2 10
#define TETRAHEDRON_2 11
#define HEXAHEDRON_2 12
#define PRISM_2 13
#define PYRAMID_2 14
#define POINT 15
static int MSH_VOL_NUM, MSH_SUR_NUM, MSH_LIN_NUM;
static int MSH_NODE_NUM, MSH_ELEMENT_NUM, MSH_ADD;
static int MSH_PHYSICAL_NUM, MSH_PHYSICAL_ORI;
static FILE *MSHFILE;
static void _msh_print_node(void *a, void *b)
{
Vertex *V = *(Vertex **) a;
MSH_NODE_NUM++;
if(CTX.mesh.renumber_nodes_continuous)
V->Num = MSH_NODE_NUM;
fprintf(MSHFILE, "%d %.16g %.16g %.16g\n",
V->Num,
V->Pos.X * CTX.mesh.scaling_factor,
V->Pos.Y * CTX.mesh.scaling_factor,
V->Pos.Z * CTX.mesh.scaling_factor);