mFES - molecular Finite Element Solver
0.4
|
Library interface to the netgen meshing kernel. More...
Go to the source code of this file.
Classes | |
class | Ng_Meshing_Parameters |
Netgen Meshing Parameters class. More... | |
Defines | |
#define | DLL_HEADER |
#define | NG_VOLUME_ELEMENT_MAXPOINTS 10 |
#define | NG_SURFACE_ELEMENT_MAXPOINTS 8 |
#define | DLL_HEADER |
#define | NG_VOLUME_ELEMENT_MAXPOINTS 10 |
Maximum allowed number of nodes per volume element. | |
#define | NG_SURFACE_ELEMENT_MAXPOINTS 8 |
Maximum allowed number of nodes per surface element. | |
Typedefs | |
typedef void * | Ng_Mesh |
Data type for NETGEN mesh. | |
typedef void * | Ng_CSG_Geometry |
Data type for NETGEN CSG geometry. | |
typedef void * | Ng_Geometry_2D |
Data type for NETGEN 2D geometry. | |
typedef void * | Ng_STL_Geometry |
Data type for NETGEN STL geometry. | |
Enumerations | |
enum | Ng_Surface_Element_Type { NG_TRIG = 1, NG_QUAD = 2, NG_TRIG6 = 3, NG_QUAD6 = 4, NG_QUAD8 = 5 } |
Currently implemented surface element types. More... | |
enum | Ng_Volume_Element_Type { NG_TET = 1, NG_PYRAMID = 2, NG_PRISM = 3, NG_TET10 = 4 } |
Currently implemented volume element types. More... | |
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 } |
Values returned by Netgen functions. More... | |
Functions | |
DLL_HEADER void | Ng_Init () |
Initialise the Netgen library and prepare for use. | |
DLL_HEADER void | Ng_Exit () |
Exit the Netgen meshing kernel in a clean manner. | |
DLL_HEADER Ng_Mesh * | Ng_NewMesh () |
Create a new (and empty) Netgen Mesh Structure. | |
DLL_HEADER void | Ng_DeleteMesh (Ng_Mesh *mesh) |
Delete an existing Netgen Mesh Structure. | |
DLL_HEADER void | Ng_SaveMesh (Ng_Mesh *mesh, const char *filename) |
Save a Netgen Mesh to disk. | |
DLL_HEADER Ng_Mesh * | Ng_LoadMesh (const char *filename) |
Load a Netgen VOL Mesh from disk into memory. | |
DLL_HEADER Ng_Mesh * | Ng_SetProperties (Ng_Mesh *m, int surfnr, int bcnr, int domin, int domout) |
Set element options. | |
DLL_HEADER Ng_Result | Ng_MergeMesh (Ng_Mesh *mesh, const char *filename) |
Merge a Netgen VOL Mesh from disk into an existing mesh in memory. | |
DLL_HEADER Ng_Result | Ng_MergeMesh (Ng_Mesh *mesh1, Ng_Mesh *mesh2) |
Merge one Netgen Mesh into another Netgen Mesh in the case when both are already in memory. | |
DLL_HEADER void | Ng_AddPoint (Ng_Mesh *mesh, double *x) |
Add a point to a given Netgen Mesh Structure. | |
DLL_HEADER void | Ng_AddSurfaceElement (Ng_Mesh *mesh, Ng_Surface_Element_Type et, int *pi) |
Add a surface element to a given Netgen Mesh Structure. | |
DLL_HEADER void | Ng_AddVolumeElement (Ng_Mesh *mesh, Ng_Volume_Element_Type et, int *pi) |
Add a volume element to a given Netgen Mesh Structure. | |
DLL_HEADER void | Ng_RestrictMeshSizeGlobal (Ng_Mesh *mesh, double h) |
Apply a global restriction on mesh element size. | |
DLL_HEADER void | Ng_RestrictMeshSizePoint (Ng_Mesh *mesh, double *p, double h) |
Locally restrict the mesh element size at the given point. | |
DLL_HEADER void | Ng_RestrictMeshSizeBox (Ng_Mesh *mesh, double *pmin, double *pmax, double h) |
Locally restrict the mesh element size within a specified box. | |
DLL_HEADER Ng_Result | Ng_GenerateVolumeMesh (Ng_Mesh *mesh, Ng_Meshing_Parameters *mp) |
Create a 3D Volume Mesh given a Surface Mesh. | |
DLL_HEADER int | Ng_GetNP (Ng_Mesh *mesh) |
Returns the Number of Points present in the specified Mesh. | |
DLL_HEADER int | Ng_GetNSE (Ng_Mesh *mesh) |
Returns the Number of Surface Elements present in the specified Mesh. | |
DLL_HEADER int | Ng_GetNE (Ng_Mesh *mesh) |
Returns the Number of Volume Elements present in the specified Mesh. | |
DLL_HEADER void | Ng_GetPoint (Ng_Mesh *mesh, int num, double *x) |
DLL_HEADER Ng_Surface_Element_Type | Ng_GetSurfaceElement (Ng_Mesh *mesh, int num, int *pi) |
DLL_HEADER Ng_Volume_Element_Type | Ng_GetVolumeElement (Ng_Mesh *mesh, int num, int *pi) |
DLL_HEADER void | Ng_AddPoint_2D (Ng_Mesh *mesh, double *x) |
DLL_HEADER void | Ng_AddBoundarySeg_2D (Ng_Mesh *mesh, int pi1, int pi2) |
DLL_HEADER int | Ng_GetNP_2D (Ng_Mesh *mesh) |
DLL_HEADER int | Ng_GetNE_2D (Ng_Mesh *mesh) |
DLL_HEADER int | Ng_GetNSeg_2D (Ng_Mesh *mesh) |
DLL_HEADER void | Ng_GetPoint_2D (Ng_Mesh *mesh, int num, double *x) |
DLL_HEADER Ng_Surface_Element_Type | Ng_GetElement_2D (Ng_Mesh *mesh, int num, int *pi, int *matnum=NULL) |
DLL_HEADER void | Ng_GetSegment_2D (Ng_Mesh *mesh, int num, int *pi, int *matnum=NULL) |
DLL_HEADER Ng_Geometry_2D * | Ng_LoadGeometry_2D (const char *filename) |
DLL_HEADER Ng_Result | Ng_GenerateMesh_2D (Ng_Geometry_2D *geom, Ng_Mesh **mesh, Ng_Meshing_Parameters *mp) |
DLL_HEADER void | Ng_HP_Refinement (Ng_Geometry_2D *geom, Ng_Mesh *mesh, int levels) |
DLL_HEADER Ng_STL_Geometry * | Ng_STL_LoadGeometry (const char *filename, int binary=0) |
DLL_HEADER Ng_STL_Geometry * | Ng_STL_NewGeometry () |
DLL_HEADER void | Ng_STL_AddTriangle (Ng_STL_Geometry *geom, double *p1, double *p2, double *p3, double *nv=NULL) |
DLL_HEADER void | Ng_STL_AddEdge (Ng_STL_Geometry *geom, double *p1, double *p2) |
DLL_HEADER Ng_Result | Ng_STL_InitSTLGeometry (Ng_STL_Geometry *geom) |
DLL_HEADER Ng_Result | Ng_STL_MakeEdges (Ng_STL_Geometry *geom, Ng_Mesh *mesh, Ng_Meshing_Parameters *mp) |
DLL_HEADER Ng_Result | Ng_STL_GenerateSurfaceMesh (Ng_STL_Geometry *geom, Ng_Mesh *mesh, Ng_Meshing_Parameters *mp) |
DLL_HEADER void | Ng_Uniform_Refinement (Ng_Mesh *mesh) |
DLL_HEADER void | Ng_2D_Uniform_Refinement (Ng_Geometry_2D *geom, Ng_Mesh *mesh) |
DLL_HEADER void | Ng_STL_Uniform_Refinement (Ng_STL_Geometry *geom, Ng_Mesh *mesh) |
DLL_HEADER void | Ng_CSG_Uniform_Refinement (Ng_CSG_Geometry *geom, Ng_Mesh *mesh) |
DLL_HEADER void | Ng_Generate_SecondOrder (Ng_Mesh *mesh) |
DLL_HEADER void | Ng_2D_Generate_SecondOrder (Ng_Geometry_2D *geom, Ng_Mesh *mesh) |
DLL_HEADER void | Ng_STL_Generate_SecondOrder (Ng_STL_Geometry *geom, Ng_Mesh *mesh) |
DLL_HEADER void | Ng_CSG_Generate_SecondOrder (Ng_CSG_Geometry *geom, Ng_Mesh *mesh) |
Library interface to the netgen meshing kernel.
This header file provides access to the core functionality of the Netgen Mesher via a library interface, without an interactive User Interface.
The intention of providing these set of functions is to allow system developers to integrate Netgen into top-level code, to act as the low level mesh generation / optimisation kernel.
#define DLL_HEADER |
#define DLL_HEADER |
#define NG_SURFACE_ELEMENT_MAXPOINTS 8 |
Maximum allowed number of nodes per surface element.
#define NG_SURFACE_ELEMENT_MAXPOINTS 8 |
#define NG_VOLUME_ELEMENT_MAXPOINTS 10 |
#define NG_VOLUME_ELEMENT_MAXPOINTS 10 |
Maximum allowed number of nodes per volume element.
typedef void* Ng_CSG_Geometry |
Data type for NETGEN CSG geometry.
typedef void* Ng_Geometry_2D |
Data type for NETGEN 2D geometry.
typedef void* Ng_Mesh |
Data type for NETGEN mesh.
typedef void* Ng_STL_Geometry |
Data type for NETGEN STL geometry.
enum Ng_Result |
DLL_HEADER void Ng_2D_Generate_SecondOrder | ( | Ng_Geometry_2D * | geom, |
Ng_Mesh * | mesh | ||
) |
DLL_HEADER void Ng_2D_Uniform_Refinement | ( | Ng_Geometry_2D * | geom, |
Ng_Mesh * | mesh | ||
) |
DLL_HEADER void Ng_AddBoundarySeg_2D | ( | Ng_Mesh * | mesh, |
int | pi1, | ||
int | pi2 | ||
) |
DLL_HEADER void Ng_AddPoint | ( | Ng_Mesh * | mesh, |
double * | x | ||
) |
Add a point to a given Netgen Mesh Structure.
This function allows points to be directly added to a Netgen mesh structure by providing the co-ordinates.
Each call to the function allows only one point to be added.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
x | Pointer to an array of type double containing the co-ordinates of the point to be added in the form:
|
DLL_HEADER void Ng_AddPoint_2D | ( | Ng_Mesh * | mesh, |
double * | x | ||
) |
DLL_HEADER void Ng_AddSurfaceElement | ( | Ng_Mesh * | mesh, |
Ng_Surface_Element_Type | et, | ||
int * | pi | ||
) |
Add a surface element to a given Netgen Mesh Structure.
This function allows the top-level code to directly add individual Surface Elements to a Netgen Mesh Structure by providing the type of element to be added and the indices of the points which constitute the element.
Note:
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
et | Surface Element type provided via the enumerated type Ng_Surface_Element_Type |
pi | Pointer to an array of integers containing the indices of the points which constitute the surface element being added |
DLL_HEADER void Ng_AddVolumeElement | ( | Ng_Mesh * | mesh, |
Ng_Volume_Element_Type | et, | ||
int * | pi | ||
) |
Add a volume element to a given Netgen Mesh Structure.
This function allows the top-level code to directly add individual Volume Elements to a Netgen Mesh Structure by providing the type of element to be added and the indices of the points which constitute the element.
Note:
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
et | Volume Element type provided via the enumerated type Ng_Volume_Element_Type |
pi | Pointer to an array of integers containing the indices of the points which constitute the volume element being added |
DLL_HEADER void Ng_CSG_Generate_SecondOrder | ( | Ng_CSG_Geometry * | geom, |
Ng_Mesh * | mesh | ||
) |
DLL_HEADER void Ng_CSG_Uniform_Refinement | ( | Ng_CSG_Geometry * | geom, |
Ng_Mesh * | mesh | ||
) |
DLL_HEADER void Ng_DeleteMesh | ( | Ng_Mesh * | mesh | ) |
Delete an existing Netgen Mesh Structure.
Use this function to delete an existing Netgen mesh structure and release the used memory.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
DLL_HEADER void Ng_Exit | ( | ) |
Exit the Netgen meshing kernel in a clean manner.
Use this function to exit the meshing sub-system in a clean and orderly manner.
DLL_HEADER void Ng_Generate_SecondOrder | ( | Ng_Mesh * | mesh | ) |
DLL_HEADER Ng_Result Ng_GenerateMesh_2D | ( | Ng_Geometry_2D * | geom, |
Ng_Mesh ** | mesh, | ||
Ng_Meshing_Parameters * | mp | ||
) |
DLL_HEADER Ng_Result Ng_GenerateVolumeMesh | ( | Ng_Mesh * | mesh, |
Ng_Meshing_Parameters * | mp | ||
) |
Create a 3D Volume Mesh given a Surface Mesh.
After creating a surface mesh, this function can be utilised to automatically generate the corresponding 3D Volume Mesh.
Mesh generation parameters (such as grading, maximum element size, etc.) are specified via the meshing parameters class which also needs to be passed to this function.
Note: Currently, Netgen generates pure tetrahedral volume meshes.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
mp | Pointer to a copy of the Meshing Parameters class (Ng_Meshing_Parameters), filled up with the required values |
DLL_HEADER Ng_Surface_Element_Type Ng_GetElement_2D | ( | Ng_Mesh * | mesh, |
int | num, | ||
int * | pi, | ||
int * | matnum = NULL |
||
) |
DLL_HEADER int Ng_GetNE | ( | Ng_Mesh * | mesh | ) |
Returns the Number of Volume Elements present in the specified Mesh.
Given an already existent Netgen Mesh Structure, this function returns the number of volume elements currently present within the Mesh.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
DLL_HEADER int Ng_GetNE_2D | ( | Ng_Mesh * | mesh | ) |
DLL_HEADER int Ng_GetNP | ( | Ng_Mesh * | mesh | ) |
Returns the Number of Points present in the specified Mesh.
Given an already existent Netgen Mesh Structure, this function returns the number of points currently present within the Mesh.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
DLL_HEADER int Ng_GetNP_2D | ( | Ng_Mesh * | mesh | ) |
DLL_HEADER int Ng_GetNSE | ( | Ng_Mesh * | mesh | ) |
Returns the Number of Surface Elements present in the specified Mesh.
Given an already existent Netgen Mesh Structure, this function returns the number of surface elements currently present within the Mesh.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
DLL_HEADER int Ng_GetNSeg_2D | ( | Ng_Mesh * | mesh | ) |
DLL_HEADER void Ng_GetPoint | ( | Ng_Mesh * | mesh, |
int | num, | ||
double * | x | ||
) |
DLL_HEADER void Ng_GetPoint_2D | ( | Ng_Mesh * | mesh, |
int | num, | ||
double * | x | ||
) |
DLL_HEADER void Ng_GetSegment_2D | ( | Ng_Mesh * | mesh, |
int | num, | ||
int * | pi, | ||
int * | matnum = NULL |
||
) |
DLL_HEADER Ng_Surface_Element_Type Ng_GetSurfaceElement | ( | Ng_Mesh * | mesh, |
int | num, | ||
int * | pi | ||
) |
DLL_HEADER Ng_Volume_Element_Type Ng_GetVolumeElement | ( | Ng_Mesh * | mesh, |
int | num, | ||
int * | pi | ||
) |
DLL_HEADER void Ng_HP_Refinement | ( | Ng_Geometry_2D * | geom, |
Ng_Mesh * | mesh, | ||
int | levels | ||
) |
DLL_HEADER void Ng_Init | ( | ) |
Initialise the Netgen library and prepare for use.
This function needs to be called by the third-party program before beginning to use the other Netgen specific functions.
DLL_HEADER Ng_Geometry_2D* Ng_LoadGeometry_2D | ( | const char * | filename | ) |
DLL_HEADER Ng_Mesh* Ng_LoadMesh | ( | const char * | filename | ) |
Load a Netgen VOL Mesh from disk into memory.
A Netgen mesh saved in the internal VOL format can be loaded into a Netgen Mesh structure using this function.
filename | Pointer to a character array containing the name of the file to load |
DLL_HEADER Ng_Result Ng_MergeMesh | ( | Ng_Mesh * | mesh, |
const char * | filename | ||
) |
Merge a Netgen VOL Mesh from disk into an existing mesh in memory.
A Netgen mesh saved in the internal VOL format can be merged into an existing Netgen Mesh structure using this function.
mesh | Name of the Mesh structure already existent in memory |
filename | Pointer to a character array containing the name of the file to load |
DLL_HEADER Ng_Result Ng_MergeMesh | ( | Ng_Mesh * | mesh1, |
Ng_Mesh * | mesh2 | ||
) |
Merge one Netgen Mesh into another Netgen Mesh in the case when both are already in memory.
(NOTE: First version implemented, Sakalli)
This function can be used to merge two Netgen meshes already present in memory.
mesh1 | Parent Mesh structure into which the second mesh will be merged |
mesh2 | Child mesh structure which will get merged into the parent mesh |
DLL_HEADER Ng_Mesh* Ng_NewMesh | ( | ) |
Create a new (and empty) Netgen Mesh Structure.
This function creates a new Netgen Mesh, initialises it, and returns a pointer to the created mesh structure.
Use the returned pointer for subsequent operations which involve mesh operations.
DLL_HEADER void Ng_RestrictMeshSizeBox | ( | Ng_Mesh * | mesh, |
double * | pmin, | ||
double * | pmax, | ||
double | h | ||
) |
Locally restrict the mesh element size within a specified box.
Similar to the function Ng_RestrictMeshSizePoint, this function allows the size of elements within a mesh to be locally limited.
However, rather than limit the mesh size at a single point, this utility restricts the local mesh size within a 3D Box region, specified via the co-ordinates of the two diagonally opposite points of a cuboid.
Note: This function only limits the Maximum size of the elements within the specified region.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
pmin | Pointer to an Array of type double, containing the three co-ordinates of the first point of the cuboid:
|
pmax | Pointer to an Array of type double, containing the three co-ordinates of the opposite point of the cuboid:
|
h | Variable of type double, specifying the maximum allowable mesh size at that point |
DLL_HEADER void Ng_RestrictMeshSizeGlobal | ( | Ng_Mesh * | mesh, |
double | h | ||
) |
Apply a global restriction on mesh element size.
This utility allows the user to apply a global mesh element size limitation.
During mesh creation, in the absence of an explicit local size restriction around the neighbourhood of a point within the meshing domain, this global size restriction will be utilised.
Note: This function only limits the Maximum size of an element within the mesh.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
h | Variable of type double, specifying the maximum allowable mesh size |
DLL_HEADER void Ng_RestrictMeshSizePoint | ( | Ng_Mesh * | mesh, |
double * | p, | ||
double | h | ||
) |
Locally restrict the mesh element size at the given point.
Unlike the function Ng_RestrictMeshSizeGlobal, this function allows the user to locally restrict the maximum allowable mesh size at a given point.
The point is specified via its three cartesian co-ordinates.
Note: This function only limits the Maximum size of the elements around the specified point.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
p | Pointer to an Array of type double, containing the three co-ordinates of the point in the form:
|
h | Variable of type double, specifying the maximum allowable mesh size at that point |
DLL_HEADER void Ng_SaveMesh | ( | Ng_Mesh * | mesh, |
const char * | filename | ||
) |
Save a Netgen Mesh to disk.
This function allows a generated mesh structure to be saved to disk.
A Mesh saved using this function, will be written to disk in the Netgen VOL file format.
mesh | Pointer to an existing Netgen Mesh structure of type Ng_Mesh |
filename | Pointer to a character array containing the name of the file to which the mesh should be saved |
DLL_HEADER Ng_Mesh* Ng_SetProperties | ( | Ng_Mesh * | m, |
int | surfnr, | ||
int | bcnr, | ||
int | domin, | ||
int | domout | ||
) |
Set element options.
Changes the element options of a Netgen mesh in VOL format . (Sakalli)
mesh | Name of the Mesh structure already existent in memory |
surfnr | Set surface number |
bcnr | Set boundary number |
domin | Set domain in |
domout | Set domain out |
DLL_HEADER void Ng_STL_AddEdge | ( | Ng_STL_Geometry * | geom, |
double * | p1, | ||
double * | p2 | ||
) |
DLL_HEADER void Ng_STL_AddTriangle | ( | Ng_STL_Geometry * | geom, |
double * | p1, | ||
double * | p2, | ||
double * | p3, | ||
double * | nv = NULL |
||
) |
DLL_HEADER void Ng_STL_Generate_SecondOrder | ( | Ng_STL_Geometry * | geom, |
Ng_Mesh * | mesh | ||
) |
DLL_HEADER Ng_Result Ng_STL_GenerateSurfaceMesh | ( | Ng_STL_Geometry * | geom, |
Ng_Mesh * | mesh, | ||
Ng_Meshing_Parameters * | mp | ||
) |
DLL_HEADER Ng_STL_Geometry* Ng_STL_LoadGeometry | ( | const char * | filename, |
int | binary = 0 |
||
) |
DLL_HEADER Ng_Result Ng_STL_MakeEdges | ( | Ng_STL_Geometry * | geom, |
Ng_Mesh * | mesh, | ||
Ng_Meshing_Parameters * | mp | ||
) |
DLL_HEADER void Ng_STL_Uniform_Refinement | ( | Ng_STL_Geometry * | geom, |
Ng_Mesh * | mesh | ||
) |
DLL_HEADER void Ng_Uniform_Refinement | ( | Ng_Mesh * | mesh | ) |