H2Lib  3.0
surface3d.h
Go to the documentation of this file.
1 
2 /* ------------------------------------------------------------
3  * This is the file "surface3d.h" of the H2Lib package.
4  * All rights reserved, Steffen Boerm 2010
5  * ------------------------------------------------------------ */
6 
10 #ifndef SURFACE3D_H
11 #define SURFACE3D_H
12 
28 typedef struct _surface3d surface3d;
29 
34 
38 typedef const surface3d *pcsurface3d;
39 
40 #include "settings.h"
41 
45 struct _surface3d {
52 
54  real (*x)[3];
56  uint (*e)[2];
58  uint (*t)[3];
60  uint (*s)[3];
61 
63  real (*n)[3];
66 
71 };
72 
73 /* ------------------------------------------------------------
74  * Constructor and destructor
75  * ------------------------------------------------------------ */
76 
92 
100 HEADER_PREFIX void
102 
108 HEADER_PREFIX void
110 
111 /* ------------------------------------------------------------
112  * Statistics
113  * ------------------------------------------------------------ */
114 
123 HEADER_PREFIX void
125  preal hmin, preal hmax,
126  preal anglemin, preal angleedge);
127 
128 /* ------------------------------------------------------------
129  * Debugging
130  * ------------------------------------------------------------ */
131 
137 HEADER_PREFIX void
139 
148 
155 HEADER_PREFIX bool
157 
164 HEADER_PREFIX bool
166 
177 HEADER_PREFIX void
178 scale_surface3d(psurface3d gr, real *a, real *b);
179 
186 HEADER_PREFIX void
188 
198 
199 /* ------------------------------------------------------------
200  * File I/O
201  * ------------------------------------------------------------ */
202 
214 HEADER_PREFIX void
215 write_surface3d(pcsurface3d gr, const char *filename);
216 
246 read_surface3d(const char *filename);
247 
255 HEADER_PREFIX void
256 write_nc_surface3d(pcsurface3d gr, const char *filename);
257 
271 read_nc_surface3d(const char *filename);
272 
286 read_netgen_surface3d(const char *filename);
287 
301 read_gmsh_surface3d(const char *filename);
302 
316 read_unv_surface3d(char *filename);
317 
318 /* ------------------------------------------------------------
319  * Mesh refinement
320  * ------------------------------------------------------------ */
321 
334 
339 #endif
preal g
Gram determinant, equals area doubled.
Definition: surface3d.h:65
const surface3d * pcsurface3d
Abbreviation for a pointer to a constant surface3d object.
Definition: surface3d.h:38
psurface3d read_surface3d(const char *filename)
Read geometrical information of a surface mesh from a given file using the H2Lib ascii representation...
void translate_surface3d(psurface3d gr, real *t)
Translate a geometry gr by a vector .
bool isoriented_surface3d(pcsurface3d gr)
Check if the surface is oriented correctly.
void getproperties_surface3d(pcsurface3d gr, preal hmin, preal hmax, preal anglemin, preal angleedge)
Compute geometrical properties of a surface grid.
unsigned uint
Unsigned integer type.
Definition: settings.h:70
psurface3d read_unv_surface3d(char *filename)
Read geometrical information of a surface mesh from a given file using the unv format.
uint edges
Number of edges.
Definition: surface3d.h:49
psurface3d merge_surface3d(pcsurface3d gr1, pcsurface3d gr2)
Merge to meshes into a single mesh.
uint check_surface3d(pcsurface3d gr)
Check if the geometrical information of a surface are consistent.
uint(* s)[3]
Triangle edges, s[i][j] opposite t[i][j].
Definition: surface3d.h:60
uint triangles
Number of triangles.
Definition: surface3d.h:51
bool isclosed_surface3d(pcsurface3d gr)
Check if the surface mesh is closed.
real(* n)[3]
Normal vectors.
Definition: surface3d.h:63
psurface3d read_nc_surface3d(const char *filename)
Read geometrical information of a surface mesh from a given file using NetCDF.
psurface3d read_gmsh_surface3d(const char *filename)
Read geometrical information of a surface mesh from a given file using the gmsh format.
real(* x)[3]
Vertex coordinates.
Definition: surface3d.h:54
void scale_surface3d(psurface3d gr, real *a, real *b)
Scale the geometry to a cube of given size.
uint(* t)[3]
Triangle vertices, counter-clockwise.
Definition: surface3d.h:58
uint(* e)[2]
Edge vertices.
Definition: surface3d.h:56
void prepare_surface3d(psurface3d gr)
This function computes the normal vectors n , the gram determinants g and the minimal and maximal mes...
Representation of a triangle surface mesh.
Definition: surface3d.h:45
#define HEADER_PREFIX
Prefix for function declarations.
Definition: settings.h:43
double real
real floating point type.
Definition: settings.h:97
void del_surface3d(psurface3d gr)
Free Storage allocated for a surface3d object.
void write_surface3d(pcsurface3d gr, const char *filename)
Write geometrical information of a surface mesh into a given file using the H2Lib ascii representatio...
psurface3d read_netgen_surface3d(const char *filename)
Read geometrical information of a surface mesh from a given file using the netgen format...
real * preal
Pointer to real array.
Definition: settings.h:145
void print_surface3d(pcsurface3d gr)
print geometrical information to stdout.
real hmin
Minimal mesh size.
Definition: surface3d.h:68
psurface3d refine_red_surface3d(psurface3d in)
Apply a red refinement to a surface mesh.
uint vertices
Number of vertices.
Definition: surface3d.h:47
surface3d * psurface3d
Abbreviation for a pointer to a surface3d object.
Definition: surface3d.h:33
psurface3d new_surface3d(uint vertices, uint edges, uint triangles)
create a new surface3d object with a certain number of vertices, edges and triangles.
void write_nc_surface3d(pcsurface3d gr, const char *filename)
Write geometrical information of a surface mesh into a given file using NetCDF.
real hmax
Maximal mesh size.
Definition: surface3d.h:70