Code_Saturne
CFD tool
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cs_mesh_connect.h
Go to the documentation of this file.
1 #ifndef __CS_MESH_CONNECT_H__
2 #define __CS_MESH_CONNECT_H__
3 
4 /*============================================================================
5  * Extract nodal connectivity mesh representations from a native mesh.
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2012 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 /*----------------------------------------------------------------------------
31  * FVM library headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "fvm_nodal.h"
35 
36 /*----------------------------------------------------------------------------
37  * Local headers
38  *----------------------------------------------------------------------------*/
39 
40 #include "cs_base.h"
41 #include "cs_mesh.h"
42 
43 /*----------------------------------------------------------------------------*/
44 
46 
47 /*=============================================================================
48  * Macro definitions
49  *============================================================================*/
50 
51 /*============================================================================
52  * Type definitions
53  *============================================================================*/
54 
55 /*============================================================================
56  * Static global variables
57  *============================================================================*/
58 
59 /*=============================================================================
60  * Public function prototypes
61  *============================================================================*/
62 
63 /*----------------------------------------------------------------------------
64  * Extract a mesh's "cells -> faces" connectivity.
65  *
66  * We consider a common numbering for internal and boundary faces, in which
67  * boundary faces are defined first. The common id for the i-th boundary
68  * face is thus i, and that of the j-th interior face is n_b_faces + j.
69  *
70  * If ind_cel_extr != NULL, then:
71  * --- ind_cel_extr[cell_id] = id in the list to extract (0 to n-1)
72  * if cell cell_id should be extracted
73  * --- ind_cel_extr[cell_id] = -1 if cells cell_id should be ignored
74  *
75  * parameters:
76  * mesh <-- pointer to mesh structure
77  * extr_cell_size <-- size of extr_cell_id[] array
78  * extr_cell_id <-- extr_cell_id = ids of extracted cells, or -1
79  * p_cell_faces_idx --> cells -> faces index
80  * p_cell_faces_val --> cells -> faces connectivity
81  *----------------------------------------------------------------------------*/
82 
83 void
85  cs_lnum_t extr_cell_size,
86  const cs_lnum_t extr_cell_id[],
87  cs_lnum_t **const p_cell_faces_idx,
88  cs_lnum_t **const p_cell_faces_val);
89 
90 /*----------------------------------------------------------------------------
91  * Build a nodal connectivity structure from a subset of a mesh's cells.
92  *
93  * The list of cells to extract is optional (if none is given, all cells
94  * faces are extracted by default); it does not need to be ordered on input,
95  * but is always ordered on exit (as cells are extracted by increasing number
96  * traversal, the list is reordered to ensure the coherency of the extracted
97  * mesh's link to its parent cells, built using this list).
98  *
99  * parameters:
100  * mesh <-- base mesh
101  * name <-- extracted mesh name
102  * include_families <-- include family info if true
103  * cell_list_size <-- size of cell_list[] array
104  * cell_list <-> list of cells (1 to n), or NULL
105  *
106  * returns:
107  * pointer to extracted nodal mesh
108  *----------------------------------------------------------------------------*/
109 
110 fvm_nodal_t *
112  const char *name,
113  bool include_families,
114  cs_lnum_t cell_list_size,
115  cs_lnum_t cell_list[]);
116 
117 /*----------------------------------------------------------------------------
118  * Build a nodal connectivity structure from a subset of a mesh's faces.
119  *
120  * The lists of faces to extract are optional (if none is given, boundary
121  * faces are extracted by default); they do not need to be ordered on input,
122  * but they are always ordered on exit (as faces are extracted by increasing
123  * number traversal, the lists are reordered to ensure the coherency of
124  * the extracted mesh's link to its parent faces, built using these lists).
125  *
126  * parameters:
127  * mesh <-- base mesh
128  * name <-- extracted mesh name
129  * include_families <-- include family info if true
130  * i_face_list_size <-- size of i_face_list[] array
131  * b_face_list_size <-- size of b_face_list[] array
132  * i_face_list <-> list of interior faces (1 to n), or NULL
133  * b_face_list <-> list of boundary faces (1 to n), or NULL
134  *
135  * returns:
136  * pointer to extracted nodal mesh
137  *----------------------------------------------------------------------------*/
138 
139 fvm_nodal_t *
141  const char *name,
142  bool include_families,
143  cs_lnum_t i_face_list_size,
144  cs_lnum_t b_face_list_size,
145  cs_lnum_t i_face_list[],
146  cs_lnum_t b_face_list[]);
147 
148 /*----------------------------------------------------------------------------*/
149 
151 
152 #endif /* __CS_MESH_CONNECT_H__ */
BEGIN_C_DECLS void cs_mesh_connect_get_cell_faces(const cs_mesh_t *mesh, cs_lnum_t extr_cell_size, const cs_lnum_t extr_cell_id[], cs_lnum_t **const p_cell_faces_idx, cs_lnum_t **const p_cell_faces_val)
Definition: cs_mesh_connect.c:313
Definition: fvm_nodal_priv.h:152
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
Definition: cs_mesh.h:62
Definition: mesh.f90:25
fvm_nodal_t * cs_mesh_connect_cells_to_nodal(const cs_mesh_t *mesh, const char *name, bool include_families, cs_lnum_t cell_list_size, cs_lnum_t cell_list[])
Definition: cs_mesh_connect.c:469
int cs_lnum_t
Definition: cs_defs.h:260
fvm_nodal_t * cs_mesh_connect_faces_to_nodal(const cs_mesh_t *mesh, const char *name, bool include_families, cs_lnum_t i_face_list_size, cs_lnum_t b_face_list_size, cs_lnum_t i_face_list[], cs_lnum_t b_face_list[])
Definition: cs_mesh_connect.c:703
#define END_C_DECLS
Definition: cs_defs.h:366