8.0
general documentation
Loading...
Searching...
No Matches
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-2023 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 * Fortran wrapper to cs_matrix_scalar (or its counterpart for
59 * symmetric matrices)
60 *----------------------------------------------------------------------------*/
61
62void CS_PROCF (matrix, MATRIX)
63(
64 const int *iconvp,
65 const int *idiffp,
66 const int *ndircp,
67 const int *isym,
68 const cs_real_t *thetap,
69 const int *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 * Fortran wrapper to cs_matrix_time_step
84 *----------------------------------------------------------------------------*/
85
86void CS_PROCF (matrdt, MATRDT)
87(
88 const int *const iconvp,
89 const int *const idiffp,
90 const int *const isym,
91 const cs_real_t coefbp[],
92 const cs_real_t cofbfp[],
93 const cs_real_t i_massflux[],
94 const cs_real_t b_massflux[],
95 const cs_real_t i_visc[],
96 const cs_real_t b_visc[],
97 cs_real_t da[]
98);
99
100/*=============================================================================
101 * Public function prototypes
102 *============================================================================*/
103
104/*----------------------------------------------------------------------------
105 * Wrapper to cs_matrix_scalar (or its counterpart for
106 * symmetric matrices)
107 *----------------------------------------------------------------------------*/
108
109void
110cs_matrix_wrapper_scalar(int iconvp,
111 int idiffp,
112 int ndircp,
113 int isym,
114 double thetap,
115 int imucpp,
116 const cs_real_t coefbp[],
117 const cs_real_t cofbfp[],
118 const cs_real_t rovsdt[],
119 const cs_real_t i_massflux[],
120 const cs_real_t b_massflux[],
121 const cs_real_t i_visc[],
122 const cs_real_t b_visc[],
123 const cs_real_t xcpp[],
124 cs_real_t da[],
125 cs_real_t xa[]);
126
127/*----------------------------------------------------------------------------
128 * Wrapper to cs_matrix_vector (or its counterpart for
129 * symmetric matrices)
130 *----------------------------------------------------------------------------*/
131
132void
133cs_matrix_wrapper_vector(int iconvp,
134 int idiffp,
135 int tensorial_diffusion,
136 int ndircp,
137 int isym,
138 cs_lnum_t eb_size,
139 double thetap,
140 const cs_real_33_t coefbu[],
141 const cs_real_33_t cofbfu[],
142 const cs_real_33_t fimp[],
143 const cs_real_t i_massflux[],
144 const cs_real_t b_massflux[],
145 const cs_real_t i_visc[],
146 const cs_real_t b_visc[],
147 cs_real_33_t da[],
148 cs_real_t xa[]);
149
150/*----------------------------------------------------------------------------
151 * Wrapper to cs_matrix_tensor (or its counterpart for
152 * symmetric matrices)
153 *----------------------------------------------------------------------------*/
154
155void
156cs_matrix_wrapper_tensor(int iconvp,
157 int idiffp,
158 int tensorial_diffusion,
159 int ndircp,
160 int isym,
161 double thetap,
162 const cs_real_66_t coefbts[],
163 const cs_real_66_t cofbfts[],
164 const cs_real_66_t fimp[],
165 const cs_real_t i_massflux[],
166 const cs_real_t b_massflux[],
167 const cs_real_t i_visc[],
168 const cs_real_t b_visc[],
169 cs_real_66_t da[],
170 cs_real_t xa[]);
171
172/*----------------------------------------------------------------------------*/
202/*----------------------------------------------------------------------------*/
203
204void
206 int idiffp,
207 double thetap,
208 const cs_real_t cofbfp[],
209 const cs_real_t rovsdt[],
210 const cs_real_t i_visc[],
211 const cs_real_t b_visc[],
213 cs_real_t *restrict xa);
214
215/*----------------------------------------------------------------------------*/
245/*----------------------------------------------------------------------------*/
246
247void
249 int idiffp,
250 double thetap,
251 const cs_real_66_t cofbfts[],
252 const cs_real_66_t fimp[],
253 const cs_real_t i_visc[],
254 const cs_real_t b_visc[],
256 cs_real_t *restrict xa);
257
258/*----------------------------------------------------------------------------*/
295/*----------------------------------------------------------------------------*/
296
297void
299 int iconvp,
300 int idiffp,
301 double thetap,
302 const cs_real_66_t coefbts[],
303 const cs_real_66_t cofbfts[],
304 const cs_real_66_t fimp[],
305 const cs_real_t i_massflux[],
306 const cs_real_t b_massflux[],
307 const cs_real_t i_visc[],
308 const cs_real_t b_visc[],
311
312/*----------------------------------------------------------------------------*/
352/*----------------------------------------------------------------------------*/
353
354void
356 int iconvp,
357 int idiffp,
358 double thetap,
359 int imucpp,
360 const cs_real_t coefbp[],
361 const cs_real_t cofbfp[],
362 const cs_real_t rovsdt[],
363 const cs_real_t i_massflux[],
364 const cs_real_t b_massflux[],
365 const cs_real_t i_visc[],
366 const cs_real_t b_visc[],
367 const cs_real_t xcpp[],
370
371/*----------------------------------------------------------------------------*/
401/*----------------------------------------------------------------------------*/
402
403void
405 int idiffp,
406 double thetap,
407 const cs_real_33_t cofbfu[],
408 const cs_real_33_t fimp[],
409 const cs_real_t i_visc[],
410 const cs_real_t b_visc[],
412 cs_real_t *restrict xa);
413
414/*----------------------------------------------------------------------------*/
453/*----------------------------------------------------------------------------*/
454
455void
457 const cs_mesh_quantities_t *mq,
458 int iconvp,
459 int idiffp,
460 cs_lnum_t eb_size,
461 double thetap,
462 const cs_real_33_t coefbu[],
463 const cs_real_33_t cofbfu[],
464 const cs_real_33_t fimp[],
465 const cs_real_t i_massflux[],
466 const cs_real_t b_massflux[],
467 const cs_real_t i_visc[],
468 const cs_real_t b_visc[],
471
472/*----------------------------------------------------------------------------*/
499/*----------------------------------------------------------------------------*/
500
501void
503 int iconvp,
504 int idiffp,
505 int isym,
506 const cs_real_t coefbp[],
507 const cs_real_t cofbfp[],
508 const cs_real_t i_massflux[],
509 const cs_real_t b_massflux[],
510 const cs_real_t i_visc[],
511 const cs_real_t b_visc[],
512 cs_real_t *restrict da);
513
514/*----------------------------------------------------------------------------*/
552/*----------------------------------------------------------------------------*/
553
554void
556 const cs_mesh_quantities_t *mq,
557 int iconvp,
558 int idiffp,
559 double thetap,
560 const cs_real_33_t coefbu[],
561 const cs_real_33_t cofbfu[],
562 const cs_real_33_t fimp[],
563 const cs_real_t i_massflux[],
564 const cs_real_t b_massflux[],
565 const cs_real_33_t i_visc[],
566 const cs_real_t b_visc[],
569
570/*----------------------------------------------------------------------------*/
607/*----------------------------------------------------------------------------*/
608
609void
611 int iconvp,
612 int idiffp,
613 double thetap,
614 const cs_real_66_t coefbu[],
615 const cs_real_66_t cofbfu[],
616 const cs_real_66_t fimp[],
617 const cs_real_t i_massflux[],
618 const cs_real_t b_massflux[],
619 const cs_real_66_t i_visc[],
620 const cs_real_t b_visc[],
623
624/*----------------------------------------------------------------------------*/
653/*----------------------------------------------------------------------------*/
654
655void
657 int idiffp,
658 double thetap,
659 const cs_real_33_t cofbfu[],
660 const cs_real_33_t fimp[],
661 const cs_real_33_t i_visc[],
662 const cs_real_t b_visc[],
665
666/*----------------------------------------------------------------------------*/
696/*----------------------------------------------------------------------------*/
697
698void
700 int idiffp,
701 double thetap,
702 const cs_real_66_t cofbfu[],
703 const cs_real_66_t fimp[],
704 const cs_real_66_t i_visc[],
705 const cs_real_t b_visc[],
708
709/*----------------------------------------------------------------------------*/
710
712
713#endif /* __CS_MATRIX_BUILDING_H__ */
#define restrict
Definition cs_defs.h:139
cs_real_t cs_real_66_t[6][6]
6x6 matrix of floating-point values
Definition cs_defs.h:342
cs_real_t cs_real_33_t[3][3]
3x3 matrix of floating-point values
Definition cs_defs.h:341
#define BEGIN_C_DECLS
Definition cs_defs.h:509
double cs_real_t
Floating-point value.
Definition cs_defs.h:319
#define CS_PROCF(x, y)
Definition cs_defs.h:523
cs_real_t cs_real_2_t[2]
vector of 2 floating-point values
Definition cs_defs.h:331
cs_real_66_t cs_real_662_t[2]
Definition cs_defs.h:355
cs_real_33_t cs_real_332_t[2]
vector of 2 3x3 matrices of floating-point values
Definition cs_defs.h:353
#define END_C_DECLS
Definition cs_defs.h:510
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:313
void matrdt(const int *const iconvp, const int *const idiffp, const int *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:153
void matrix(const int *iconvp, const int *idiffp, const int *ndircp, const int *isym, const cs_real_t *thetap, const 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 da[], cs_real_t xa[])
Definition cs_matrix_building.c:111
void cs_sym_matrix_anisotropic_diffusion_tensor(const cs_mesh_t *m, int idiffp, double thetap, const cs_real_66_t cofbfu[], const cs_real_66_t fimp[], const cs_real_66_t i_visc[], const cs_real_t b_visc[], cs_real_66_t *restrict da, cs_real_66_t *restrict xa)
Build the diffusion matrix for a vector field with a tensorial diffusivity (symmetric matrix).
Definition cs_matrix_building.c:2243
void cs_matrix_wrapper_tensor(int iconvp, int idiffp, int tensorial_diffusion, int ndircp, int isym, double thetap, const cs_real_66_t coefbts[], const cs_real_66_t cofbfts[], const cs_real_66_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_66_t da[], cs_real_t xa[])
Definition cs_matrix_building.c:408
void cs_matrix_vector(const cs_mesh_t *m, const cs_mesh_quantities_t *mq, int iconvp, int idiffp, cs_lnum_t eb_size, 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:1160
void cs_sym_matrix_vector(const cs_mesh_t *m, int idiffp, 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:914
void cs_matrix_tensor(const cs_mesh_t *m, int iconvp, int idiffp, double thetap, const cs_real_66_t coefbts[], const cs_real_66_t cofbfts[], const cs_real_66_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_66_t *restrict da, cs_real_2_t *restrict xa)
Build the advection/diffusion matrix for a tensor field (non-symmetric matrix).
Definition cs_matrix_building.c:1442
void cs_matrix_wrapper_scalar(int iconvp, int idiffp, int ndircp, int isym, 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 da[], cs_real_t xa[])
Definition cs_matrix_building.c:191
void cs_sym_matrix_tensor(const cs_mesh_t *m, int idiffp, double thetap, const cs_real_66_t cofbfts[], const cs_real_66_t fimp[], const cs_real_t i_visc[], const cs_real_t b_visc[], cs_real_66_t *restrict da, cs_real_t *restrict xa)
Build the diffusion matrix for a tensor field (symmetric matrix).
Definition cs_matrix_building.c:1033
void cs_matrix_anisotropic_diffusion_tensor(const cs_mesh_t *m, int iconvp, int idiffp, double thetap, const cs_real_66_t coefbu[], const cs_real_66_t cofbfu[], const cs_real_66_t fimp[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_66_t i_visc[], const cs_real_t b_visc[], cs_real_66_t *restrict da, cs_real_662_t *restrict xa)
Build the advection/diffusion matrix for a tensor field with a tensorial diffusivity.
Definition cs_matrix_building.c:1956
void cs_matrix_anisotropic_diffusion(const cs_mesh_t *m, const cs_mesh_quantities_t *mq, int iconvp, int idiffp, 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:1744
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:1588
void cs_sym_matrix_scalar(const cs_mesh_t *m, int idiffp, 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:557
void cs_matrix_wrapper_vector(int iconvp, int idiffp, int tensorial_diffusion, int ndircp, int isym, cs_lnum_t eb_size, 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 da[], cs_real_t xa[])
Definition cs_matrix_building.c:280
void cs_sym_matrix_anisotropic_diffusion(const cs_mesh_t *m, int idiffp, 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:2114
void cs_matrix_scalar(const cs_mesh_t *m, int iconvp, int idiffp, 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:695
Definition cs_mesh_quantities.h:92
Definition cs_mesh.h:85