Netgen mesh library : nglib
摘要Abstract:本文主是对Netgen的库nglib的用法进行介绍。主要参考资料是Netgen用户指南。最后给出一个具体程序实例。
关键字Key Words:Netgen, nglib, Mesh
一、引言 Introduction
Netgen网格生成库nglib是以C++源程序形式提供,可以编译为Unix/Linux或Windows上的库文件。程序开发使用的接口文件是nglib.h。
二、头文件 The Header File
接口文件中包含了一些类型定义和函数调用,所有的Netgen类型和函数都带有前缀Ng。类型和函数首字母大写,所有常量都是大写。
三、类型和常量 Types and Constants
// ** Constants used within Netgen ********************* /// Maximum allowed number of nodes per volume element #define NG_VOLUME_ELEMENT_MAXPOINTS 10 /// Maximum allowed number of nodes per surface element #define NG_SURFACE_ELEMENT_MAXPOINTS 8 // *** Data-types for accessing Netgen functionality *** /// Data type for NETGEN mesh typedef void * Ng_Mesh; /// Data type for NETGEN CSG geometry typedef void * Ng_CSG_Geometry; /// Data type for NETGEN 2D geometry typedef void * Ng_Geometry_2D; /// Data type for NETGEN STL geometry typedef void * Ng_STL_Geometry; // *** Special Enum types used within Netgen *********** /// Currently implemented surface element types enum Ng_Surface_Element_Type { NG_TRIG = 1, NG_QUAD = 2, NG_TRIG6 = 3, NG_QUAD6 = 4, NG_QUAD8 = 5 }; /// Currently implemented volume element types enum Ng_Volume_Element_Type { NG_TET = 1, NG_PYRAMID = 2, NG_PRISM = 3, NG_TET10 = 4 }; /// Values returned by Netgen functions enum Ng_Result { NG_ERROR = -1, NG_OK = 0, NG_SURFACE_INPUT_ERROR = 1, NG_VOLUME_FAILURE = 2, NG_STL_INPUT_ERROR = 3, NG_SURFACE_FAILURE = 4, NG_FILE_NOT_FOUND = 5 }; // *** Classes required for use within Netgen ********** /// Netgen Meshing Parameters class class Ng_Meshing_Parameters { public: int uselocalh; //!< Switch to enable / disable usage of local me