programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cs_matrix_building.h
Go to the documentation of this file.
1 #ifndef __CS_MATRIX_BUILDING_H__
2 #define __CS_MATRIX_BUILDING_H__
3 
4 /*============================================================================
5  * Matrix building
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2014 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_halo.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*=============================================================================
42  * Local Macro definitions
43  *============================================================================*/
44 
45 /*============================================================================
46  * Type definition
47  *============================================================================*/
48 
49 /*============================================================================
50  * Global variables
51  *============================================================================*/
52 
53 /*============================================================================
54  * Public function prototypes for Fortran API
55  *============================================================================*/
56 
57 /*----------------------------------------------------------------------------
58  * Wrapper to cs_matrix_scalar (or its counterpart for
59  * symmetric matrices)
60  *----------------------------------------------------------------------------*/
61 
62 void CS_PROCF (matrix, MATRIX)
63 (
64  const cs_int_t *const iconvp,
65  const cs_int_t *const idiffp,
66  const cs_int_t *const ndircp,
67  const cs_int_t *const isym,
68  const cs_real_t *const thetap,
69  const cs_int_t *const imucpp,
70  const cs_real_t coefbp[],
71  const cs_real_t cofbfp[],
72  const cs_real_t rovsdt[],
73  const cs_real_t i_massflux[],
74  const cs_real_t b_massflux[],
75  const cs_real_t i_visc[],
76  const cs_real_t b_visc[],
77  const cs_real_t xcpp[],
78  cs_real_t da[],
79  cs_real_t xa[]
80 );
81 
82 /*----------------------------------------------------------------------------
83  * Wrapper to cs_matrix_vector (or its counterpart for
84  * symmetric matrices)
85  *----------------------------------------------------------------------------*/
86 
87 void CS_PROCF (matrxv, MATRXV)
88 (
89  const cs_int_t *const iconvp,
90  const cs_int_t *const idiffp,
91  const cs_int_t *const ndircp,
92  const cs_int_t *const isym,
93  const cs_real_t *const thetap,
94  const cs_real_33_t coefbu[],
95  const cs_real_33_t cofbfu[],
96  const cs_real_33_t fimp[],
97  const cs_real_t i_massflux[],
98  const cs_real_t b_massflux[],
99  const cs_real_t i_visc[],
100  const cs_real_t b_visc[],
101  cs_real_33_t da[],
102  cs_real_t xa[]
103 );
104 
105 /*----------------------------------------------------------------------------
106  * Wrapper to cs_matrix_time_step
107  *----------------------------------------------------------------------------*/
108 
109 void CS_PROCF (matrdt, MATRDT)
110 (
111  const cs_int_t *const iconvp,
112  const cs_int_t *const idiffp,
113  const cs_int_t *const isym,
114  const cs_real_t coefbp[],
115  const cs_real_t cofbfp[],
116  const cs_real_t i_massflux[],
117  const cs_real_t b_massflux[],
118  const cs_real_t i_visc[],
119  const cs_real_t b_visc[],
120  cs_real_t da[]
121 );
122 
123 /*----------------------------------------------------------------------------
124  * Wrapper to cs_matrix_anisotropic_diffusion (or its counterpart for
125  * symmetric matrices)
126  *----------------------------------------------------------------------------*/
127 
128 void CS_PROCF (matrvv, MATRVV)
129 (
130  const cs_int_t *const iconvp,
131  const cs_int_t *const idiffp,
132  const cs_int_t *const ndircp,
133  const cs_int_t *const isym,
134  const cs_real_t *const thetap,
135  const cs_real_33_t coefbu[],
136  const cs_real_33_t cofbfu[],
137  const cs_real_33_t fimp[],
138  const cs_real_t i_massflux[],
139  const cs_real_t b_massflux[],
140  const cs_real_33_t i_visc[],
141  const cs_real_t b_visc[],
142  cs_real_33_t da[],
143  cs_real_332_t xa[]
144 );
145 
146 /*=============================================================================
147  * Public function prototypes
148  *============================================================================*/
149 
150 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 void
186  int idiffp,
187  int ndircp,
188  double thetap,
189  const cs_real_t cofbfp[],
190  const cs_real_t rovsdt[],
191  const cs_real_t i_visc[],
192  const cs_real_t b_visc[],
193  cs_real_t *restrict da,
194  cs_real_t *restrict xa);
195 
196 /*----------------------------------------------------------------------------*/
238 /*----------------------------------------------------------------------------*/
239 
240 void
241 cs_matrix_scalar(const cs_mesh_t *m,
242  int iconvp,
243  int idiffp,
244  int ndircp,
245  double thetap,
246  int imucpp,
247  const cs_real_t coefbp[],
248  const cs_real_t cofbfp[],
249  const cs_real_t rovsdt[],
250  const cs_real_t i_massflux[],
251  const cs_real_t b_massflux[],
252  const cs_real_t i_visc[],
253  const cs_real_t b_visc[],
254  const cs_real_t xcpp[],
255  cs_real_t *restrict da,
256  cs_real_2_t *restrict xa);
257 
258 /*----------------------------------------------------------------------------*/
289 /*----------------------------------------------------------------------------*/
290 
291 void
293  int idiffp,
294  int ndircp,
295  double thetap,
296  const cs_real_33_t cofbfu[],
297  const cs_real_33_t fimp[],
298  const cs_real_t i_visc[],
299  const cs_real_t b_visc[],
301  cs_real_t *restrict xa);
302 
303 /*----------------------------------------------------------------------------*/
341 /*----------------------------------------------------------------------------*/
342 
343 void
344 cs_matrix_vector(const cs_mesh_t *m,
345  int iconvp,
346  int idiffp,
347  int ndircp,
348  double thetap,
349  const cs_real_33_t coefbu[],
350  const cs_real_33_t cofbfu[],
351  const cs_real_33_t fimp[],
352  const cs_real_t i_massflux[],
353  const cs_real_t b_massflux[],
354  const cs_real_t i_visc[],
355  const cs_real_t b_visc[],
357  cs_real_2_t *restrict xa);
358 
359 /*----------------------------------------------------------------------------*/
386 /*----------------------------------------------------------------------------*/
387 
388 void
390  int iconvp,
391  int idiffp,
392  int isym,
393  const cs_real_t coefbp[],
394  const cs_real_t cofbfp[],
395  const cs_real_t i_massflux[],
396  const cs_real_t b_massflux[],
397  const cs_real_t i_visc[],
398  const cs_real_t b_visc[],
399  cs_real_t *restrict da);
400 
401 /*----------------------------------------------------------------------------*/
440 /*----------------------------------------------------------------------------*/
441 
442 void
444  int iconvp,
445  int idiffp,
446  int ndircp,
447  double thetap,
448  const cs_real_33_t coefbu[],
449  const cs_real_33_t cofbfu[],
450  const cs_real_33_t fimp[],
451  const cs_real_t i_massflux[],
452  const cs_real_t b_massflux[],
453  const cs_real_33_t i_visc[],
454  const cs_real_t b_visc[],
456  cs_real_332_t *restrict xa);
457 
458 /*----------------------------------------------------------------------------*/
489 /*----------------------------------------------------------------------------*/
490 
491 void
493  int idiffp,
494  int ndircp,
495  double thetap,
496  const cs_real_33_t cofbfu[],
497  const cs_real_33_t fimp[],
498  const cs_real_33_t i_visc[],
499  const cs_real_t b_visc[],
501  cs_real_33_t *restrict xa);
502 
503 /*----------------------------------------------------------------------------*/
504 
506 
507 #endif /* __CS_MATRIX_BUILDING_H__ */
#define restrict
Definition: cs_defs.h:122
void matrxv(const cs_int_t *const iconvp, const cs_int_t *const idiffp, const cs_int_t *const ndircp, const cs_int_t *const isym, const cs_real_t *const thetap, const cs_real_33_t coefbu[], const cs_real_33_t cofbfu[], const cs_real_33_t fimp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_33_t da[], cs_real_t xa[])
Definition: cs_matrix_building.c:180
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition: cs_defs.h:306
void cs_matrix_anisotropic_diffusion(const cs_mesh_t *m, int iconvp, int idiffp, int ndircp, double thetap, const cs_real_33_t coefbu[], const cs_real_33_t cofbfu[], const cs_real_33_t fimp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_33_t i_visc[], const cs_real_t b_visc[], cs_real_33_t *restrict da, cs_real_332_t *restrict xa)
Build the advection/diffusion matrix for a vector field with a tensorial diffusivity.
Definition: cs_matrix_building.c:1208
void matrix(const cs_int_t *const iconvp, const cs_int_t *const idiffp, const cs_int_t *const ndircp, const cs_int_t *const isym, const cs_real_t *const thetap, const cs_int_t *const imucpp, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t da[], cs_real_t xa[])
Definition: cs_matrix_building.c:113
#define BEGIN_C_DECLS
Definition: cs_defs.h:405
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
void cs_sym_matrix_scalar(const cs_mesh_t *m, int idiffp, int ndircp, double thetap, const cs_real_t cofbfp[], const cs_real_t rovsdt[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *restrict da, cs_real_t *restrict xa)
Build the diffusion matrix for a scalar field. (symmetric matrix).
Definition: cs_matrix_building.c:371
void cs_sym_matrix_anisotropic_diffusion(const cs_mesh_t *m, int idiffp, int ndircp, double thetap, const cs_real_33_t cofbfu[], const cs_real_33_t fimp[], const cs_real_33_t i_visc[], const cs_real_t b_visc[], cs_real_33_t *restrict da, cs_real_33_t *restrict xa)
Build the diffusion matrix for a vector field with a tensorial diffusivity (symmetric matrix)...
Definition: cs_matrix_building.c:1374
void matrvv(const cs_int_t *const iconvp, const cs_int_t *const idiffp, const cs_int_t *const ndircp, const cs_int_t *const isym, const cs_real_t *const thetap, const cs_real_33_t coefbu[], const cs_real_33_t cofbfu[], const cs_real_33_t fimp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_33_t i_visc[], const cs_real_t b_visc[], cs_real_33_t da[], cs_real_332_t xa[])
Definition: cs_matrix_building.c:275
Definition: cs_mesh.h:62
void cs_sym_matrix_vector(const cs_mesh_t *m, int idiffp, int ndircp, double thetap, const cs_real_33_t cofbfu[], const cs_real_33_t fimp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_33_t *restrict da, cs_real_t *restrict xa)
Build the diffusion matrix for a vector field (symmetric matrix).
Definition: cs_matrix_building.c:744
void cs_matrix_scalar(const cs_mesh_t *m, int iconvp, int idiffp, int ndircp, double thetap, int imucpp, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t *restrict da, cs_real_2_t *restrict xa)
Build the advection/diffusion matrix for a scalar field.
Definition: cs_matrix_building.c:525
cs_real_33_t cs_real_332_t[2]
vector of 2 3x3 matrices of floating-point values
Definition: cs_defs.h:313
void matrdt(const cs_int_t *const iconvp, const cs_int_t *const idiffp, const cs_int_t *const isym, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t da[])
Definition: cs_matrix_building.c:241
void cs_matrix_time_step(const cs_mesh_t *m, int iconvp, int idiffp, int isym, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_t *restrict da)
Build the diagonal of the advection/diffusion matrix for determining the variable time step...
Definition: cs_matrix_building.c:1048
#define END_C_DECLS
Definition: cs_defs.h:406
double cs_real_t
Definition: cs_defs.h:296
void cs_matrix_vector(const cs_mesh_t *m, int iconvp, int idiffp, int ndircp, double thetap, const cs_real_33_t coefbu[], const cs_real_33_t cofbfu[], const cs_real_33_t fimp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_33_t *restrict da, cs_real_2_t *restrict xa)
Build the advection/diffusion matrix for a vector field (non-symmetric matrix).
Definition: cs_matrix_building.c:895
#define CS_PROCF(x, y)
Definition: cs_defs.h:419
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition: cs_defs.h:311