9.2
general documentation
cs_hho_stokes.h
Go to the documentation of this file.
1#ifndef CS_HHO_STOKES_H
2#define CS_HHO_STOKES_H
3
4/*============================================================================
5 * Build an algebraic system for scalar conv./diff. eq. with Hybrid High Order
6 * space discretization
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2026 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 "alge/cs_matrix.h"
35#include "base/cs_base.h"
36#include "base/cs_field.h"
37#include "base/cs_time_step.h"
38#include "cdo/cs_cdo_connect.h"
39#include "cdo/cs_cdo_local.h"
42#include "cdo/cs_hho_builder.h"
43#include "cdo/cs_source_term.h"
44#include "mesh/cs_mesh.h"
45
46/*============================================================================
47 * Macro definitions
48 *============================================================================*/
49
50/*============================================================================
51 * Type definitions
52 *============================================================================*/
53
54/* Algebraic system for HHO discretization */
55typedef struct _cs_hho_stokes_t cs_hho_stokes_t;
56
57/*============================================================================
58 * Public function prototypes
59 *============================================================================*/
60
61/*----------------------------------------------------------------------------*/
78/*----------------------------------------------------------------------------*/
79
80void
82 const cs_cdo_quantities_t *quant,
83 const cs_cdo_connect_t *connect,
84 const cs_time_step_t *time_step,
85 const cs_matrix_assembler_t *ma0,
86 const cs_matrix_assembler_t *ma1,
87 const cs_matrix_assembler_t *ma2,
88 const cs_matrix_structure_t *ms0,
89 const cs_matrix_structure_t *ms1,
90 const cs_matrix_structure_t *ms2);
91
92/*----------------------------------------------------------------------------*/
100/*----------------------------------------------------------------------------*/
101
102void
105 cs_hho_builder_t **hhob);
106
107/*----------------------------------------------------------------------------*/
111/*----------------------------------------------------------------------------*/
112
113void
115
116/*----------------------------------------------------------------------------*/
126/*----------------------------------------------------------------------------*/
127
128void *
131
132/*----------------------------------------------------------------------------*/
140/*----------------------------------------------------------------------------*/
141
142void *
144
145/*----------------------------------------------------------------------------*/
153/*----------------------------------------------------------------------------*/
154
155void
158 void *data);
159
160/*----------------------------------------------------------------------------*/
172/*----------------------------------------------------------------------------*/
173
174void
177 void *data,
178 cs_matrix_t **system_matrix,
179 cs_real_t **system_rhs);
180
181/*----------------------------------------------------------------------------*/
194/*----------------------------------------------------------------------------*/
195
196void
198 const cs_real_t *field_val,
199 double dt_cur,
200 const cs_equation_param_t *eqp,
202 void *data);
203
204/*----------------------------------------------------------------------------*/
216/*----------------------------------------------------------------------------*/
217
218void
220 const cs_real_t *rhs,
221 const cs_equation_param_t *eqp,
223 void *data,
224 cs_real_t *field_val);
225
226/*----------------------------------------------------------------------------*/
235/*----------------------------------------------------------------------------*/
236
237double *
238cs_hho_stokes_get_face_values(const void *data);
239
240/*----------------------------------------------------------------------------*/
249/*----------------------------------------------------------------------------*/
250
251double *
252cs_hho_stokes_get_cell_values(const void *data);
253
254/*----------------------------------------------------------------------------*/
264/*----------------------------------------------------------------------------*/
265
266void
267cs_hho_stokes_extra_op(const char *eqname,
268 const cs_field_t *field,
269 const cs_equation_param_t *eqp,
271 void *data);
272
273#endif /* CS_HHO_STOKES_H */
Field descriptor.
Definition: cs_field.h:275
time step descriptor
Definition: cs_time_step.h:60
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
unsigned short int cs_flag_t
Definition: cs_defs.h:334
double * cs_hho_stokes_get_face_values(const void *data)
Get the computed values at faces (DoF used in the linear system are located at primal faces)
Definition: cs_hho_stokes.cpp:742
void cs_hho_stokes_update_field(const cs_real_t *solu, const cs_real_t *rhs, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_real_t *field_val)
Store solution(s) of the linear system into a field structure Update extra-field values required for ...
Definition: cs_hho_stokes.cpp:701
void cs_hho_stokes_initialize_system(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data, cs_matrix_t **system_matrix, cs_real_t **system_rhs)
Create the matrix of the current algebraic system. Allocate and initialize the right-hand side associ...
void * cs_hho_stokes_free_context(void *data)
Destroy a cs_hho_stokes_t structure.
Definition: cs_hho_stokes.cpp:575
void cs_hho_stokes_compute_source(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data)
Compute the contributions of source terms (store inside builder)
Definition: cs_hho_stokes.cpp:608
void cs_hho_stokes_build_system(const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data)
Build the linear system arising from a scalar convection/diffusion equation with a HHO scheme....
Definition: cs_hho_stokes.cpp:646
void cs_hho_stokes_get(cs_cell_sys_t **csys, cs_cell_builder_t **cb, cs_hho_builder_t **hhob)
Retrieve work buffers used for building a CDO system cellwise.
Definition: cs_hho_stokes.cpp:397
void cs_hho_stokes_finalize(void)
Free buffers and generic structures related to HHO schemes.
Definition: cs_hho_stokes.cpp:415
double * cs_hho_stokes_get_cell_values(const void *data)
Get the computed values at cells (DoF used in the linear system are located at primal faces)
Definition: cs_hho_stokes.cpp:764
void cs_hho_stokes_initialize(cs_flag_t scheme_flag, const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step, const cs_matrix_assembler_t *ma0, const cs_matrix_assembler_t *ma1, const cs_matrix_assembler_t *ma2, const cs_matrix_structure_t *ms0, const cs_matrix_structure_t *ms1, const cs_matrix_structure_t *ms2)
Allocate work buffer and general structures related to HHO schemes Set shared pointers.
Definition: cs_hho_stokes.cpp:283
void * cs_hho_stokes_init_context(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb)
Initialize a cs_hho_stokes_t structure storing data useful for managing such a scheme.
Definition: cs_hho_stokes.cpp:452
void cs_hho_stokes_extra_op(const char *eqname, const cs_field_t *field, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *data)
Predefined extra-operations related to this equation.
Definition: cs_hho_stokes.cpp:787
struct _cs_matrix_structure_t cs_matrix_structure_t
Definition: cs_matrix.h:104
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:108
struct _cs_matrix_assembler_t cs_matrix_assembler_t
Definition: cs_matrix_assembler.h:61
double precision, dimension(:,:), pointer solu
Definition: atincl.f90:260
Definition: field.f90:27
Definition: mesh.f90:26
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Set of local and temporary buffers.
Definition: cs_cdo_local.h:56
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:163
Store common elements used when building an algebraic system related to an equation.
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Definition: cs_hho_builder.h:50
Definition: cs_mesh.h:85