programmer's documentation
cs_cdofb_scaleq.h
Go to the documentation of this file.
1 #ifndef __CS_CDOFB_SCALEQ_H__
2 #define __CS_CDOFB_SCALEQ_H__
3 
4 /*============================================================================
5  * Build an algebraic CDO face-based system for convection/diffusion equation
6  * with source terms
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2015 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 
31 #include "cs_defs.h"
32 
33 /*----------------------------------------------------------------------------
34  * Standard C library headers
35  *----------------------------------------------------------------------------*/
36 
37 /*----------------------------------------------------------------------------
38  * Local headers
39  *----------------------------------------------------------------------------*/
40 
41 #include "cs_base.h"
42 #include "cs_mesh.h"
43 #include "cs_field.h"
44 #include "cs_cdo_connect.h"
45 #include "cs_cdo_quantities.h"
46 #include "cs_equation_priv.h"
47 
48 /*----------------------------------------------------------------------------*/
49 
51 
52 /*============================================================================
53  * Macro definitions
54  *============================================================================*/
55 
56 /*============================================================================
57  * Type definitions
58  *============================================================================*/
59 
60 /* Algebraic system for CDO face-based discretization */
61 typedef struct _cs_cdofb_scaleq_t cs_cdofb_scaleq_t;
62 
63 /*============================================================================
64  * Public function prototypes
65  *============================================================================*/
66 
67 /*----------------------------------------------------------------------------*/
73 /*----------------------------------------------------------------------------*/
74 
75 void
77 
78 /*----------------------------------------------------------------------------*/
82 /*----------------------------------------------------------------------------*/
83 
84 void
86 
87 /*----------------------------------------------------------------------------*/
94 /*----------------------------------------------------------------------------*/
95 
96 cs_real_t *
98 
99 /*----------------------------------------------------------------------------*/
111 /*----------------------------------------------------------------------------*/
112 
113 void *
115  const cs_mesh_t *mesh,
116  const cs_cdo_connect_t *connect,
117  const cs_cdo_quantities_t *quant,
118  const cs_time_step_t *time_step);
119 
120 /*----------------------------------------------------------------------------*/
128 /*----------------------------------------------------------------------------*/
129 
130 void *
131 cs_cdofb_scaleq_free(void *builder);
132 
133 /*----------------------------------------------------------------------------*/
139 /*----------------------------------------------------------------------------*/
140 
141 void
142 cs_cdofb_scaleq_compute_source(void *builder);
143 
144 /*----------------------------------------------------------------------------*/
156 /*----------------------------------------------------------------------------*/
157 
158 void
160  const cs_real_t *field_val,
161  double dt_cur,
162  void *builder,
163  cs_real_t **rhs,
164  cs_sla_matrix_t **sla_mat);
165 
166 /*----------------------------------------------------------------------------*/
175 /*----------------------------------------------------------------------------*/
176 
177 void
179  void *builder,
180  cs_real_t *field_val);
181 
182 /*----------------------------------------------------------------------------*/
190 /*----------------------------------------------------------------------------*/
191 
192 void
193 cs_cdofb_scaleq_post(const char *eqname,
194  const cs_field_t *field,
195  void *builder);
196 
197 /*----------------------------------------------------------------------------*/
206 /*----------------------------------------------------------------------------*/
207 
208 const double *
209 cs_cdofb_scaleq_get_face_values(const void *builder,
210  const cs_field_t *field);
211 
212 /*----------------------------------------------------------------------------*/
213 
215 
216 #endif /* __CS_CDOFB_SCALEQ_H__ */
const double * cs_cdofb_scaleq_get_face_values(const void *builder, const cs_field_t *field)
Get the computed values at each face.
Definition: cs_cdofb_scaleq.c:876
time step descriptor
Definition: cs_time_step.h:51
void cs_cdofb_scaleq_compute_source(void *builder)
Compute the contributions of source terms (store inside builder)
Definition: cs_cdofb_scaleq.c:643
Field descriptor.
Definition: cs_field.h:99
Definition: cs_equation_priv.h:100
void cs_cdofb_scaleq_build_system(const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, void *builder, cs_real_t **rhs, cs_sla_matrix_t **sla_mat)
Build the linear system arising from a scalar convection/diffusion equation with a CDO face-based sch...
Definition: cs_cdofb_scaleq.c:702
void cs_cdofb_scaleq_free_buffer(void)
Free work buffer related to cdo face-based schemes.
Definition: cs_cdofb_scaleq.c:445
#define BEGIN_C_DECLS
Definition: cs_defs.h:429
Definition: cs_cdo_connect.h:67
Definition: field.f90:27
void cs_cdofb_scaleq_update_field(const cs_real_t *solu, void *builder, cs_real_t *field_val)
Post-process the solution of a scalar convection/diffusion equation solved with a CDO face-based sche...
Definition: cs_cdofb_scaleq.c:748
Definition: cs_cdo_quantities.h:86
Definition: cs_sla.h:86
Definition: cs_mesh.h:62
void * cs_cdofb_scaleq_init(const cs_equation_param_t *eqp, const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step)
Initialize a cs_cdofb_scaleq_t structure.
Definition: cs_cdofb_scaleq.c:488
cs_real_t * cs_cdofb_scaleq_get_tmpbuf(void)
Retrieve a pointer to a temporary buffer related to scalar equations discretized with CDO face-based ...
Definition: cs_cdofb_scaleq.c:464
void cs_cdofb_scaleq_init_buffer(const cs_cdo_connect_t *connect)
Allocate work buffer related to cdo face-based schemes.
Definition: cs_cdofb_scaleq.c:426
void * cs_cdofb_scaleq_free(void *builder)
Destroy a cs_cdofb_scaleq_t structure.
Definition: cs_cdofb_scaleq.c:604
#define END_C_DECLS
Definition: cs_defs.h:430
double cs_real_t
Definition: cs_defs.h:296
void cs_cdofb_scaleq_post(const char *eqname, const cs_field_t *field, void *builder)
Post-processing related to this equation.
Definition: cs_cdofb_scaleq.c:820
Definition: mesh.f90:26