///////////////////////////////////////////////////////////////////////////////
// //
// TetGen //
// //
// A Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator //
// //
// Version 1.4 //
// September 6, December 13, 2009 //
// //
// Copyright (C) 2002--2009 //
// Hang Si //
// Research Group: Numerical Mathematics and Scientific Computing //
// Weierstrass Institute for Applied Analysis and Stochastics (WIAS) //
// Mohrenstr. 39, 10117 Berlin, Germany //
// si@wias-berlin.de //
// //
// TetGen is freely available through the website: http://tetgen.berlios.de. //
// It may be copied, modified, and redistributed for non-commercial use. //
// Please consult the file LICENSE for the detailed copyright notices. //
// //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// //
// TetGen is a library to generate tetrahedral meshes for 3D domains. It's //
// main purpose is to generate suitable tetrahedral meshes for numerical //
// simulations using finite element and finite volume methods. //
// //
// TetGen incorporates a suit of geometrical and mesh generation algorithms. //
// A brief description of algorithms used in TetGen is found in the first //
// section of the user's manual. References are given for users who are //
// interesting in these approaches. The main references are given below: //
// //
// The efficient Delaunay tetrahedralization algorithm is: H. Edelsbrunner //
// and N. R. Shah, "Incremental Topological Flipping Works for Regular //
// Triangulations". Algorithmica 15: 223--241, 1996. //
// //
// The constrained Delaunay tetrahedralization algorithm is described in: //
// H. Si and K. Gaertner, "Meshing Piecewise Linear Complexes by Constr- //
// ained Delaunay Tetrahedralizations". In Proceeding of the 14th Inter- //
// national Meshing Roundtable. September 2005. //
// //
// The mesh refinement algorithm is from: Hang Si, "Adaptive Tetrahedral //
// Mesh Generation by Constrained Delaunay Refinement". International //
// Journal for Numerical Methods in Engineering, 75(7): 856--880, 2008. //
// //
// The mesh data structure of TetGen is a combination of two types of mesh //
// data structures. The tetrahedron-based mesh data structure introduced //
// by Shewchuk is eligible for tetrahedralization algorithms. The triangle //
// -edge data structure developed by Muecke is adopted for representing //
// boundary elements: subfaces and subsegments. //
// //
// J. R. Shewchuk, "Delaunay Refinement Mesh Generation". PhD thesis, //
// Carnegie Mellon University, Pittsburgh, PA, 1997. //
// //
// E. P. Muecke, "Shapes and Implementations in Three-Dimensional //
// Geometry". PhD thesis, Univ. of Illinois, Urbana, Illinois, 1993. //
// //
// The research of mesh generation is definitly on the move. Many State-of- //
// the-art algorithms need implementing and evaluating. I heartily welcome //
// any new algorithm especially for generating quality conforming Delaunay //
// meshes and anisotropic conforming Delaunay meshes. //
// //
// TetGen is supported by the "pdelib" project of Weierstrass Institute for //
// Applied Analysis and Stochastics (WIAS) in Berlin. It is a collection //
// of software components for solving non-linear partial differential //
// equations including 2D and 3D mesh generators, sparse matrix solvers, //
// and scientific visualization tools, etc. For more information please //
// visit: http://www.wias-berlin.de/software/pdelib. //
// //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// //
// tetgen.h //
// //
// Header file of the TetGen library. Also is the user-level header file. //
// //
///////////////////////////////////////////////////////////////////////////////
#ifndef tetgenH
#define tetgenH
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <assert.h>
// The types 'intptr_t' and 'uintptr_t' are signed and unsigned integer types,
// respectively. They are guaranteed to be the same width as a pointer.
// They are defined in <stdint.h> by the C99 Standard.
// However, Microsoft Visual C++ doesn't ship with this header file yet. We
// need to define them. (Thanks to Steven G. Johnson from MIT for the
// following piece of code.)
// Define the _MSC_VER symbol if you are using Microsoft Visual C++.
// #define _MSC_VER
// Define the _WIN64 symbol if you are running TetGen on Win64.
// #define _WIN64
#ifdef _MSC_VER // Microsoft Visual C++
# ifdef _WIN64
typedef __int64 intptr_t;
typedef unsigned __int64 uintptr_t;
# else // not _WIN64
typedef int intptr_t;
typedef unsigned int uintptr_t;
# endif
#else // not Visual C++
# include <stdint.h>
#endif
// To compile TetGen as a library instead of an executable program, define
// the TETLIBRARY symbol.
// #define TETLIBRARY
// Uncomment the following line to disable assert macros. These macros are
// inserted in places where I hope to catch bugs.
// #define NDEBUG
// To insert lots of self-checks for internal errors, define the SELF_CHECK
// symbol. This will slow down the program a bit.
// #define SELF_CHECK
// For single precision ( which will save some memory and reduce paging ),
// define the symbol SINGLE by using the -DSINGLE compiler switch or by
// writing "#define SINGLE" below.
//
// For double precision ( which will allow you to refine meshes to a smaller
// edge length), leave SINGLE undefined.
// #define SINGLE
#ifdef SINGLE
#define REAL float
#else
#define REAL double
#endif // not defined
- 1
- 2
- 3
前往页