1 #ifndef __CS_EXT_NEIGHBOR_H__
2 #define __CS_EXT_NEIGHBOR_H__
3 
4 /*============================================================================
5  * Fortran interfaces of functions needing a synchronization of the extended
6  * neighborhood.
7  *============================================================================*/
8 
9 /*
10   This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12   Copyright (C) 1998-2021 EDF S.A.
13 
14   This program is free software; you can redistribute it and/or modify it under
15   the terms of the GNU General Public License as published by the Free Software
16   Foundation; either version 2 of the License, or (at your option) any later
17   version.
18 
19   This program is distributed in the hope that it will be useful, but WITHOUT
20   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
22   details.
23 
24   You should have received a copy of the GNU General Public License along with
25   this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26   Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 */
28 
29 /*----------------------------------------------------------------------------*/
30 
31 /*----------------------------------------------------------------------------
32  *  Local headers
33  *----------------------------------------------------------------------------*/
34 
35 #include "cs_base.h"
36 #include "cs_mesh.h"
37 #include "cs_mesh_quantities.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
41 BEGIN_C_DECLS
42 
43 /*=============================================================================
44  * Local Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definition
49  *============================================================================*/
50 
51 /*----------------------------------------------------------------------------
52  * Extended neighborhood type
53  *----------------------------------------------------------------------------*/
54 
55 typedef enum {
56 
57   CS_EXT_NEIGHBORHOOD_NONE,                  /* No extended neighborhood */
58   CS_EXT_NEIGHBORHOOD_COMPLETE,              /* Full extended neighborhood */
59   CS_EXT_NEIGHBORHOOD_CELL_CENTER_OPPOSITE,  /* Cell centers best aligned
60                                                 opposite to adjacent
61                                                 cell centers */
62   CS_EXT_NEIGHBORHOOD_NON_ORTHO_MAX          /* Cells adjacent to faces
63                                                 whose non-orthogonality exceeds
64                                                 a given threshold */
65 
66 } cs_ext_neighborhood_type_t;
67 
68 /*============================================================================
69  *  Global variables
70  *============================================================================*/
71 
72 /* Short names for extended neighborhood types */
73 
74 extern const char *cs_ext_neighborhood_type_name[];
75 
76 /*============================================================================
77  * Public function prototypes
78  *============================================================================*/
79 
80 /*----------------------------------------------------------------------------*/
81 /*!
82  * \brief Get the extended neighborhood type.
83  *
84  * \return  extended neighborhood type
85  */
86 /*----------------------------------------------------------------------------*/
87 
88 cs_ext_neighborhood_type_t
89 cs_ext_neighborhood_get_type(void);
90 
91 /*----------------------------------------------------------------------------*/
92 /*!
93  * \brief Set the extended neighborhood type.
94  *
95  * \param[in]  enh_type  extended neighborhood type
96  */
97 /*----------------------------------------------------------------------------*/
98 
99 void
100 cs_ext_neighborhood_set_type(cs_ext_neighborhood_type_t  enh_type);
101 
102 /*----------------------------------------------------------------------------*/
103 /*!
104  * \brief Get the non_orthogonality threshold  (in degrees) associated with the
105  *        CS_EXT_NEIGHBORHOOD_NON_ORTHO_MAX neighborhood type.
106  *
107  * \return  non-orthogonality threshold
108  */
109 /*----------------------------------------------------------------------------*/
110 
111 cs_real_t
112 cs_ext_neighborhood_get_non_ortho_max(void);
113 
114 /*----------------------------------------------------------------------------*/
115 /*!
116  * \brief Set the non_orthogonality threshold (in degrees) associated with the
117  *        CS_EXT_NEIGHBORHOOD_NON_ORTHO_MAX neighborhood type.
118  *
119  * \param[in]  non_ortho_max  non-orthogonality threshold
120  */
121 /*----------------------------------------------------------------------------*/
122 
123 void
124 cs_ext_neighborhood_set_non_ortho_max(cs_real_t  non_ortho_max);
125 
126 /*----------------------------------------------------------------------------*/
127 /*!
128  * \brief Reduce the "cell -> cells" connectivity for the
129  *        extended neighborhood using a non-orthogonality criterion.
130  *
131  * Note: Only cells sharing only a vertex or vertices (not a face)
132  *       belong to the "cell -> cells" connectivity.
133  *
134  * \param[in]  mesh             pointer to mesh structure
135  * \param[in]  mesh_quantities  associated mesh quantities
136  */
137 /*----------------------------------------------------------------------------*/
138 
139 void
140 cs_ext_neighborhood_reduce(cs_mesh_t             *mesh,
141                            cs_mesh_quantities_t  *mesh_quantities);
142 
143 /*----------------------------------------------------------------------------*/
144 /*!
145  * \brief Create the  "cell -> cells" connectivity.
146  *
147  * \param[in, out]  mesh  pointer to a mesh structure
148  */
149 /*----------------------------------------------------------------------------*/
150 
151 void
152 cs_ext_neighborhood_define(cs_mesh_t  *mesh);
153 
154 /*----------------------------------------------------------------------------*/
155 
156 END_C_DECLS
157 
158 #endif /* __CS_EXT_NEIGHBOR_H__ */
159