programmer's documentation
cs_equation_common.h
Go to the documentation of this file.
1 #ifndef __CS_EQUATION_COMMON_H__
2 #define __CS_EQUATION_COMMON_H__
3 
4 /*============================================================================
5  * Routines to handle common equation features for building algebraic system
6  * in CDO schemes
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2018 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_bc.h"
34 #include "cs_cdo_connect.h"
35 #include "cs_cdo_quantities.h"
36 #include "cs_cdo_time.h"
37 #include "cs_matrix.h"
38 #include "cs_time_step.h"
39 #include "cs_timer.h"
40 #include "cs_source_term.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
50 /*============================================================================
51  * Type definitions
52  *============================================================================*/
53 
54 typedef struct {
55 
56  /* Monitoring the efficiency of the algorithm used to manipulate/build
57  an equation builder. */
58  cs_timer_counter_t tcb; /* Cumulated elapsed time for building
59  the current system */
60  /* tcb >= tcd + tca + tcr + tcs */
61  cs_timer_counter_t tcd; /* Cumulated elapsed time for building
62  diffusion terms */
63  cs_timer_counter_t tca; /* Cumulated elapsed time for building
64  advection terms */
65  cs_timer_counter_t tcr; /* Cumulated elapsed time for building
66  reaction terms */
67  cs_timer_counter_t tcs; /* Cumulated elapsed time for building
68  source terms */
69 
70  cs_timer_counter_t tce; /* Cumulated elapsed time for computing
71  all extra operations (post, balance,
72  fluxes...) */
73 
75 
76 /*============================================================================
77  * Public function prototypes
78  *============================================================================*/
79 
80 /*----------------------------------------------------------------------------*/
96 /*----------------------------------------------------------------------------*/
97 
98 void
100  const cs_cdo_quantities_t *quant,
101  const cs_time_step_t *time_step,
102  cs_flag_t scheme_flag);
103 
104 /*----------------------------------------------------------------------------*/
116 /*----------------------------------------------------------------------------*/
117 
118 void
120 
121 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 cs_real_t *
137  const cs_param_bc_t *bc_param,
138  const cs_cdo_bc_list_t *dir,
139  cs_cell_builder_t *cb);
140 
141 /*----------------------------------------------------------------------------*/
153 /*----------------------------------------------------------------------------*/
154 
155 void
157  const cs_range_set_t *rset,
158  cs_flag_t sys_flag,
159  cs_real_t *rhs,
160  cs_real_t *sources,
162 
163 /*----------------------------------------------------------------------------*/
172 /*----------------------------------------------------------------------------*/
173 
174 const cs_matrix_structure_t *
176 
177 /*----------------------------------------------------------------------------*/
186 /*----------------------------------------------------------------------------*/
187 
188 const cs_matrix_assembler_t *
190 
191 /*----------------------------------------------------------------------------*/
197 /*----------------------------------------------------------------------------*/
198 
199 const cs_connect_index_t *
201 
202 /*----------------------------------------------------------------------------*/
208 /*----------------------------------------------------------------------------*/
209 
210 const cs_connect_index_t *
212 
213 /*----------------------------------------------------------------------------*/
221 /*----------------------------------------------------------------------------*/
222 
223 cs_real_t *
225 
226 /*----------------------------------------------------------------------------*/
232 /*----------------------------------------------------------------------------*/
233 
234 size_t
236 
237 /*----------------------------------------------------------------------------*/
243 /*----------------------------------------------------------------------------*/
244 
247 
248 /*----------------------------------------------------------------------------*/
256 /*----------------------------------------------------------------------------*/
257 
258 void
259 cs_equation_write_monitoring(const char *eqname,
260  const cs_equation_monitor_t *monitor);
261 
262 /*----------------------------------------------------------------------------*/
263 
265 
266 #endif /* __CS_EQUATION_COMMON_H__ */
time step descriptor
Definition: cs_time_step.h:51
cs_timer_counter_t tcb
Definition: cs_equation_common.h:58
Definition: cs_cdo_bc.h:77
Definition: cs_cdo_toolbox.h:52
void cs_equation_write_monitoring(const char *eqname, const cs_equation_monitor_t *monitor)
Print a message in the performance output file related to the monitoring of equation.
Definition: cs_equation_common.c:913
struct _cs_matrix_assembler_values_t cs_matrix_assembler_values_t
Definition: cs_matrix_assembler.h:66
#define BEGIN_C_DECLS
Definition: cs_defs.h:451
Definition: cs_equation_common.h:54
const cs_matrix_structure_t * cs_equation_get_matrix_structure(cs_space_scheme_t scheme)
Retrieve a pointer to the associated cs_matrix_structure_t according to the space scheme...
Definition: cs_equation_common.c:754
void cs_equation_assemble_v(const cs_cell_sys_t *csys, const cs_range_set_t *rset, cs_flag_t sys_flag, cs_real_t *rhs, cs_real_t *sources, cs_matrix_assembler_values_t *mav)
Assemble a cellwise system related to cell vertices into the global algebraic system.
Definition: cs_equation_common.c:683
Definition: cs_cdo_connect.h:56
cs_timer_counter_t tce
Definition: cs_equation_common.h:70
cs_timer_counter_t tcr
Definition: cs_equation_common.h:65
cs_timer_counter_t tcd
Definition: cs_equation_common.h:61
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo_quantities.h:102
const cs_matrix_assembler_t * cs_equation_get_matrix_assembler(cs_space_scheme_t scheme)
Retrieve a pointer to the associated cs_matrix_assembler_t according to the space scheme...
Definition: cs_equation_common.c:791
Definition: cs_cdo_local.h:90
Definition: cs_mesh.h:63
void cs_equation_free_common_structures(cs_flag_t scheme_flag)
Allocate a pointer to a buffer of size at least the 2*n_cells for managing temporary usage of memory ...
Definition: cs_equation_common.c:443
cs_space_scheme_t
Definition: cs_cdo.h:148
void() cs_equation_monitor_t(const char *eqname, const void *builder)
Display information related to the monitoring of the current system.
Definition: cs_equation.c:263
cs_equation_monitor_t * cs_equation_init_monitoring(void)
Initialize a monitoring structure.
Definition: cs_equation_common.c:883
const cs_connect_index_t * cs_equation_get_v2v_index(void)
Get the connectivity vertex->vertices for the local rank.
Definition: cs_equation_common.c:825
cs_real_t * cs_equation_get_tmpbuf(void)
Retrieve a pointer to a buffer of size at least the 2*n_cells The size of the temporary buffer can be...
Definition: cs_equation_common.c:855
Definition: cs_range_set.h:57
Definition: cs_cdo_local.h:67
cs_timer_counter_t tcs
Definition: cs_equation_common.h:67
cs_real_t * cs_equation_compute_dirichlet_sv(const cs_mesh_t *mesh, const cs_param_bc_t *bc_param, const cs_cdo_bc_list_t *dir, cs_cell_builder_t *cb)
Compute the values of the Dirichlet BCs when DoFs are scalar_valued and attached to vertices...
Definition: cs_equation_common.c:512
#define END_C_DECLS
Definition: cs_defs.h:452
unsigned short int cs_flag_t
Definition: cs_defs.h:299
struct _cs_matrix_assembler_t cs_matrix_assembler_t
Definition: cs_matrix_assembler.h:62
void cs_equation_allocate_common_structures(const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step, cs_flag_t scheme_flag)
Allocate a pointer to a buffer of size at least the 2*n_cells for managing temporary usage of memory ...
Definition: cs_equation_common.c:283
size_t cs_equation_get_tmpbuf_size(void)
Get the allocation size of the temporary buffer.
Definition: cs_equation_common.c:869
cs_timer_counter_t tca
Definition: cs_equation_common.h:63
Definition: cs_param.h:298
const cs_connect_index_t * cs_equation_get_f2f_index(void)
Get the connectivity face->faces for the local rank.
Definition: cs_equation_common.c:839
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:86
Definition: mesh.f90:26
Definition: cs_timer.h:57