~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to libple/examples/my_ple_mesh_priv.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-01 17:43:32 UTC
  • mto: (6.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: package-import@ubuntu.com-20111101174332-tl4vk45no0x3emc3
Tags: upstream-2.1.0
ImportĀ upstreamĀ versionĀ 2.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __MY_PLE_MESH_PRIV_H__
 
2
#define __MY_PLE_MESH_PRIV_H__
 
3
 
 
4
/*============================================================================
 
5
 * Main structure for a nodal representation associated with a mesh
 
6
 *============================================================================*/
 
7
 
 
8
/*
 
9
  This file is part of the "Parallel Location and Exchange" library,
 
10
  intended to provide mesh or particle-based code coupling services.
 
11
 
 
12
  Copyright (C) 2005-2010  EDF
 
13
 
 
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.
 
18
 
 
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.
 
23
 
 
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
 
27
*/
 
28
 
 
29
/*----------------------------------------------------------------------------
 
30
 *  Local headers
 
31
 *----------------------------------------------------------------------------*/
 
32
 
 
33
#include "ple_defs.h"
 
34
 
 
35
/*----------------------------------------------------------------------------*/
 
36
 
 
37
#ifdef __cplusplus
 
38
extern "C" {
 
39
#if 0
 
40
} /* Fake brace to force back Emacs auto-indentation back to column 0 */
 
41
#endif
 
42
#endif /* __cplusplus */
 
43
 
 
44
/*=============================================================================
 
45
 * Macro definitions
 
46
 *============================================================================*/
 
47
 
 
48
/*============================================================================
 
49
 * Type definitions
 
50
 *============================================================================*/
 
51
 
 
52
/*----------------------------------------------------------------------------
 
53
 * Structure defining a mesh section
 
54
 *----------------------------------------------------------------------------*/
 
55
 
 
56
typedef struct _my_ple_mesh_section_t {
 
57
 
 
58
  /* Basic information */
 
59
  /*-------------------*/
 
60
 
 
61
  int         entity_dim;          /* Entity dimension */
 
62
 
 
63
  ple_lnum_t  n_elements;          /* Number of elements */
 
64
 
 
65
  my_ple_element_t  type;         /* Element types */
 
66
 
 
67
  /* Connectivity */
 
68
  /*--------------*/
 
69
 
 
70
  size_t      connectivity_size;   /* Size of vertex_num array;
 
71
                                      for strided elements:
 
72
                                       (n_elements * stride)
 
73
                                      for polygons:
 
74
                                       (vertex_index[n_elements])
 
75
                                      for polyhedra:
 
76
                                       (vertex_index[n_faces]) */
 
77
 
 
78
  int         stride;              /* Element size for regular elements
 
79
                                      (0 for polygons and polyhedra) */
 
80
 
 
81
  ple_lnum_t  n_faces;             /* Number of faces defining polyhedra */
 
82
 
 
83
  /* Pointers to connectivity arrays, which may be shared */
 
84
 
 
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] */
 
91
 
 
92
  const ple_lnum_t  *vertex_index; /* polygon face -> vertices index (O to n-1);
 
93
                                      size: n_faces + 1 */
 
94
 
 
95
  const ple_lnum_t  *vertex_num;   /* vertex numbers (1 to n);
 
96
                                      size: connectivity_size */
 
97
 
 
98
  /* Pointers to local connectivity arrays, if owner */
 
99
 
 
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 */
 
104
 
 
105
  /* Pointers to element numbering */
 
106
 
 
107
  ple_lnum_t  *element_num;        /* element numbers, or NULL */
 
108
 
 
109
} my_ple_mesh_section_t;
 
110
 
 
111
/*----------------------------------------------------------------------------
 
112
 * Structure defining a mesh in nodal definition
 
113
 *----------------------------------------------------------------------------*/
 
114
 
 
115
struct _my_ple_mesh_t {
 
116
 
 
117
  /* Global indicators */
 
118
  /*-------------------*/
 
119
 
 
120
  int    dim;                  /* Spatial dimension */
 
121
  int    n_sections;           /* Number of sections */
 
122
 
 
123
  /* Local dimensions */
 
124
  /*------------------*/
 
125
 
 
126
  /* Total number of cells, faces, edges, and vertices */
 
127
  ple_lnum_t  n_cells;
 
128
  ple_lnum_t  n_faces;
 
129
  ple_lnum_t  n_edges;
 
130
  ple_lnum_t  n_vertices;
 
131
 
 
132
  /* Vertex definitions; */
 
133
  /*---------------------*/
 
134
 
 
135
  const ple_coord_t  *vertex_coords;    /* pointer to  vertex coordinates
 
136
                                           (always interlaced:
 
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) */
 
140
 
 
141
  /* Mesh connectivity */
 
142
  /*-------------------*/
 
143
 
 
144
  my_ple_mesh_section_t  **sections;  /* Array of section descriptions */
 
145
 
 
146
};
 
147
 
 
148
/*----------------------------------------------------------------------------*/
 
149
 
 
150
#ifdef __cplusplus
 
151
}
 
152
#endif /* __cplusplus */
 
153
 
 
154
#endif /* __MY_PLE_MESH_PRIV_H__ */