1
#ifndef __MY_PLE_MESH_PRIV_H__
2
#define __MY_PLE_MESH_PRIV_H__
4
/*============================================================================
5
* Main structure for a nodal representation associated with a mesh
6
*============================================================================*/
9
This file is part of the "Parallel Location and Exchange" library,
10
intended to provide mesh or particle-based code coupling services.
12
Copyright (C) 2005-2010 EDF
14
This library is free software; you can redistribute it and/or
15
modify it under the terms of the GNU Lesser General Public
16
License as published by the Free Software Foundation; either
17
version 2.1 of the License, or (at your option) any later version.
19
This library is distributed in the hope that it will be useful,
20
but WITHOUT ANY WARRANTY; without even the implied warranty of
21
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22
Lesser General Public License for more details.
24
You should have received a copy of the GNU Lesser General Public
25
License along with this library; if not, write to the Free Software
26
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29
/*----------------------------------------------------------------------------
31
*----------------------------------------------------------------------------*/
35
/*----------------------------------------------------------------------------*/
40
} /* Fake brace to force back Emacs auto-indentation back to column 0 */
42
#endif /* __cplusplus */
44
/*=============================================================================
46
*============================================================================*/
48
/*============================================================================
50
*============================================================================*/
52
/*----------------------------------------------------------------------------
53
* Structure defining a mesh section
54
*----------------------------------------------------------------------------*/
56
typedef struct _my_ple_mesh_section_t {
58
/* Basic information */
59
/*-------------------*/
61
int entity_dim; /* Entity dimension */
63
ple_lnum_t n_elements; /* Number of elements */
65
my_ple_element_t type; /* Element types */
70
size_t connectivity_size; /* Size of vertex_num array;
74
(vertex_index[n_elements])
76
(vertex_index[n_faces]) */
78
int stride; /* Element size for regular elements
79
(0 for polygons and polyhedra) */
81
ple_lnum_t n_faces; /* Number of faces defining polyhedra */
83
/* Pointers to connectivity arrays, which may be shared */
85
const ple_lnum_t *face_index; /* polyhedron -> faces index (O to n-1);
86
size: n_elements + 1 */
87
const ple_lnum_t *face_num; /* polyhedron -> face numbers (1 to n, signed,
88
> 0 for outwards pointing face normal
89
< 0 for inwards pointing face normal);
90
size: face_index[n_elements] */
92
const ple_lnum_t *vertex_index; /* polygon face -> vertices index (O to n-1);
95
const ple_lnum_t *vertex_num; /* vertex numbers (1 to n);
96
size: connectivity_size */
98
/* Pointers to local connectivity arrays, if owner */
100
ple_lnum_t *_face_index; /* face_index if owner, NULL if shared */
101
ple_lnum_t *_face_num; /* face_num if owner, NULL if shared */
102
ple_lnum_t *_vertex_index; /* vertex_index if owner, NULL if shared */
103
ple_lnum_t *_vertex_num; /* vertex numbers if owner, NULL if shared */
105
/* Pointers to element numbering */
107
ple_lnum_t *element_num; /* element numbers, or NULL */
109
} my_ple_mesh_section_t;
111
/*----------------------------------------------------------------------------
112
* Structure defining a mesh in nodal definition
113
*----------------------------------------------------------------------------*/
115
struct _my_ple_mesh_t {
117
/* Global indicators */
118
/*-------------------*/
120
int dim; /* Spatial dimension */
121
int n_sections; /* Number of sections */
123
/* Local dimensions */
124
/*------------------*/
126
/* Total number of cells, faces, edges, and vertices */
130
ple_lnum_t n_vertices;
132
/* Vertex definitions; */
133
/*---------------------*/
135
const ple_coord_t *vertex_coords; /* pointer to vertex coordinates
137
x1, y1, z1, x2, y2, z2, ...) */
138
ple_coord_t *_vertex_coords; /* pointer to vertex coordinates if
139
owner (for use with own algorithms) */
141
/* Mesh connectivity */
142
/*-------------------*/
144
my_ple_mesh_section_t **sections; /* Array of section descriptions */
148
/*----------------------------------------------------------------------------*/
152
#endif /* __cplusplus */
154
#endif /* __MY_PLE_MESH_PRIV_H__ */