This chapter introduces PHIGURE functions to deal with 3D meshes of the following type:
Each of these meshes is described giving its geometry (C structure Tmesh3D), its 3D scalar values (C structure Tscalar3D_data) and its 3D vector values (C structure Tvec3D_data). A PHIGURE function for 3D mesh representation has the following pattern:
txxxxx (struct_id, &mesh, &scal_data)
where
Remarks on 3D non-structured meshes :
The three types of 3D non-structured meshes are defined giving N triplets for coordinates of each node (from 0 to N-1), and the list of M mesh elements. Each mesh element is defined by its 4, 5, 6 or 8 vertices.
3D non-structured meshes must follow rules:


Data structure of mesh values define one value for each mesh node.
Description of the C structure mesh:
typedef struct {
Tmesh3D_type type;
union {
struct {
Pint num_x;
Pint num_y;
Pint num_z;
Pfloat *x;
Pfloat *y;
Pfloat *z;
} parallelepipedic;
struct {
Pint num_x;
Pint num_y;
Pint num_z;
Pfloat ***x;
Pfloat ***y;
Pfloat ***z;
} hexahedral;
struct {
Pint num_r;
Pint num_p;
Pint num_z;
Pfloat *r;
Pfloat *p;
Pfloat *z;
} cylindrical;
struct {
Pint num_r;
Pint num_t;
Pint num_p;
Pfloat *r;
Pfloat *t;
Pfloat *p;
} spherical;
struct {
Pint num_hexahedrons;
Pint num_nodes;
Thexahedron_ind *hexahedron_nodes;
Ppoint3 *nodes;
} ns_hexahedrons;
struct {
Pint num_tetrahedrons;
Pint num_nodes;
Ttetrahedron_ind *tetrahedron_nodes;
Ppoint3 *nodes;
} ns_tetrahedrons;
struct {
Pint num_elems;
Pint num_nodes;
Pint_list *elem_nodes;
Ppoint3 *nodes;
} ns_non_homo_3D;
} geometry;
} Tmesh3D;
type stands for the type of geometry of the mesh :
typedef enum {
TPARALLELEPIPEDIC_MESH,
THEXAHEDRAL_MESH,
TCYLINDRICAL_MESH,
TSPHERICAL_MESH,
TNS_MESH_OF_HEXAHEDRONS,
TNS_MESH_OF_TETRAHEDRONS,
TNS_MESH_NON_HOMO_3D
} Tmesh3D_type;
nodes stands for a mesh node :
typedef struct {
Pfloat x;
Pfloat y;
Pfloat z;
} Ppoint3;
Ttetrahedron_ind is a four integers array describing the four tetrahedron node indices:
typedef Pint Ttetrahedron_ind [4];
Thexahedron_ind is a height integers array describing the height hexahadron node indices:
typedef Pint Thexahedron_ind[8];
Description
of the C structures scal_data:
typedef union {
struct {
Pfloat ***s;
} parallelepipedic;
struct {
Pfloat ***s;
} hexahedral;
struct {
Pfloat ***s;
Pfloat *sa;
} cylindrical;
struct {
Pfloat ***s;
Pfloat *spa;
Pfloat *sna;
Pfloat so;
} spherical;
struct {
Pfloat *s;
} ns_hexahedrons;
struct {
Pfloat *s;
} ns_tetrahedrons;
struct {
Pfloat *s;
} ns_non_homo_3D;
} Tscalar3D_data;
Description of the C structures vector_data:
typedef union {
struct {
Pvec3 ***v;
} parallelepipedic;
struct {
Pvec3 ***v;
} hexahedral;
struct {
Pvec3 ***v;
Pvec3 *va;
} cylindrical;
struct {
Pvec3 ***v;
Pvec3 *vpa;
Pvec3 *vna
Pvec3 vo;
} spherical;
struct {
Pvec3 *v;
} ns_hexahedrons;
struct {
Pvec3 *v;
} ns_tetrahedrons;
struct {
Pvec3 *v;
} ns_non_homo_3D;
} Tvec3D_data
where Pvec3 is 3D vector type for PHIGURE:
typedef struct {
Pfloat delta_x;
Pfloat delta_y;
Pfloat delta_z;
} Pvec3;
Triple pointer structures fields (***s, ***x, ***y, ***z, or ***v) may be allocated calling utility functions talloc_float_matrix3 and talloc_vec_matrix3, and may be freed calling utility functions tfree_float_matrix3 and tfree_vec_matrix3.