programmer's documentation
cs_cdo_diffusion.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_DIFFUSION_H__
2 #define __CS_CDO_DIFFUSION_H__
3 
4 /*============================================================================
5  * Build discrete stiffness matrices and handled boundary conditions for the
6  * diffusion term in CDO vertex-based and vertex+cell schemes
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2016 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  * Local headers
31  *----------------------------------------------------------------------------*/
32 
33 #include "cs_cdo.h"
34 #include "cs_cdo_bc.h"
35 #include "cs_cdo_connect.h"
36 #include "cs_cdo_local.h"
37 #include "cs_cdo_quantities.h"
38 #include "cs_hodge.h"
39 #include "cs_param.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 typedef struct _cs_cdo_diff_t cs_cdo_diff_t;
54 
55 /*============================================================================
56  * Public function prototypes
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------*/
71 /*----------------------------------------------------------------------------*/
72 
75  cs_space_scheme_t space_scheme,
76  bool is_uniform,
77  const cs_param_hodge_t h_info,
78  const cs_param_bc_enforce_t bc_enforce);
79 
80 /*----------------------------------------------------------------------------*/
88 /*----------------------------------------------------------------------------*/
89 
92 
93 /*----------------------------------------------------------------------------*/
101 /*----------------------------------------------------------------------------*/
102 
105 
106 /*----------------------------------------------------------------------------*/
114 /*----------------------------------------------------------------------------*/
115 
116 void
118  cs_real_3_t **tmp_vec,
119  cs_real_t **tmp_sca);
120 
121 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 
132 void
134  const cs_cdo_bc_list_t *dir_face,
135  cs_lnum_t *p_c2bcbf_idx[],
136  cs_lnum_t *p_c2bcbf_ids[]);
137 
138 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 
151 cs_locmat_t *
153  const cs_cell_mesh_t *lm,
154  const cs_real_3_t *tensor,
155  cs_cdo_diff_t *diff);
156 
157 /*----------------------------------------------------------------------------*/
169 /*----------------------------------------------------------------------------*/
170 
171 void
173  const cs_cell_mesh_t *cm,
174  const cs_real_t matpty[3][3],
175  cs_cdo_diff_t *diff,
176  cs_cdo_locsys_t *csys);
177 
178 /*----------------------------------------------------------------------------*/
192 /*----------------------------------------------------------------------------*/
193 
194 void
196  const cs_dface_t *dfaces,
197  const cs_real_t pty_tens[3][3],
198  const double *p_v,
199  const double p_c,
200  cs_cdo_diff_t *diff,
201  double *c_flux);
202 
203 /*----------------------------------------------------------------------------*/
217 /*----------------------------------------------------------------------------*/
218 
219 double
221  const cs_real_t pty_tens[3][3],
222  const double *p_v,
223  const double p_f,
224  const double p_c,
225  cs_cdo_diff_t *diff);
226 
227 /*----------------------------------------------------------------------------*/
228 
230 
231 #endif /* __CS_CDO_DIFFUSION_H__ */
Definition: cs_cdo_bc.h:58
void cs_cdo_diffusion_build_c2bcbf(const cs_cdo_connect_t *connect, const cs_cdo_bc_list_t *dir_face, cs_lnum_t *p_c2bcbf_idx[], cs_lnum_t *p_c2bcbf_ids[])
Define a cell –> Dirichlet boundary faces connectivity.
Definition: cs_cdo_diffusion.c:869
cs_cdo_diff_t * cs_cdo_diffusion_builder_free(cs_cdo_diff_t *diff)
Free a cs_cdo_diff_t structure.
Definition: cs_cdo_diffusion.c:786
double cs_cdo_diffusion_face_flux(const cs_face_mesh_t *fm, const cs_real_t pty_tens[3][3], const double *p_v, const double p_f, const double p_c, cs_cdo_diff_t *diff)
Compute the diffusive flux across a face (based on a subdivision into tetrahedra of the volume p_{f...
Definition: cs_cdo_diffusion.c:1342
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
void cs_cdo_diffusion_weak_bc(cs_lnum_t f_id, const cs_cell_mesh_t *cm, const cs_real_t matpty[3][3], cs_cdo_diff_t *diff, cs_cdo_locsys_t *csys)
Define the local (cellwise) "normal trace gradient" matrix taking into account Dirichlet BCs by a wea...
Definition: cs_cdo_diffusion.c:1015
Definition: cs_cdo_local.h:73
void cs_cdo_diffusion_cellwise_flux(const cs_cell_mesh_t *cm, const cs_dface_t *dfaces, const cs_real_t pty_tens[3][3], const double *p_v, const double p_c, cs_cdo_diff_t *diff, double *c_flux)
Compute the diffusive flux across dual faces for a given cell The computation takes into account a su...
Definition: cs_cdo_diffusion.c:1241
Definition: cs_cdo_connect.h:67
cs_locmat_t * cs_cdo_diffusion_build_local(const cs_cdo_quantities_t *quant, const cs_cell_mesh_t *lm, const cs_real_3_t *tensor, cs_cdo_diff_t *diff)
Define the local (cellwise) stiffness matrix.
Definition: cs_cdo_diffusion.c:942
struct _cs_cdo_diff_t cs_cdo_diff_t
Definition: cs_cdo_diffusion.h:53
double cs_real_t
Floating-point value.
Definition: cs_defs.h:296
Definition: cs_cdo_quantities.h:100
struct _hodge_builder_t cs_hodge_builder_t
Definition: cs_hodge.h:53
cs_space_scheme_t
Definition: cs_cdo.h:99
Definition: cs_field_pointer.h:118
Definition: cs_cdo_local.h:59
cs_cdo_diff_t * cs_cdo_diffusion_builder_init(const cs_cdo_connect_t *connect, cs_space_scheme_t space_scheme, bool is_uniform, const cs_param_hodge_t h_info, const cs_param_bc_enforce_t bc_enforce)
Initialize a builder structure used to build the stiffness matrix.
Definition: cs_cdo_diffusion.c:723
cs_hodge_builder_t * cs_cdo_diffusion_get_hodge_builder(cs_cdo_diff_t *diff)
Get the related Hodge builder structure.
Definition: cs_cdo_diffusion.c:824
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:308
Definition: cs_cdo_quantities.h:90
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:292
#define END_C_DECLS
Definition: cs_defs.h:449
void cs_cdo_diffusion_get_tmp_buffers(const cs_cdo_diff_t *diff, cs_real_3_t **tmp_vec, cs_real_t **tmp_sca)
Get temporary buffers attached to a cs_cdo_diff_t structure.
Definition: cs_cdo_diffusion.c:843
Definition: cs_cdo_local.h:125
Definition: cs_param.h:143
cs_param_bc_enforce_t
Definition: cs_param.h:271
Definition: cs_cdo_toolbox.h:71