Select Git revision
TreeUtils.h
-
Christophe Geuzaine authoredChristophe Geuzaine authored
Read_Mesh.cpp 23.35 KiB
// $Id: Read_Mesh.cpp,v 1.76 2004-05-31 01:54:19 geuzaine Exp $
//
// Copyright (C) 1997-2004 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 "Geo.h"
#include "CAD.h"
#include "Mesh.h"
#include "3D_Mesh.h"
#include "Create.h"
#include "MinMax.h"
#include "Context.h"
extern Context_T CTX;
// Read mesh in native MSH format
#define LGN1 1
#define TRI1 2
#define QUA1 3
#define TET1 4
#define HEX1 5
#define PRI1 6
#define PYR1 7
#define LGN2 8
#define TRI2 9
#define QUA2 10
#define TET2 11
#define HEX2 12
#define PRI2 13
#define PYR2 14
#define PNT 15
#define NB_NOD_MAX_ELM 30
void addPhysicalGroup(Mesh * M, int Type, int Physical, int Elementary)
{
PhysicalGroup *pg;
if((pg = FindPhysicalGroup(Physical, Type, M))) {
List_Insert(pg->Entities, &Elementary, fcmp_int);
}
else {
List_T *tmp = List_Create(1, 1, sizeof(int));
List_Add(tmp, &Elementary);
pg = Create_PhysicalGroup(Physical, Type, tmp);
List_Add(M->PhysicalGroups, &pg);
List_Delete(tmp);
}
}
/* Note: the "Dirty" flag only has an influence if one doesn't load
the geometry along with the mesh (since we only add "dirty"
geometrical entities if they don't already exist). */