My Project
programmer's documentation
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-2019 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  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "fvm_nodal.h"
35 
36 #include "cs_base.h"
37 #include "cs_mesh.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*=============================================================================
44  * Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definitions
49  *============================================================================*/
50 
51 /*============================================================================
52  * Static global variables
53  *============================================================================*/
54 
55 /*=============================================================================
56  * Public function prototypes
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------
60  * Extract a mesh's "cells -> faces" connectivity.
61  *
62  * We consider a common numbering for internal and boundary faces, in which
63  * boundary faces are defined first. The common id for the i-th boundary
64  * face is thus i, and that of the j-th interior face is n_b_faces + j.
65  *
66  * If ind_cel_extr != NULL, then:
67  * --- ind_cel_extr[cell_id] = id in the list to extract (0 to n-1)
68  * if cell cell_id should be extracted
69  * --- ind_cel_extr[cell_id] = -1 if cells cell_id should be ignored
70  *
71  * parameters:
72  * mesh <-- pointer to mesh structure
73  * extr_cell_size <-- size of extr_cell_id[] array
74  * extr_cell_id <-- extr_cell_id = ids of extracted cells, or -1
75  * p_cell_faces_idx --> cells -> faces index
76  * p_cell_faces_val --> cells -> faces connectivity
77  *----------------------------------------------------------------------------*/
78 
79 void
81  cs_lnum_t extr_cell_size,
82  const cs_lnum_t extr_cell_id[],
83  cs_lnum_t **const p_cell_faces_idx,
84  cs_lnum_t **const p_cell_faces_val);
85 
86 /*----------------------------------------------------------------------------
87  * Build a nodal connectivity structure from a subset of a mesh's cells.
88  *
89  * The list of cells to extract is optional (if none is given, all cells
90  * faces are extracted by default); it does not need to be ordered on input,
91  * but is always ordered on exit (as cells are extracted by increasing number
92  * traversal, the list is reordered to ensure the coherency of the extracted
93  * mesh's link to its parent cells, built using this list).
94  *
95  * parameters:
96  * mesh <-- base mesh
97  * name <-- extracted mesh name
98  * include_families <-- include family info if true
99  * cell_list_size <-- size of cell_list[] array
100  * cell_list <-> list of cells (1 to n), or NULL
101  *
102  * returns:
103  * pointer to extracted nodal mesh
104  *----------------------------------------------------------------------------*/
105 
106 fvm_nodal_t *
108  const char *name,
109  bool include_families,
110  cs_lnum_t cell_list_size,
111  cs_lnum_t cell_list[]);
112 
113 /*----------------------------------------------------------------------------
114  * Build a nodal connectivity structure from a subset of a mesh's faces.
115  *
116  * The lists of faces to extract are optional (if none is given, boundary
117  * faces are extracted by default); they do not need to be ordered on input,
118  * but they are always ordered on exit (as faces are extracted by increasing
119  * number traversal, the lists are reordered to ensure the coherency of
120  * the extracted mesh's link to its parent faces, built using these lists).
121  *
122  * parameters:
123  * mesh <-- base mesh
124  * name <-- extracted mesh name
125  * include_families <-- include family info if true
126  * i_face_list_size <-- size of i_face_list[] array
127  * b_face_list_size <-- size of b_face_list[] array
128  * i_face_list <-> list of interior faces (1 to n), or NULL
129  * b_face_list <-> list of boundary faces (1 to n), or NULL
130  *
131  * returns:
132  * pointer to extracted nodal mesh
133  *----------------------------------------------------------------------------*/
134 
135 fvm_nodal_t *
137  const char *name,
138  bool include_families,
139  cs_lnum_t i_face_list_size,
140  cs_lnum_t b_face_list_size,
141  cs_lnum_t i_face_list[],
142  cs_lnum_t b_face_list[]);
143 
144 /*----------------------------------------------------------------------------*/
156 /*----------------------------------------------------------------------------*/
157 
158 void
160  const char v_flag[],
161  cs_lnum_t **v2c_idx,
162  cs_lnum_t **v2c);
163 
164 /*----------------------------------------------------------------------------*/
165 
167 
168 #endif /* __CS_MESH_CONNECT_H__ */
cs_mesh_connect_vertices_to_cells
void cs_mesh_connect_vertices_to_cells(cs_mesh_t *mesh, const char v_flag[], cs_lnum_t **v2c_idx, cs_lnum_t **v2c)
Build a vertex to cell connectivity for marked vertices only.
Definition: cs_mesh_connect.c:771
cs_mesh_connect_faces_to_nodal
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:706
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_mesh_connect_get_cell_faces
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:314
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
mesh
Definition: mesh.f90:26
cs_mesh.h
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_mesh_connect_cells_to_nodal
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:470
fvm_nodal.h
cs_mesh_t
Definition: cs_mesh.h:63
cs_base.h