programmer's documentation
cs_sles_default.h
Go to the documentation of this file.
1 #ifndef __CS_SLES_DEFAULT_H__
2 #define __CS_SLES_DEFAULT_H__
3 
4 /*============================================================================
5  * Sparse Linear Equation Solvers
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_halo_perio.h"
36 #include "cs_matrix.h"
37 #include "cs_sles.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*============================================================================
44  * Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definitions
49  *============================================================================*/
50 
51 /*============================================================================
52  * Global variables
53  *============================================================================*/
54 
55 /*=============================================================================
56  * Public function prototypes
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------
60  * Default initializations for sparse linear equation solver API.
61  *----------------------------------------------------------------------------*/
62 
63 void
65 
66 /*----------------------------------------------------------------------------
67  * Default definition of a sparse linear equation solver
68  *
69  * parameters:
70  * f_id <-- associated field id, or < 0
71  * name <-- associated name if f_id < 0, or NULL
72  * a <-- matrix
73  *----------------------------------------------------------------------------*/
74 
75 void
76 cs_sles_default(int f_id,
77  const char *name,
78  const cs_matrix_t *a);
79 
80 /*----------------------------------------------------------------------------
81  * Default setup setup for sparse linear equation solver API.
82  *
83  * This includes setup logging.
84  *----------------------------------------------------------------------------*/
85 
86 void
88 
89 /*----------------------------------------------------------------------------
90  * Return default verbosity associated to a field id, name couple.
91  *
92  * parameters:
93  * f_id <-- associated field id, or < 0
94  * name <-- associated name if f_id < 0, or NULL
95  *
96  * returns:
97  * verbosity associated with field or name
98  *----------------------------------------------------------------------------*/
99 
100 int
102  const char *name);
103 
104 /*----------------------------------------------------------------------------
105  * Default finalization for sparse linear equation solver API.
106  *
107  * This includes performance data logging output.
108  *----------------------------------------------------------------------------*/
109 
110 void
112 
113 /*----------------------------------------------------------------------------
114  * Call sparse linear equation solver using native matrix arrays.
115  *
116  * parameters:
117  * f_id <-- associated field id, or < 0
118  * name <-- associated name if f_id < 0, or NULL
119  * symmetric <-- indicates if matrix coefficients are symmetric
120  * diag_block_size <-- block sizes for diagonal, or NULL
121  * extra_diag_block_size <-- block sizes for extra diagonal, or NULL
122  * da <-- diagonal values (NULL if zero)
123  * xa <-- extradiagonal values (NULL if zero)
124  * rotation_mode <-- halo update option for rotational periodicity
125  * r_epsilon <-- precision
126  * r_norm <-- residue normalization
127  * n_iter --> number of iterations
128  * residue --> residue
129  * rhs <-- right hand side
130  * vx <-> system solution
131  *
132  * returns:
133  * convergence state
134  *----------------------------------------------------------------------------*/
135 
137 cs_sles_solve_native(int f_id,
138  const char *name,
139  bool symmetric,
140  const int *diag_block_size,
141  const int *extra_diag_block_size,
142  const cs_real_t *da,
143  const cs_real_t *xa,
144  cs_halo_rotation_t rotation_mode,
145  double precision,
146  double r_norm,
147  int *n_iter,
148  double *residue,
149  const cs_real_t *rhs,
150  cs_real_t *vx);
151 
152 /*----------------------------------------------------------------------------
153  * Free sparse linear equation solver setup using native matrix arrays.
154  *
155  * parameters:
156  * f_id <-- associated field id, or < 0
157  * name <-- associated name if f_id < 0, or NULL
158  *----------------------------------------------------------------------------*/
159 
160 void
161 cs_sles_free_native(int f_id,
162  const char *name);
163 
164 /*----------------------------------------------------------------------------*/
165 
167 
168 #endif /* __CS_SLES_DEFAULT_H__ */
cs_halo_rotation_t
Definition: cs_halo.h:59
void cs_sles_default(int f_id, const char *name, const cs_matrix_t *a)
Default definition of a sparse linear equation solver.
Definition: cs_sles_default.c:122
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:89
cs_sles_convergence_state_t
Convergence status indicator.
Definition: cs_sles.h:55
void cs_sles_default_setup(void)
Default setup for sparse linear equation solver API.
Definition: cs_sles_default.c:200
double precision, save a
Definition: cs_fuel_incl.f90:146
void cs_sles_default_finalize(void)
Default finalization for sparse linear equation solver API.
Definition: cs_sles_default.c:282
int cs_sles_default_get_verbosity(int f_id, const char *name)
Return default verbosity associated to a field id, name couple.
Definition: cs_sles_default.c:302
#define END_C_DECLS
Definition: cs_defs.h:430
double cs_real_t
Definition: cs_defs.h:296
void cs_sles_free_native(int f_id, const char *name)
Free sparse linear equation solver setup using native matrix arrays.
Definition: cs_sles_default.c:477
cs_sles_convergence_state_t cs_sles_solve_native(int f_id, const char *name, bool symmetric, const int *diag_block_size, const int *extra_diag_block_size, const cs_real_t *da, const cs_real_t *xa, cs_halo_rotation_t rotation_mode, double precision, double r_norm, int *n_iter, double *residue, const cs_real_t *rhs, cs_real_t *vx)
Call sparse linear equation solver using native matrix arrays.
Definition: cs_sles_default.c:356
void cs_sles_default_log_setup(void)