programmer's documentation
cs_cdo_connect.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_CONNECT_H__
2 #define __CS_CDO_CONNECT_H__
3 
4 /*============================================================================
5  * Manage connectivity (Topological features of the mesh)
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2015 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 "cs_base.h"
35 #include "cs_mesh.h"
36 
37 #include "cs_cdo.h"
38 #include "cs_cdo_toolbox.h"
39 #include "cs_sla.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /* First level of information */
50 #define CS_CDO_CONNECT_IN (1 << 0) /* Interior entity */
51 #define CS_CDO_CONNECT_BD (1 << 1) /* Border entity */
52 
53 /*============================================================================
54  * Type definitions
55  *============================================================================*/
56 
57 typedef struct {
58 
59  cs_flag_t *flag; // CS_CDO_CONNECT_IN/BD
60 
61  cs_lnum_t n_ent; // number of entities
62  cs_lnum_t n_ent_in; // number of interior entities
63  cs_lnum_t n_ent_bd; // number of border entities
64 
66 
67 typedef struct { /* Connectivity structure */
68 
69  /* Upward oriented connectivity */
70  cs_sla_matrix_t *v2e; // vertex --> edges connectivity
71  cs_sla_matrix_t *e2f; // edge --> faces connectivity
72  cs_sla_matrix_t *f2c; // face --> cells connectivity
73 
74  /* Downward oriented connectivity */
75  cs_sla_matrix_t *e2v; // edge --> vertices connectivity
76  cs_sla_matrix_t *f2e; // face --> edges connectivity
77  cs_sla_matrix_t *c2f; // cell --> faces connectivity
78 
79  /* Specific CDO connect : not oriented (same spirit as Code_Saturne
80  historical connectivity).
81  Use this connectivity to scan dual quantities */
82  cs_connect_index_t *c2e; // cell -> edges connectivity
83  cs_connect_index_t *c2v; // cell -> vertices connectivity
84 
85  /* Max. connectitivy size for cells */
86  cs_lnum_t n_max_vbyc; // max. number of vertices in a cell
87  cs_lnum_t n_max_ebyc; // max. number of edges in a cell
88  cs_lnum_t n_max_fbyc; // max. number of faces in a cell
89 
90  /* Status internal or border entity */
91  cs_connect_info_t *v_info; // count of interior/border vertices
92  cs_connect_info_t *e_info; // count of interior/border edges
93  cs_connect_info_t *f_info; // count of interior/border faces
94  cs_connect_info_t *c_info; /* count of interior/border cells
95  a border cell has at least one border face */
96 
98 
99 /*============================================================================
100  * Global variables
101  *============================================================================*/
102 
103 /*============================================================================
104  * Public function prototypes
105  *============================================================================*/
106 
107 /*----------------------------------------------------------------------------*/
113 /*----------------------------------------------------------------------------*/
114 
115 const char *
116 cs_cdo_connect_flagname(short int flag);
117 
118 /*----------------------------------------------------------------------------*/
126 /*----------------------------------------------------------------------------*/
127 
130 
131 /*----------------------------------------------------------------------------*/
139 /*----------------------------------------------------------------------------*/
140 
143 
144 /*----------------------------------------------------------------------------*/
150 /*----------------------------------------------------------------------------*/
151 
152 void
154 
155 /*----------------------------------------------------------------------------*/
162 /*----------------------------------------------------------------------------*/
163 
164 void
165 cs_cdo_connect_dump(const cs_cdo_connect_t *connect);
166 
167 /*----------------------------------------------------------------------------*/
168 
170 
171 #endif /* __CS_CDO_CONNECT_H__ */
cs_lnum_t n_max_ebyc
Definition: cs_cdo_connect.h:87
cs_lnum_t n_max_fbyc
Definition: cs_cdo_connect.h:88
cs_sla_matrix_t * c2f
Definition: cs_cdo_connect.h:77
Definition: cs_cdo_toolbox.h:82
cs_sla_matrix_t * e2v
Definition: cs_cdo_connect.h:75
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
cs_lnum_t n_max_vbyc
Definition: cs_cdo_connect.h:86
void cs_cdo_connect_dump(const cs_cdo_connect_t *connect)
Dump a cs_cdo_connect_t structure.
Definition: cs_cdo_connect.c:999
Definition: cs_cdo_connect.h:67
cs_connect_index_t * c2v
Definition: cs_cdo_connect.h:83
Definition: cs_sla.h:86
Definition: cs_cdo_connect.h:57
Definition: cs_mesh.h:62
cs_connect_info_t * v_info
Definition: cs_cdo_connect.h:91
cs_cdo_connect_t * cs_cdo_connect_free(cs_cdo_connect_t *connect)
Destroy a cs_cdo_connect_t structure.
Definition: cs_cdo_connect.c:916
cs_sla_matrix_t * f2e
Definition: cs_cdo_connect.h:76
cs_sla_matrix_t * f2c
Definition: cs_cdo_connect.h:72
cs_lnum_t n_ent_bd
Definition: cs_cdo_connect.h:63
cs_lnum_t n_ent
Definition: cs_cdo_connect.h:61
const char * cs_cdo_connect_flagname(short int flag)
String related to flag in cs_connect_info_t.
Definition: cs_cdo_connect.c:834
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
cs_sla_matrix_t * e2f
Definition: cs_cdo_connect.h:71
void cs_cdo_connect_summary(const cs_cdo_connect_t *connect)
Summary of connectivity information.
Definition: cs_cdo_connect.c:951
cs_lnum_t n_ent_in
Definition: cs_cdo_connect.h:62
cs_connect_index_t * c2e
Definition: cs_cdo_connect.h:82
#define END_C_DECLS
Definition: cs_defs.h:430
cs_connect_info_t * e_info
Definition: cs_cdo_connect.h:92
cs_connect_info_t * c_info
Definition: cs_cdo_connect.h:94
cs_cdo_connect_t * cs_cdo_connect_build(const cs_mesh_t *m)
Define a cs_cdo_connect_t structure.
Definition: cs_cdo_connect.c:861
cs_connect_info_t * f_info
Definition: cs_cdo_connect.h:93
cs_flag_t * flag
Definition: cs_cdo_connect.h:59
cs_sla_matrix_t * v2e
Definition: cs_cdo_connect.h:70
unsigned short int cs_flag_t
Definition: cs_cdo.h:50